Py 3._x_
and
4.0](http://www.alcyone.com/software/empy/ANNOUNCE.html#full-list-of-changes-between-empy-3-x-and-4-0)
for a more comprehensive list.
--
Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 18 N 121 57 W && S
On 3 Sep 2023, at 18:10, Jan Erik Moström via Python-list wrote:
> I'm looking for some advice for how to write this in a clean way
Thanks for all the suggestion, I realize that I haven't written Python code in
a while. I should have remembered this myself !!! Thanks for reminding me.
=
On 3 Sep 2023, at 19:13, MRAB via Python-list wrote:
> You could use pass an anonymous function (a lambda) to re.sub:
Of course !! Thanks.
= jem
--
https://mail.python.org/mailman/listinfo/python-list
I'm looking for some advice for how to write this in a clean way
I want to replace some text using a regex-pattern, but before creating
replacement text I need to some file checking/copying etc. My code right now
look something like this:
def fix_stuff(m):
# Do various things that
module import error? I can provide files
and/or more details as well.
Thank you all for the help!
Take care,
Erik Brown
--
https://mail.python.org/mailman/listinfo/python-list
New submission from Erik De Bonte :
Recent discussions about PEP 681 (dataclass_transform) have focused on support
for descriptor-typed fields. See the email thread here:
https://mail.python.org/archives/list/typing-...@python.org/thread/BW6CB6URC4BCN54QSG2STINU2M7V4TQQ/
Initially we were
Erik Soma added the comment:
Certainly: https://github.com/python/cpython/pull/32011
--
___
Python tracker
<https://bugs.python.org/issue47071>
___
___
Pytho
Change by Erik Soma :
--
keywords: +patch
pull_requests: +30099
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/32011
___
Python tracker
<https://bugs.python.org/issu
Erik Soma added the comment:
Uploading my hack to `asyncio.windows_events.py` -- this is based off 3.10.2's
distribution.
--
Added file: https://bugs.python.org/file50692/windows_events.py
___
Python tracker
<https://bugs.python.org/issue47
New submission from Erik Soma :
Reproducer attached. Change `USE_PROACTOR` to `False` to use the
`SelectorEventLoop` instead, which doesn't exhibit this behavior.
The output on my machine when using the proactor loop is:
```
datagram received b'ping 1'
datagram received b'ping 2
Change by Erik Montnemery :
--
keywords: +patch
nosy: +emontnemery
nosy_count: 1.0 -> 2.0
pull_requests: +29504
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31355
___
Python tracker
<https://bugs.p
Change by Erik Montnemery :
--
nosy: +emontnemery
nosy_count: 2.0 -> 3.0
pull_requests: +29505
pull_request: https://github.com/python/cpython/pull/31355
___
Python tracker
<https://bugs.python.org/issu
New submission from Erik Montnemery :
logging.handlers.QueueHandler logs stack twice when stack_info=True:
>>> import logging
>>> from logging.handlers import QueueHandler, QueueListener
>>> from queue import Queue
>>> q = Queue()
>>>
Erik Gebeshuber added the comment:
There is some confusion in the answers that I want to clear up:
"Attribute docstrings" were suggested in PEP 224 in August 2000 and rejected
March 2001: https://www.python.org/dev/peps/pep-0224/
taleinat mentioned already PEP 258 from May 2001,
Erik Montnemery added the comment:
Maybe something like this:
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 735d477db4..8de913d8db 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -1291,7 +1291,8 @@ These are not used in annotations. They are building
Erik Montnemery added the comment:
I think elaborating in the documentation that only annotated attributes make it
to the underlying namedtuple() would be helpful, it's not obvious that they are
instead just class attributes.
--
___
Python
New submission from Erik Montnemery :
typing.NamedTuple behaves in surprising ways when it has default arguments
which lack type annotations:
>>> from typing import NamedTuple
>>> class MyTuple(NamedTuple):
... a = 1000
...
>>> tmp = MyTuple()
>>> tm
Erik Aronesty added the comment:
bug is worse than that:
perfectly valid redirected paths (winfsp ram drives for example) now break in
python 3.9.6 (maybe fixed in later version?)
>>> import pathlib
>>> p=pathlib.Path('C:\\Users\\erik\\Atakama')
>>> p.resolve()
Change by Erik Bray :
--
pull_requests: +27359
pull_request: https://github.com/python/cpython/pull/4149
___
Python tracker
<https://bugs.python.org/issue45
Change by Erik Bray :
--
keywords: +patch
nosy: +erik.bray
nosy_count: 1.0 -> 2.0
pull_requests: +27357
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/14013
___
Python tracker
<https://bugs.python.org/i
Erik Bray added the comment:
To my knowledge this issue is *not* fixed upstream. However, my PR no doubt
needs rebasing.
--
___
Python tracker
<https://bugs.python.org/issue31
Erik Bray added the comment:
That person was me--I have the keys to a cygwin buildbot, but it's currently
not running. I lost the urgency to make cygwin fully supported, though it's
come a long way. In particular the deprecation of distutils should help nix
some of the long-standing
Erik Bray added the comment:
Thanks for asking. Indeed the fix to that issue was included in
https://cygwin.com/git/?p=newlib-cygwin.git;a=commit;h=5ca28a0cd71436a84797d5d66831790004e0
and as Cygwin obsoletes old releases rather quickly I see no reason to keep
this issue open
Erik Janssens added the comment:
At least for us, the issue seems to be related to the MSVC runtime.
We compiled python with mingw using the mingw runtime, and the issue
was gone.
On Tue, 2021-10-19 at 09:02 +, Irit Katriel wrote:
> Irit Katriel added the comment:
> It doesn't loo
, a community-developed core Python
package for Astronomy (Astropy Collaboration, 2013, 2018).
We hope that you enjoy using Astropy as much as we enjoyed developing it!
Erik Tollerud
v4.3 Release Coordinator
on behalf of The Astropy Project
https://www.astropy.org/announcements/release-4.3.html
Erik Carstensen added the comment:
thanks for the pointer and sorry for the noise! I'll review your text.
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Erik Carstensen :
I can find partial information on how Python treats __main__.py here:
https://docs.python.org/3/library/__main__.html
However, it is not documented how python handles __main__.py when passing the
Python package to the interpreter without -m. If I have
Erik Faye-Lund added the comment:
After digging some more, I no longer suspect that this commit is to blame, but
instead some logic in Meson that effectively disabled the problematic code
under in our use-case before we upgraded our Visual Studio version.
The reason is that I was able
Change by Erik Faye-Lund :
--
title: Regression -> Regression in pathlib.path.read_text
___
Python tracker
<https://bugs.python.org/issue44487>
___
___
Python-
New submission from Erik Faye-Lund :
This commit lead to a regression when using Meson on Windows to build the Mesa
project:
https://github.com/python/cpython/commit/4827483f47906fecee6b5d9097df2a69a293a85c
The reason is that pathlib.read_text now uses the locale as the encoding when
Erik Y. Adams added the comment:
I still think the most important aspect of this is that pow() will return
complex numbers, contrary to what is implied by the statement I quoted at the
beginning of this thread.
Perhaps we should just borrow from the documentation for the power operator
I'm doing something that I've never done before and need some advise for
suitable libraries.
I want to
a) create diagrams similar to this one
https://www.dropbox.com/s/kyh7rxbcogvecs1/graph.png?dl=0 (but with more
nodes) and save them as PDFs or some format that can easily be converted
to
New submission from Erik Y. Adams :
https://docs.python.org/3/library/functions.html#pow
The built-in pow() function will return a complex number if the base is
negative and the exponent is a float between 0 and 1. For example, the value
returned by `pow(-1, 1.0/3)` is `(1.0002
New submission from Erik Carstensen :
If you call stop() on an already stopped event loop, then the next call to
run_forever will terminate after one loop iteration. I would expect the stop to
either be a nop, or to be invalid in this state (and raise an exception).
Example:
import asyncio
Erik Carstensen added the comment:
Would it make sense to make dataclasses iterable, like so?
def __iter__(self):
return (getattr(self, field.name) for field in fields(self))
With that in place, deprecating astuple would maybe be less disruptive
Erik Welch added the comment:
Thanks for taking a look Terry. I saw that error as well. It is separate from
this issue, and I don't think it is a bug. No other builtin functions or
methods that raise this error with this text have such a notice in their
docstring, so it doesn't seem
Change by Erik Welch :
--
keywords: +patch
pull_requests: +24271
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/25551
___
Python tracker
<https://bugs.python.org/issu
New submission from Erik Welch :
The new builtin `anext` does not have a signature (from
`inspect.signature(anext)`). This is expected, because `inspect` does not yet
support signatures with C NULL default value. However, `anext` also doesn't
have text in its docstring that describes its
New submission from Erik Carstensen :
It seems that the 'dataclass.astuple' function does a deepcopy of all fields.
This is not documented. Two problems:
1. Dictionary keys that rely on object identity are ruined:
import dataclasses
@dataclasses.dataclass
class Foo:
key
Erik Soma added the comment:
You can wrap your callable in a regular function:
```
def hack_c():
c = C()
def _(*args, **kwargs):
return c(*args, **kwargs)
return _
A.__del__ = hack_c()
```
Or (untested) make your callable an extension type
Erik Soma added the comment:
The CPython PR has gone stale waiting for core review, pinging this per the dev
guide.
--
___
Python tracker
<https://bugs.python.org/issue42
Erik Soma added the comment:
Seems I misframed the issue a bit. I didn't realize keyword arguments besides
'metaclass' were introduced with PEP 3115 with Python 3.0.
In any case I've posted a PR to update the docs and typeshed.
Typeshed PR for reference: https://github.com/python/typeshed
Change by Erik Soma :
--
keywords: +patch
pull_requests: +23000
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/24173
___
Python tracker
<https://bugs.python.org/issu
Erik Soma added the comment:
Can do.
I have found a blurb in the 3.6 What's New that confirms it was purposeful
(https://docs.python.org/3/whatsnew/3.6.html#index-37).
--
___
Python tracker
<https://bugs.python.org/issue42
New submission from Erik Soma :
The documentation (https://docs.python.org/3/library/functions.html#type) shows
type's signature as:
class type(object)
class type(name, bases, dict)
But the "actual" 2nd signature in CPython 3.6+ is:
class type(name, bases, dict, **kwargs)
**k
Change by Erik Soma :
--
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue42687>
___
___
Python-bugs-
Change by Erik Soma :
--
keywords: +patch
pull_requests: +22722
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/23857
___
Python tracker
<https://bugs.python.org/issu
New submission from Erik Soma :
'<>' is not recognized by the tokenize module as a single token, instead it is
two tokens.
```
$ python -c "import tokenize; import io; import pprint;
pprint.pprint(list(tokenize.tokenize(io.BytesIO(b'<>').readline)))"
[TokenInfo(type
I want to do some text substitutions but a bit more advanced than what
string.Template class can do. I addition to plain text substitution I
would like to be able to do some calculations:
$value+1 - If value is 16 this would insert 17 in the text. I would also
like to subtract.
$value+1w -
Change by Erik Lamers :
--
title: Eval with two high string multiplication crashes newer Python versions
-> Eval with too high string multiplication crashes newer Python versions
___
Python tracker
<https://bugs.python.org/issu
Change by Erik Lamers :
--
versions: +Python 3.7, Python 3.8, Python 3.9
___
Python tracker
<https://bugs.python.org/issue42609>
___
___
Python-bugs-list mailin
New submission from Erik Lamers :
For Python version 3.7 and above the following statement will end up in a
segfault.
eval("1 + 100"*100)
Whereas Python versions 3.6 and below would tread this as a Recursion error.
--
components: Interpreter Core
messages: 382791
Erik Cederstrand added the comment:
There are two conflicting interests: ISO 8601 that allows non-precise
durations, and timedelta that assumes precise durations.
For me, the non-precise durations only make sense in date arithmetic - to a
human, it's pretty clear what adding 3 months
is:
This research made use of Astropy, a community-developed core Python
package for Astronomy (Astropy Collaboration, 2018).
We hope that you enjoy using Astropy as much as we enjoyed developing it!
Erik Tollerud
v4.1 Release Coordinator
on behalf of The Astropy Project
https://www.astropy.org
Erik Cederstrand added the comment:
Among other things, ISO 8601 duration strings are commonly used to communicate
offset values in timezone definitions.
--
___
Python tracker
<https://bugs.python.org/issue42
New submission from Erik Cederstrand :
Python 3.7 gained support for parsing ISO 8601 formatted time, date and
datetime strings via the fromisoformat() methods. Python has seen improved
support for ISO 8601 in general; ISO calendar format codes were added in Python
3.6, and fromisocalendar
Change by Erik Bray :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Erik Welch :
--
keywords: +patch
pull_requests: +21720
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/22757
___
Python tracker
<https://bugs.python.org/issu
Change by Erik Welch :
--
nosy: +eriknw
nosy_count: 8.0 -> 9.0
pull_requests: +21721
pull_request: https://github.com/python/cpython/pull/22757
___
Python tracker
<https://bugs.python.org/issu
New submission from Erik Welch :
The following is new to Python 3.9, and I consider the implementation
incomplete. I have code that works for Python 3.8 and before, but not for
Python 3.9:
"Class methods can now wrap other :term:`descriptors ` such as
:func:`property`."
https://
Change by Erik Bray :
--
keywords: +patch
nosy: +erik.bray
nosy_count: 4.0 -> 5.0
pull_requests: +21125
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/21918
___
Python tracker
<https://bugs.python.org/i
New submission from Erik Quaeghebeur :
>From Python 3.6 onwards, get/set_payload methods are deprecated on the basic
>email message class, email.message.EmailMessage (changed from
>email.message.Message). The get/set_content methods are suggested instead.
>However, with get/set
Erik Quaeghebeur added the comment:
The script that triggered the issue can be found at
https://github.com/equaeghe/mailfilters/blob/master/html2alternative.py
You'll have to remove ", cte='8bit'" on line 68 to expose the bug (that was
added as a workaround for thi
New submission from Erik Quaeghebeur :
I got the following error (Python 3.7.8):
Traceback (most recent call last):
File "/home/equaeghe/.local/bin/html2alternative.py", line 68, in
replaceable.add_alternative(plain)
File "/usr/lib/python3.7/email/message
Erik Quaeghebeur added the comment:
We also shouldn't forget Resent-Message-Id.
So in the header registry
<https://github.com/python/cpython/blob/2a9f709ba23c8f6aa2bed821aacc4e7baecde383/Lib/email/headerregistry.py#L562>,
'message-id': MessageIDHeader,
should be replaced by
'mess
Erik Quaeghebeur added the comment:
Note that In-Reply-To can also contain multiple message ids:
<https://tools.ietf.org/html/rfc5322#section-3.6.4>.
It should be treated the same as References.
When you say that a message_id parser exists, then that means it is not applied
to the Mess
New submission from Erik Quaeghebeur :
Encoded-word is apparently used for header line folding sometimes. This appears
to me as an abuse of this encoding technique. However, that is not the main
issue: it also causes a violation of RFC 2074, as it also encodes message id's:
https
Erik Bray added the comment:
Indeed, this can be closed.
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Erik Bray :
--
pull_requests: +20873
pull_request: https://github.com/python/cpython/pull/21729
___
Python tracker
<https://bugs.python.org/issue20
Erik Aronesty added the comment:
> The Scripts/bin thing is not specific to venv - for whatever reason, the
> original Windows implementation chose to use "Scripts" rather than "bin"
That's irrelevant to the PR, which solves the problem in a compatible way.
Erik Aronesty added the comment:
See https://github.com/python/cpython/pull/18083 for an example of a 'simple
copy' for shell script compatibility ... rather than trying to make Scripts
move around (which it can't trivially).
--
___
Python
Change by Erik Aronesty :
--
pull_requests: +17474
pull_request: https://github.com/python/cpython/pull/18083
___
Python tracker
<https://bugs.python.org/issue35
Erik Aronesty added the comment:
the single Scripts/activate tool should be simply copied to bin/activate ...
this is what you have to do to write a bash script for python now:
source bin/activate || source Scripts/activate
we should not assume that all windows users use things like CMD
, a community-developed core Python
package for Astronomy (Astropy Collaboration, 2018).
Special thanks to the coordinator for this release: Brigitta Sipocz.
We hope that you enjoy using Astropy as much as we enjoyed developing it!
Erik Tollerud, Tom Robitaille, Kelle Cruz, and Tom Aldcroft
Erik Cederstrand added the comment:
Additionally, the output in the 2nd example does not contain the helpful text
printing the context and location of the code containing the syntax error.
--
___
Python tracker
<https://bugs.python.org/issue38
New submission from Erik Cederstrand :
When I have a normal syntax error in a file, Python reports the filename in the
exception output:
$ cat syntax_error.py
0x=5
$ python3.8 syntax_error.py
File "syntax_error.py", line 1
0x=5
^
SyntaxError: invalid hexadecim
Erik Aronesty added the comment:
This is the fist of what I'm using:
https://gist.github.com/earonesty/a052ce176e99d5a659472d0dab6ea361
Seems OK for my use cases. There's probably issues with relying on __del__
this way. But it solves the Windows close/reopen problem, too
On 14 Nov 2019, at 15:15, R.Wieser wrote:
Too bad though, it means that procedures that want to share/use its
callers
variables using nonlocal can never be called from main. And that a
caller
of a procedure using nonlocal cannot have the variable declared as
global
(just tested it).
So
On 14 Nov 2019, at 14:06, R.Wieser wrote:
I've also tried moving "MyVar = 7" to the first line, but that doesn't
change anything. Using "global MyVar" works..
Try
def outer():
MyVar = 10
def Proc1():
nonlocal MyVar
MyVar = 5
Proc1()
Erik Ahlén added the comment:
So, not a bug since you can just do `default = Path('file.txt')`?
--
___
Python tracker
<https://bugs.python.org/issue38
New submission from Erik Ahlén :
The type of the object returned by get_default isn't converted to the specified
type supplied to add_argument. I would expect the type to be the same.
--
components: Library (Lib)
files: test.py
messages: 356194
nosy: Erik Ahlén
priority: normal
Erik Byström added the comment:
Yes, you're right. I do think the docs are a bit misleading.
Maybe something like this would make it more clear?
"If a class is used as a spec then the returned object will be a mock of that
class. When the constructor of the returned mock class is in
Erik Aronesty added the comment:
i would like to point out that the primary reason any of this nonsense exists
is because of short filename restrictions.
i've replaces nearly all of my temp file creation code in all of my project to
`return os.urandom(32).hex()` ... which is reliable
Erik Janssens added the comment:
fyi 1 : this issue pops up in multiple places, cfr :
* bpo-35890
* bpo-20596
the selection of the wcstok function is based on MS_WINDOWS being
defined, rather than eg. an autoconf check on which function is
available.
fyi 2 : I've been able to cross
class Status:
valid = 1
invalid = 2
unknown = 3
On Fri, Jul 26, 2019, 3:37 PM Chris Angelico wrote:
> On Sat, Jul 27, 2019 at 5:16 AM Erik Aronesty wrote:
> >
> > I just spend a while tracking down and killing all "if Enum" and "if not
> > En
I just spend a while tracking down and killing all "if Enum" and "if not
Enum" bugs in my code. I was frankly shocked that this didn't raise a
ValueError to begin with.
Apparently all enums are true/false depending on whether the underlying
value is truthy or falsy.
Which breaks the
Erik Aronesty added the comment:
Series of operations needed to answer the questions os.access is not answering
on windows:
bool CanAccessFolder( LPCTSTR folderName, DWORD genericAccessRights )
{
bool bRet = false;
DWORD length = 0;
if (!::GetFileSecurity( folderName
Erik Aronesty added the comment:
yes, duplicate of https://bugs.python.org/issue22107 ... tried looking first,
sry.
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/i
Change by Erik Aronesty :
--
type: -> crash
___
Python tracker
<https://bugs.python.org/issue37477>
___
___
Python-bugs-list mailing list
Unsubscrib
New submission from Erik Aronesty :
Depending on the user's permissions, this code can hang, instead of raising an
exception:
from tempfile import NamedTemporaryFile
NamedTemporaryFile(dir="/")
The problamatic code is in tempfile.py:
When encountering a "[Errno 13] Pe
Collaboration, 2018).
where (Astropy Collaboration, 2018) is a reference to
https://doi.org/10.3847/1538-3881/aabc4f
Special thanks to the coordinator for this release: Brigitta Sipocz.
We hope that you enjoy using Astropy as much as we enjoyed developing it!
Erik Tollerud, Tom Robitaille, Kelle
Erik Bray added the comment:
FWIW (unsurprisingly) the new test added here is broken on Cygwin, whose libc's
(newlib) behavior in this undefined case. So I get:
>>> from datetime import date
>>> t = date(2005, 1, 1)
>>> t.strftime("%Y") #
Change by Erik Bray :
--
pull_requests: +13877
pull_request: https://github.com/python/cpython/pull/14013
___
Python tracker
<https://bugs.python.org/issue28
Erik Bray added the comment:
I think this issue can probably be closed. It refers to a very old version of
Cygwin as well as old versions of Python. I don't have any problem building
the _curses or _io modules on recent versions of Cygwin (>=2.9) and with
current cpython master (3.9.
Erik Paulson added the comment:
I think my use case was Sharepoint and static site generators - Sharepoint can
serve a tree of .aspx files as raw HTML, but maddeningly not .html files. The
site generator we used spit out a fairly complicated site where the internal
links point
Erik Bray added the comment:
Thanks everyone. And FWIW I agree the original change is positive overall, if a
bit presumptuous about different linkers' behaviors :)
--
___
Python tracker
<https://bugs.python.org/issue21
Change by Erik Bray :
--
pull_requests: +13463
___
Python tracker
<https://bugs.python.org/issue21536>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Erik Bray :
--
pull_requests: +13461
___
Python tracker
<https://bugs.python.org/issue21536>
___
___
Python-bugs-list mailing list
Unsubscribe:
Erik Bray added the comment:
I vaguely recall seeing some discussion about this on python-dev or elsewhere
and wish I had chimed in sooner, as I didn't realize action was going to be
taken on this so soon.
This completely breaks building extension modules on Windows-based platforms
like
Change by Erik Janssens :
--
pull_requests: +13401
___
Python tracker
<https://bugs.python.org/issue36965>
___
___
Python-bugs-list mailing list
Unsubscribe:
1 - 100 of 1349 matches
Mail list logo