[issue41889] enum: Mixin and int base class regression in 3.8.6

2020-09-29 Thread puddly
New submission from puddly : The following code worked in 3.8.5 but does not in 3.8.6 due to the fix for #39587: ``` import enum class MyInt(int): def __new__(cls, value): return super().__new__(cls, value) class HexMixin: def __repr__(self): return hex(self) class

[issue12836] ctypes.cast() creates circular reference in original object

2020-09-29 Thread Eryk Sun
Change by Eryk Sun : -- stage: -> needs patch versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.3 ___ Python tracker ___

[issue41883] ctypes pointee goes out of scope, then pointer in struct dangles and crashes

2020-09-29 Thread Eryk Sun
Eryk Sun added the comment: > `data_as` method which has the desired behavior: "The returned > pointer will keep a reference to the array." I don't think it's the desired behavior at all. data_as() sets an _arr attribute of which ctypes isn't aware. It should cast the address to the given

[issue41888] Duplicate Opcode value in master and 3.9rc2

2020-09-29 Thread anthony shaw
Change by anthony shaw : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue41888] Duplicate Opcode value in master and 3.9rc2

2020-09-29 Thread anthony shaw
anthony shaw added the comment: No, this is intentional. sorry. closing https://github.com/python/cpython/blob/34cd3e9f6a87f9c50edac893b0d5ae46c4e48ee3/Doc/library/dis.rst#L1194 -- ___ Python tracker

[issue41888] Duplicate Opcode value in master and 3.9rc2

2020-09-29 Thread anthony shaw
anthony shaw added the comment: Or is this some sort of obscure month python reference!? -- ___ Python tracker ___ ___

[issue41888] Duplicate Opcode value in master and 3.9rc2

2020-09-29 Thread anthony shaw
New submission from anthony shaw : I noticed that HAVE_ARGUMENT and STORE_NAME have the same value (90) in Include/opcode.h in both the source code and in the 2bd31b5f revision (3.9.0rc2). This must be creating some weird bugs.

[issue41887] ast.literal_eval does not accept strings with leading whitespaces

2020-09-29 Thread Saiyang Gou
New submission from Saiyang Gou : `ast.literal_eval` does not accept code with leading whitespaces, while `eval` accepts them, which is an inconsistency. ``` >>> import ast >>> eval(' 1') 1 >>> ast.literal_eval(' 1') Traceback (most recent call last): File "", line 1, in File

[issue41870] Use PEP 590 vectorcall to speed up calls to bool()

2020-09-29 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: +21486 pull_request: https://github.com/python/cpython/pull/22460 ___ Python tracker ___

[issue36424] Pickle fails on frozen dataclass that has slots

2020-09-29 Thread Zackery Spytz
Change by Zackery Spytz : -- nosy: +ZackerySpytz nosy_count: 6.0 -> 7.0 pull_requests: +21485 pull_request: https://github.com/python/cpython/pull/22459 ___ Python tracker ___

[issue41870] Use PEP 590 vectorcall to speed up calls to bool()

2020-09-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > You can put ok<0 test in the if (nargs) branch, to avoid the test when > nargs=0. +1 -- nosy: +pablogsal ___ Python tracker ___

[issue35103] format_exception() doesn't work with PyErr_Fetch

2020-09-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > FWIW, I believe that you have to call `PyErr_NormalizeException` on the > values returned from `PyErr_Fetch`. It looks like this is working as expected. Indeed that is the case, from the docs: Under certain circumstances, the values returned by

[issue35103] format_exception() doesn't work with PyErr_Fetch

2020-09-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Closing as not a bug, feel free to reopen if we are missing something here :) -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue41826] test_peg_generator compilation warnings

2020-09-29 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +21484 pull_request: https://github.com/python/cpython/pull/22455 ___ Python tracker ___

[issue41886] PyType_Type is documented incorrectly

2020-09-29 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +21483 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22454 ___ Python tracker

[issue41886] PyType_Type is documented incorrectly

2020-09-29 Thread da-woods
New submission from da-woods : In the documentation PyType_Type is listed as a "PyObject*" (https://docs.python.org/3/c-api/type.html#c.PyType_Type). This is misleading because it is both not a pointer and is a PyTypeObject. Other type objects are documented as "PyTypeObject" (see unicode

[issue41519] `pkgutil.get_data` causes future imports of children modules to fail.

2020-09-29 Thread Cory Nezin
Cory Nezin added the comment: Wow, I did not know about that (probably because I've been stuck with Python3.6 for a while). Thank you! -- ___ Python tracker ___

[issue41183] [3.5] Workaround or fix for SSL ".._KEY_TOO_SMALL" test failures

2020-09-29 Thread Larry Hastings
Larry Hastings added the comment: A day and a half to go! Again, assuming that this won't be fixed and 3.5 will go EOL without supporting this year's Linux distro updates. -- ___ Python tracker

[issue41871] Add PyList_Remove() in listobject.c

2020-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PyList_SetSlice() allows to remove an item by index, as in `del a[i]`. list.remove() searches the item by value and removes the first occurrence. You can implement it via PySequence_Index() and PyList_SetSlice(), but it is more convenient to just call the

[issue41519] `pkgutil.get_data` causes future imports of children modules to fail.

2020-09-29 Thread Brett Cannon
Brett Cannon added the comment: I wouldn't use pkgutil.get_data() -- or pkgutil, period -- and instead use importlib.resources to read data files from a package (which is available as a third-party package on PyPI if you need it for older versions of Python). --

[issue41356] Convert bool.__new__ to argument clinic

2020-09-29 Thread Dennis Sweeney
Dennis Sweeney added the comment: Superseded by https://bugs.python.org/issue41870 -- nosy: -larry resolution: -> works for me stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue35103] format_exception() doesn't work with PyErr_Fetch

2020-09-29 Thread Jason Haslam
Jason Haslam added the comment: FWIW, I believe that you have to call `PyErr_NormalizeException` on the values returned from `PyErr_Fetch`. It looks like this is working as expected. -- nosy: +jason.haslam ___ Python tracker

[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-09-29 Thread Thomas Holder
Thomas Holder added the comment: All good, thanks for opening PR 22453! I'll close my old PR. -- ___ Python tracker ___ ___

[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-09-29 Thread E. Paine
Change by E. Paine : -- pull_requests: +21482 pull_request: https://github.com/python/cpython/pull/22453 ___ Python tracker ___ ___

[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-09-29 Thread E. Paine
E. Paine added the comment: I do think we should close the existing PR (TBH, I completely forgot about this issue). Briefly looking again at the issue, it does indeed look like the GIL hasn't seen the thread before the attempted call to restore the tstate (as Steve said). If its alright

[issue41883] ctypes pointee goes out of scope, then pointer in struct dangles and crashes

2020-09-29 Thread Ian M. Hoffman
Ian M. Hoffman added the comment: You are correct. After further review, I found an older ctypes issue #12836 which was then enshrined in a workaround in the numpy.ndarray.ctypes interface to vanilla ctypes. https://numpy.org/doc/stable/reference/generated/numpy.ndarray.ctypes.html Numpy

[issue41774] While removing element from list using for and remove(), which has same items output is not right

2020-09-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: > If space is not an issue, the list comprehension may be fastest. I think there is still a misunderstanding here. The generator variant does not save space. It uses slightly *more* space than the list variant. The list_ass_slice()ยน function runs

[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-09-29 Thread Thomas Holder
Thomas Holder added the comment: I finally managed to test tstate_acquire.diff and it works perfectly! Should I close my pull request? Or update it with your patch? -- ___ Python tracker

[issue31391] Forward-port test_xpickle from 2.7 to 3.x

2020-09-29 Thread Ken Jin
Change by Ken Jin : -- keywords: +patch nosy: +kj nosy_count: 2.0 -> 3.0 pull_requests: +21481 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22452 ___ Python tracker

[issue41885] Unexpected behavior re.sub() with raw f-strings

2020-09-29 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue41885] Unexpected behavior re.sub() with raw f-strings

2020-09-29 Thread Matthew Barnett
Matthew Barnett added the comment: Arguments are evaluated first and then the results are passed to the function. That's true throughout the language. In this instance, you can use \g<1> in the replacement string to refer to group 1: re.sub(r'([a-z]+)', fr"\g<1>{REPLACEMENT}", 'something')

[issue41885] Unexpected behavior re.sub() with raw f-strings

2020-09-29 Thread Eric V. Smith
Eric V. Smith added the comment: f-strings are indeed evaluated when the value of the string is needed. Your example is equivalent to: >>> re.sub(r'([a-z]+)', fr"\112345", 'something') 'J345' As always with regexes, you need to be careful when dynamically composing them. -- nosy:

[issue41885] Unexpected behavior re.sub() with raw f-strings

2020-09-29 Thread dkreeft
New submission from dkreeft : Steps to reproduce (Windows/Python 3.7.7): 1. Define replacement string that starts with an integer: REPLACEMENT = '12345' 2. Use re.sub() as follows: re.sub(r'([a-z]+)', fr"\1{REPLACEMENT}", 'something') 3. The outcome is not 'something12345' as expected, but

[issue41519] `pkgutil.get_data` causes future imports of children modules to fail.

2020-09-29 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +barry, brett.cannon, p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue41884] tempfile.py TemporaryDirectory/mkdtemp defaults to mode 0o700, propose to add mode argument

2020-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You can change permissions after creating the directory. The C function mkdtemp() creates the directory with permissions 0o700. -- nosy: +serhiy.storchaka ___ Python tracker

[issue41884] tempfile.py TemporaryDirectory/mkdtemp defaults to mode 0o700, propose to add mode argument

2020-09-29 Thread Raymond Sit
New submission from Raymond Sit : `tempfile.TemporaryDirectory` always creates the directory with 0o700 permissions. So other applications which could run as a different user (i.e. root) cannot access the directory. To improve the usability I would like to add the option to set the

[issue36125] Cannot cross-compile to more featureful but same tune

2020-09-29 Thread pmp-p
Change by pmp-p : -- nosy: +pmpp ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26053] regression in pdb output between 2.7 and 3.5

2020-09-29 Thread Irit Katriel
Irit Katriel added the comment: As you see in the PR, this regression was in the commit I linked to which was made by Georg, but he has removed himself from the nosy list of this issue and was unavailable to review the PR when I asked him to. Can someone else review this? It's a 1-line fix

[issue41878] python3 fails to use custom mapping object as symbols in eval()

2020-09-29 Thread Robert Haschke
Robert Haschke added the comment: Thanks, Josh, for this clarification. What is the suggested mitigation? Obviously, I need to pass all symbols from my hierarchical dictionary in a flattend version as a dict to globals. Or do you see another option? --

[issue11414] Add import fix for email.Message

2020-09-29 Thread Irit Katriel
Irit Katriel added the comment: I've added a PR with this fixer, which is quite a simple addition because the mechanism for such renames is already there. If we don't want to add features to lib2to3 (since I understand it will be deprecated in the future), then shall we instead close this

[issue41878] python3 fails to use custom mapping object as symbols in eval()

2020-09-29 Thread Josh Rosenberg
Josh Rosenberg added the comment: Yes, list comprehensions having their own local scope was a change from Py2 to Py3. Python 2 did not do this for list comps initially, and it was left that way during the 2.x timeframe due to back compat constraints, but 2.x did it from the start for

[issue38989] pip install selects 32 bit wheels for 64 bit python if vcvarsall.bat amd64_x86 in environment

2020-09-29 Thread Vinay Sajip
Vinay Sajip added the comment: FYI I'm in the process of updating distlib to add the get_platform() / get_host_platform() distinction. The next release should have it. -- keywords: +3.5regression ___ Python tracker

[issue41876] Add __repr__ for Tkinter Font objects

2020-09-29 Thread Anatoliy Platonov
Change by Anatoliy Platonov : -- keywords: +patch nosy: +p4m.dev nosy_count: 3.0 -> 4.0 pull_requests: +21479 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22450 ___ Python tracker

[issue41876] Add __repr__ for Tkinter Font objects

2020-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a new feature. We do not backport new features to old versions unless they fix some design bug. Nothing bad will happen if we DO NOT backport it. -- ___ Python tracker

[issue41876] Add __repr__ for Tkinter Font objects

2020-09-29 Thread E. Paine
E. Paine added the comment: Serhiy, while I agree this is an enhancement, I don't see that it would break *anyone's* code (this will mostly just affect the REPL output) so is it worth considering a backport? Diohabara, the Python devguide (https://devguide.python.org/) is a very good place

[issue41670] ceval traces code differently with USE_COMPUTED_GOTOS

2020-09-29 Thread Mark Shannon
Mark Shannon added the comment: New changeset 17b5be0c0a3f74141014e06a660f1b5ddb002fec by Mark Shannon in branch 'master': bpo-41670: Remove outdated predict macro invocation. (GH-22026) https://github.com/python/cpython/commit/17b5be0c0a3f74141014e06a660f1b5ddb002fec --

[issue41295] CPython 3.8.4 regression on __setattr__ in multiinheritance with metaclasses

2020-09-29 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue41876] Add __repr__ for Tkinter Font objects

2020-09-29 Thread diohabara
diohabara added the comment: Hi, Storchaka!. I would like to tackle this issue. Because I am new to Python bug tracking, I am unsure that this is the right approach to bug fixing. -- nosy: +diohabara ___ Python tracker