From report at bugs.python.org Thu Apr 1 00:11:41 2021 From: report at bugs.python.org (=?utf-8?q?Jo=C3=ABl_Larose?=) Date: Thu, 01 Apr 2021 04:11:41 +0000 Subject: [issue43685] __call__ not being called on metaclass In-Reply-To: <1617244628.3.0.903633823298.issue43685@roundup.psfhosted.org> Message-ID: <1617250301.56.0.383443115564.issue43685@roundup.psfhosted.org> Jo?l Larose added the comment: OMG! Ok, thanks guys! Switching to super().__new__ made all the difference! I can't believe I didn't think to try to change this line. Regarding the call to cast, I know it's only for type checking. Trying to write code that works checks with mypy. I probably have other issues in my code, but not getting __call__ called was the show-stopper. I thought type(name, bases, namespace) did the same thing as super().__new__(...). Clearly, I was wrong. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 00:12:25 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 01 Apr 2021 04:12:25 +0000 Subject: [issue43686] re.match appears to hang with certain combinations of pattern and string In-Reply-To: <1617246696.22.0.947636964181.issue43686@roundup.psfhosted.org> Message-ID: <1617250345.75.0.672043998387.issue43686@roundup.psfhosted.org> Dennis Sweeney added the comment: It's well-known that regular expressions can take exponential time. You can try searching this bug tracker for "re exponential". Common suggestions are to try a third-party module, or to write better regexes where possible. Note that the important bits of the re module are already implemented in C: https://github.com/python/cpython/blob/master/Modules/_sre.c ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 01:05:25 2021 From: report at bugs.python.org (Jiaxin Peng) Date: Thu, 01 Apr 2021 05:05:25 +0000 Subject: [issue43567] regen.vcxproj cannot regenerate some necessary files In-Reply-To: <1616238138.44.0.687655765468.issue43567@roundup.psfhosted.org> Message-ID: <1617253525.67.0.222375498143.issue43567@roundup.psfhosted.org> Jiaxin Peng added the comment: Steve's PR zooba:bpo-43567 works as expected. Really clean implementation! Thanks! ---------- resolution: -> works for me _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 02:19:04 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 01 Apr 2021 06:19:04 +0000 Subject: [issue43670] Typo in 3.10 changelog In-Reply-To: <1617109844.58.0.922515260201.issue43670@roundup.psfhosted.org> Message-ID: <1617257944.84.0.525530407097.issue43670@roundup.psfhosted.org> Inada Naoki added the comment: Thank you for reporting. This typo is fixed in GH-43574. ---------- nosy: +methane resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 02:47:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 06:47:31 +0000 Subject: [issue43688] [C API] Fix Py_INCREF and Py_DECREF in the limited C API for Python built in debug mode Message-ID: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> New submission from STINNER Victor : Currently, setup.py doesn't build xxlimited and xxlimited_35 extension modules with the limited C API if Python is built in debug mode. I only found two functions affected by Py_DEBUG macro in the limited C API: Py_INCREF() and Py_DECREF(). Example: --- #if defined(Py_DEBUG) && !defined(Py_REF_DEBUG) #define Py_REF_DEBUG #endif static inline void _Py_INCREF(PyObject *op) { #ifdef Py_REF_DEBUG _Py_RefTotal++; #endif op->ob_refcnt++; } #define Py_INCREF(op) _Py_INCREF(_PyObject_CAST(op)) --- If Py_DEBUG is defined (Python built in debug mode), Py_INCREF() increments the private _Py_RefTotal variable. The limited C API is supposed to provide a stable ABI, but Py_INCREF() leaks _Py_RefTotal implementation if Python is built in debug mode. I propose to modify Py_INCREF() and Py_DECREF() of the limited C API to always declare them as opaque function calls. The regular (non limited) C API will continue to use the same static inline functions. See also https://github.com/python/cpython/pull/25115 and bpo-41111 "[C API] Convert a few stdlib extensions to the limited C API (PEP 384)". Note: Py_XINCREF() and Py_XDECREF() should be fine. ---------- components: C API messages: 389956 nosy: vstinner priority: normal severity: normal status: open title: [C API] Fix Py_INCREF and Py_DECREF in the limited C API for Python built in debug mode versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 02:54:17 2021 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 01 Apr 2021 06:54:17 +0000 Subject: [issue32408] Performance regression in urllib.proxy_bypass_environment In-Reply-To: <1513923244.99.0.213398074469.issue32408@psf.upfronthosting.co.za> Message-ID: <1617260057.29.0.188585287159.issue32408@roundup.psfhosted.org> Xiang Zhang added the comment: I think this issue has already been solved by #39507. The time difference is: before: time python3 -c 'import urllib.request; urllib.request.proxy_bypass_environment("1.1.1.1")' real 0m0.912s user 0m0.902s sys 0m0.010s after: time python3 -c 'import urllib.request; urllib.request.proxy_bypass_environment("1.1.1.1")' real 0m0.105s user 0m0.086s sys 0m0.019s ---------- nosy: +serhiy.storchaka resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 02:56:13 2021 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 01 Apr 2021 06:56:13 +0000 Subject: [issue32408] Performance regression in urllib.proxy_bypass_environment In-Reply-To: <1513923244.99.0.213398074469.issue32408@psf.upfronthosting.co.za> Message-ID: <1617260173.23.0.0822278807216.issue32408@roundup.psfhosted.org> Xiang Zhang added the comment: Sorry, it's #39057 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 03:25:47 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 07:25:47 +0000 Subject: [issue43688] [C API] Support the limited C API in debug build (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617261947.83.0.610489071172.issue43688@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: [C API] Fix Py_INCREF and Py_DECREF in the limited C API for Python built in debug mode -> [C API] Support the limited C API in debug build (Py_INCREF and Py_DECREF) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 03:41:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 07:41:40 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617262900.96.0.634411710152.issue43688@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: [C API] Support the limited C API in debug build (Py_INCREF and Py_DECREF) -> [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 03:42:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 07:42:07 +0000 Subject: [issue36465] Make release and debug ABI compatible In-Reply-To: <1553814102.98.0.064217796616.issue36465@roundup.psfhosted.org> Message-ID: <1617262927.78.0.324134512294.issue36465@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +23878 pull_request: https://github.com/python/cpython/pull/25131 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 03:42:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 07:42:07 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617262927.71.0.416843531639.issue43688@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +23877 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25131 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 03:56:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 07:56:33 +0000 Subject: [issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384) In-Reply-To: <1593075260.88.0.835474638855.issue41111@roundup.psfhosted.org> Message-ID: <1617263793.91.0.876764289072.issue41111@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-43688: [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 03:56:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 07:56:42 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617263802.57.0.296632226196.issue43688@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 04:05:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 08:05:16 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617264316.01.0.585863098349.issue43688@roundup.psfhosted.org> STINNER Victor added the comment: One nice advantage of this change is that it becomes possible to check for reference leaks in C extensions written with the limited C API! $ ./python -m test test_xxlimited -R 3:3 0:00:00 load avg: 2.99 Run tests sequentially 0:00:00 load avg: 2.99 [1/1] test_xxlimited beginning 6 repetitions 123456 ...... == Tests result: SUCCESS == 1 test OK. Total duration: 367 ms Tests result: SUCCESS ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 04:09:11 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=BCrgen_Gmach?=) Date: Thu, 01 Apr 2021 08:09:11 +0000 Subject: [issue43689] difflib: mention other "problematic" characters in documentation Message-ID: <1617264551.39.0.962049035907.issue43689@roundup.psfhosted.org> New submission from J?rgen Gmach : In the documentation you can currently read for the "?"-output: "These lines can be confusing if the sequences contain tab characters." >From first hand experience :-), I can assure it is also very confusing for other types of whitespace characters, such as spaces and line breaks. I'd like to add the other characters to the documentation. ---------- assignee: docs at python components: Documentation messages: 389961 nosy: docs at python, jugmac00 priority: normal pull_requests: 23879 severity: normal status: open title: difflib: mention other "problematic" characters in documentation versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 04:10:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 08:10:28 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617264628.67.0.0439385322933.issue43688@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +23880 pull_request: https://github.com/python/cpython/pull/25133 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 04:26:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 08:26:29 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617265589.47.0.429372564507.issue43688@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +23881 pull_request: https://github.com/python/cpython/pull/25134 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 05:20:50 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 01 Apr 2021 09:20:50 +0000 Subject: [issue43689] difflib: mention other "problematic" characters in documentation In-Reply-To: <1617264551.39.0.962049035907.issue43689@roundup.psfhosted.org> Message-ID: <1617268850.07.0.204983279591.issue43689@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 05:30:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 09:30:06 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617269406.01.0.0881787954617.issue43688@roundup.psfhosted.org> STINNER Victor added the comment: New changeset baf10da75072d1f8ec714d3c2c8550d34db343a9 by Victor Stinner in branch 'master': bpo-43688: Run make regen-limited-abi (GH-25134) https://github.com/python/cpython/commit/baf10da75072d1f8ec714d3c2c8550d34db343a9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 05:33:13 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Apr 2021 09:33:13 +0000 Subject: [issue43682] Make static methods created by @staticmethod callable In-Reply-To: <1617201081.91.0.895015962683.issue43682@roundup.psfhosted.org> Message-ID: <1617269593.69.0.11569585297.issue43682@roundup.psfhosted.org> Serhiy Storchaka added the comment: If make staticmethod a calllable and always wrap open, we need to change also its repr and add the __doc__ attribute (and perhaps other attributes to make it more interchangeable with the original function). Alternate option: make staticmethod(func) returning func if it is not a descriptor. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 05:37:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 09:37:33 +0000 Subject: [issue43690] [C API] stable_abi.py script must not include PyType_HasFeature() static inline function in the stable ABI Message-ID: <1617269853.61.0.950135288092.issue43690@roundup.psfhosted.org> New submission from STINNER Victor : I just ran "make regen-limited-abi" and it added PyType_HasFeature(): commit baf10da75072d1f8ec714d3c2c8550d34db343a9 Author: Victor Stinner Date: Thu Apr 1 11:29:46 2021 +0200 bpo-43688: Run make regen-limited-abi (GH-25134) diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat index 3adee103bc..ed20521b7f 100644 --- a/Doc/data/stable_abi.dat +++ b/Doc/data/stable_abi.dat @@ -192,6 +192,7 @@ PyExc_ConnectionRefusedError PyExc_ConnectionResetError PyExc_DeprecationWarning PyExc_EOFError +PyExc_EncodingWarning PyExc_EnvironmentError PyExc_Exception PyExc_FileExistsError @@ -615,6 +616,7 @@ PyType_GetFlags PyType_GetModule PyType_GetModuleState PyType_GetSlot +PyType_HasFeature PyType_IsSubtype PyType_Modified PyType_Ready The problem is that PyType_HasFeature() is currently implemented as a static inline function in the limited C API for best performance. Issue about PyType_HasFeature() performance in CPython itself: https://bugs.python.org/issue39542#msg372962 Currently, PyType_HasFeature() is declared in Include/object.h as: static inline int PyType_HasFeature(PyTypeObject *type, unsigned long feature) { unsigned long flags; #ifdef Py_LIMITED_API // PyTypeObject is opaque in the limited C API flags = PyType_GetFlags(type); #else flags = type->tp_flags; #endif return ((flags & feature) != 0); } IMO static inline functions must not be listed in the stable *ABI*. At the ABI level, libpython doesn't export "PyType_HasFeature" symbol: $ objdump -T /lib64/libpython3.10.so.1.0|grep '\' 00000000000fedf0 g DF .text 00000000000000d0 Base PyObject_CallFunction $ objdump -T /lib64/libpython3.10.so.1.0|grep '\' # nothing "PyObject_CallFunction" symbol is exported, but not "PyType_HasFeature". -- Maybe for the stable ABI, it would be a good idea to export PyType_HasFeature() as an opaque function. But that's out of the scope of this issue which is about the stable_abi.py script ;-) ---------- components: C API messages: 389964 nosy: pablogsal, petr.viktorin, vstinner priority: normal severity: normal status: open title: [C API] stable_abi.py script must not include PyType_HasFeature() static inline function in the stable ABI versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 05:42:56 2021 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Thu, 01 Apr 2021 09:42:56 +0000 Subject: [issue43691] Comparison of OrderedDict() and dict() Message-ID: <1617270176.28.0.957679341953.issue43691@roundup.psfhosted.org> New submission from ???? ????????? : OrderedDict([(1,2), (3,4)]) == OrderedDict([(3,4), (1,2)]) Out[1]: False # OK dict([(1,2), (3,4)]) == dict([(3,4), (1,2)]) Out[2]: True # OK dict([(1,2), (3,4)]) == OrderedDict([(3,4), (1,2)]) Out[3]: True # NOT OK, since actual order is different OrderedDict([(1,2), (3,4)]) == dict([(3,4), (1,2)]) Out[4]: True # NOT OK, since actual orderd is different I propose two options to fix it: 1. Return True when comparing anything with OrderedDict iff order is the same. 2. Raise TypeError when someone tries to compare OrderedDict() and dict(). # I think it's better. ---------- components: Library (Lib) messages: 389965 nosy: socketpair priority: normal severity: normal status: open title: Comparison of OrderedDict() and dict() type: behavior versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 05:42:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 09:42:59 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617270179.66.0.434944525827.issue43688@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +23882 pull_request: https://github.com/python/cpython/pull/25135 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 05:44:24 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 01 Apr 2021 09:44:24 +0000 Subject: [issue43684] Add combined opcodes In-Reply-To: <1617230432.54.0.49540913796.issue43684@roundup.psfhosted.org> Message-ID: <1617270264.93.0.834096013439.issue43684@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 05:52:42 2021 From: report at bugs.python.org (Michael Felt) Date: Thu, 01 Apr 2021 09:52:42 +0000 Subject: [issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child In-Reply-To: <1585329415.65.0.534969367772.issue40092@roundup.psfhosted.org> Message-ID: <1617270762.29.0.778947665818.issue40092@roundup.psfhosted.org> Michael Felt added the comment: Adding 3.10. While a (sort of) duplicate I also would like to add that before revision "7cb033c423b65def1632d6c3c747111543b342a2" this was not showing up as an issue with test_importlib. my issue was with test_importlib suddenly going into error. As this seem to be a long-standing issue is it perhaps a possibility to change the test so that the bot can go green again? ---------- nosy: +Michael.Felt versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 05:53:05 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Apr 2021 09:53:05 +0000 Subject: [issue43684] Add combined opcodes In-Reply-To: <1617230432.54.0.49540913796.issue43684@roundup.psfhosted.org> Message-ID: <1617270785.78.0.33974346317.issue43684@roundup.psfhosted.org> Serhiy Storchaka added the comment: We usually rejected such propositions unless there were evidences of significant effect on performance. I myself withdrawn several my patches after analyzing statistics. What percent of opcodes will be ADD_INT in the compiled bytecode? What percent of executed opcodes will be ADD_INT? Compare it with other opcodes, in particularly BINARY_ADD. What are microbenchmark results? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 05:59:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 09:59:09 +0000 Subject: [issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child In-Reply-To: <1585329415.65.0.534969367772.issue40092@roundup.psfhosted.org> Message-ID: <1617271149.95.0.791556718081.issue40092@roundup.psfhosted.org> STINNER Victor added the comment: > As this seem to be a long-standing issue is it perhaps a possibility to change the test so that the bot can go green again? This issue is a real crash and it seems quite easy to get it. I prefer to not hide the bug in the test suite. The bug must be fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 05:59:19 2021 From: report at bugs.python.org (Michael Felt) Date: Thu, 01 Apr 2021 09:59:19 +0000 Subject: [issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child In-Reply-To: <1585329415.65.0.534969367772.issue40092@roundup.psfhosted.org> Message-ID: <1617271159.96.0.448458221003.issue40092@roundup.psfhosted.org> Michael Felt added the comment: OK: further. Two options are suggested: There are different options to solve this issue: * Reset _tstate_lock before using it... not sure that it's worth it, since we are going to delete the threading.Thread object with its _tstate_lock object anymore. After calling fork, the child process has exactly 1 thread: all other threads have been removed. * Modify release_sentinel() to not use the lock: avoid PyThread_release_lock() call. ** as to option 1 - it is 'worth it' if it stops the crashes ** This is deeper than I usually go in Python code - but I'll make an effort - help is appreciated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 06:28:05 2021 From: report at bugs.python.org (Carsten Docktor) Date: Thu, 01 Apr 2021 10:28:05 +0000 Subject: [issue43692] Raise SyntaxError on implicit string concatentation in list Message-ID: <1617272885.12.0.631985643929.issue43692@roundup.psfhosted.org> New submission from Carsten Docktor : I recently found several bugs, which came from the "feature" shown below. Is python supposed to use string concatenation in a list environment like this? Why would this be appreciated? ## Expected Behavior The example below should raise a SyntaxErorr for a missing comma. String concatenation in a list should require brackets. ## Current Behavior Missing commas in a string list lead to unnoticed concatenated strings. ## Steps to Reproduce ```python my_list = [ "a", "b" "c", "d" ] interpreted_list = [ "a", "bc", "d", ] assert my_list == interpreted_list # unwanted behavior ``` ---------- components: Interpreter Core messages: 389970 nosy: carsten.docktor priority: normal severity: normal status: open title: Raise SyntaxError on implicit string concatentation in list type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 06:38:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 10:38:38 +0000 Subject: [issue43690] [C API] stable_abi.py script must not include PyType_HasFeature() static inline function in the stable ABI In-Reply-To: <1617269853.61.0.950135288092.issue43690@roundup.psfhosted.org> Message-ID: <1617273518.96.0.966728018529.issue43690@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +23883 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25136 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 07:17:05 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 01 Apr 2021 11:17:05 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617275825.78.0.889068304372.issue43688@roundup.psfhosted.org> Petr Viktorin added the comment: If you do this, please check the performance impact. Py_INCREF/Py_DECREF are very common. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 07:20:55 2021 From: report at bugs.python.org (Michael Felt) Date: Thu, 01 Apr 2021 11:20:55 +0000 Subject: [issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child In-Reply-To: <1585329415.65.0.534969367772.issue40092@roundup.psfhosted.org> Message-ID: <1617276055.75.0.355224022347.issue40092@roundup.psfhosted.org> Michael Felt added the comment: OK. Please explain. Looking at tstate assignment In posixmodule.c:PyOSAfterFork_Child() PyStatus status; _PyRuntimeState *runtime = &_PyRuntime; ... PyThreadState *tstate = _PyThreadState_GET(); and later calls status = _PyRuntimeState_ReInitThreads(runtime); Yet in Posix/ceval.c PyStatus _PyEval_ReInitThreads(PyThreadState *tstate) { _PyRuntimeState *runtime = tstate->interp->runtime; ** this looks like runtime->interp->runtime And then we get down to: /* Destroy all threads except the current one */ _PyThreadState_DeleteExcept(runtime, tstate); Is this correct - as it looks like: _PyThreadState_DeleteExcept(runtime->interp->runtime, runtime) -- where runtime == &_PyRuntime; ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 07:27:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 01 Apr 2021 11:27:17 +0000 Subject: [issue43024] improve signature (in help, etc) for functions taking sentinel defaults In-Reply-To: <1611587640.53.0.195201731083.issue43024@roundup.psfhosted.org> Message-ID: <1617276437.59.0.36023850939.issue43024@roundup.psfhosted.org> Irit Katriel added the comment: Marking as a 3.10 regression because the sentinel was added in 3.10. ---------- keywords: +3.10regression _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 07:27:57 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 01 Apr 2021 11:27:57 +0000 Subject: [issue43683] Handle generator (and coroutine) state in the bytecode. In-Reply-To: <1617209103.34.0.926095267338.issue43683@roundup.psfhosted.org> Message-ID: <1617276477.04.0.408361230714.issue43683@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +23884 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25137 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 07:33:52 2021 From: report at bugs.python.org (A_D) Date: Thu, 01 Apr 2021 11:33:52 +0000 Subject: [issue43694] Tkinter scaling does not work on some linux systems Message-ID: <1617276832.36.0.11586467537.issue43694@roundup.psfhosted.org> New submission from A_D : When using scaling (as in root.tk.call('scaling', somenum)), some linux systems appear to simply disregard the change. I recently reinstalled from Ubuntu to OpenSUSE Tumbleweed and found that scaling straight up did not work in the application I tried or the test application -- https://github.com/Athanasius/tk-scaling. (image attached) Tested on python 3.8.8 and 3.9.2 (pyenv) ---------- components: Tkinter files: Screenshot_20210401_132045.png messages: 389975 nosy: aunderscored priority: normal severity: normal status: open title: Tkinter scaling does not work on some linux systems type: behavior versions: Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file49924/Screenshot_20210401_132045.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 07:33:50 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 01 Apr 2021 11:33:50 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory Message-ID: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> New submission from Mark Shannon : In the interpreter and compiler, the "fast" locals array and cells array are treated separately. By merging them in the compiler, the interpreter can be simplified a bit. ---------- assignee: Mark.Shannon components: Interpreter Core messages: 389974 nosy: Mark.Shannon priority: normal severity: normal stage: needs patch status: open title: Logically merge cell and locals array. They are already contiguous in memory type: performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 08:14:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 12:14:08 +0000 Subject: [issue43690] [C API] stable_abi.py script must not include PyType_HasFeature() static inline function in the stable ABI In-Reply-To: <1617269853.61.0.950135288092.issue43690@roundup.psfhosted.org> Message-ID: <1617279248.74.0.808749534888.issue43690@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 61092a99c4840f36dbde8457cb566fc3c012930f by Victor Stinner in branch 'master': bpo-43690: stable_abi.py no longer parses macros (GH-25136) https://github.com/python/cpython/commit/61092a99c4840f36dbde8457cb566fc3c012930f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 08:16:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 12:16:45 +0000 Subject: [issue43690] [C API] stable_abi.py script must not include PyType_HasFeature() static inline function in the stable ABI In-Reply-To: <1617269853.61.0.950135288092.issue43690@roundup.psfhosted.org> Message-ID: <1617279405.68.0.527591175704.issue43690@roundup.psfhosted.org> STINNER Victor added the comment: Pablo: My previous commit added PyType_HasFeature to Doc/data/stable_abi.dat. But it prevented me to fix another bug, PR 25135. So I merged this change (PR 25136) to unblock the CI. Feel free to revert/adjust my change as soon as it doesn't add PyType_HasFeature back into Doc/data/stable_abi.dat :-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 08:20:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 12:20:27 +0000 Subject: [issue43690] [C API] stable_abi.py script must not include PyType_HasFeature() static inline function in the stable ABI In-Reply-To: <1617269853.61.0.950135288092.issue43690@roundup.psfhosted.org> Message-ID: <1617279627.63.0.764863201179.issue43690@roundup.psfhosted.org> STINNER Victor added the comment: Oh, I forgot the mention "Tests / Check if generated files are up to date" job error message: LD_LIBRARY_PATH=/home/runner/work/cpython/cpython:/opt/hostedtoolcache/Python/3.9.2/x64/lib ./python ./Tools/scripts/stable_abi.py check ./Doc/data/stable_abi.dat Some symbols from the limited API are missing: PyType_HasFeature This error means that there are some missing symbols among the ones exported in the Python library ("libpythonx.x.a" or "libpythonx.x.so"). This normally means that some symbol, function implementation or a prototype, belonging to a symbol in the limited API has been deleted or is missing. Check if this was a mistake and if not, update the file containing the limited API symbols. This file is located at: ./Doc/data/stable_abi.dat You can read more about the limited API and its contracts at: https://docs.python.org/3/c-api/stable.html And in PEP 384: https://www.python.org/dev/peps/pep-0384/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 08:25:56 2021 From: report at bugs.python.org (wyz23x2) Date: Thu, 01 Apr 2021 12:25:56 +0000 Subject: [issue43695] Improve `=` in f-strings Message-ID: <1617279956.14.0.806481637406.issue43695@roundup.psfhosted.org> New submission from wyz23x2 : In Python 3.8, `=` was added into f-strings: >>> a, b, c = 20, 40, 10 >>> f'{a+b-c=}' a+b-c=50 But if `20+40-10` is wanted, this needs to be written: >>> f'{a}+{b}-{c}={a+b-c}' 20+40-10=50 So something could be added. For example, `?` (this doesn't mean I recommend the question mark): >>> f'{a?+b?-c?=}' 20+40-10=50 >>> f'{a+b?-c=}' a+40-c=50 >>> f'{a+b-c=?}' # Suffix `=` to apply to all? 20+40-10 Suggestions? ---------- components: Interpreter Core messages: 389979 nosy: wyz23x2 priority: normal severity: normal status: open title: Improve `=` in f-strings type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 08:28:04 2021 From: report at bugs.python.org (wyz23x2) Date: Thu, 01 Apr 2021 12:28:04 +0000 Subject: [issue43695] Improve `=` in f-strings In-Reply-To: <1617279956.14.0.806481637406.issue43695@roundup.psfhosted.org> Message-ID: <1617280084.17.0.171053365582.issue43695@roundup.psfhosted.org> wyz23x2 added the comment: Well, it's: >>> f'{a+b-c=?}' # Suffix `=` to apply to all? 20+40-10=50 P.S. When will the bug tracker enable message editing? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 09:04:02 2021 From: report at bugs.python.org (=?utf-8?b?0KDQvtC80LDQvSDQmtC+0L/RgtC10LI=?=) Date: Thu, 01 Apr 2021 13:04:02 +0000 Subject: [issue43696] High cpu usage using asyncio streams Message-ID: <1617282242.21.0.755675645798.issue43696@roundup.psfhosted.org> New submission from ????? ?????? : Hi. I have a high cpu usage using asyncio streams/sockets with connection pool (I tried on cpython 3.8-3.9 on mac and debian). Seems some noop handler is continously called polling ports in selectors. Here is a simple example to reproduce https://github.com/romikforest/asyncio_streams_high_cpu_usage2 Thank you a lot if you can take a look. ---------- components: asyncio messages: 389981 nosy: asvetlov, romikforest, yselivanov priority: normal severity: normal status: open title: High cpu usage using asyncio streams type: performance versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 09:09:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 13:09:49 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617282589.93.0.789136389799.issue43688@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 2ac0515027699b5694d9a6ff40f1ddaba82c74c2 by Victor Stinner in branch 'master': bpo-43688: Fix Py_LIMITED_API version of xxlimited (GH-25135) https://github.com/python/cpython/commit/2ac0515027699b5694d9a6ff40f1ddaba82c74c2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 09:11:40 2021 From: report at bugs.python.org (Socob) Date: Thu, 01 Apr 2021 13:11:40 +0000 Subject: [issue23979] Multiprocessing Pool.map pickles arguments passed to workers In-Reply-To: <1429226049.08.0.139422751174.issue23979@psf.upfronthosting.co.za> Message-ID: <1617282700.17.0.614591918073.issue23979@roundup.psfhosted.org> Change by Socob <206a8535 at opayq.com>: ---------- nosy: +Socob _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 09:47:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 13:47:06 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617284826.79.0.758707540075.issue43688@roundup.psfhosted.org> STINNER Victor added the comment: > New changeset baf10da75072d1f8ec714d3c2c8550d34db343a9 by Victor Stinner in branch 'master': > bpo-43688: Run make regen-limited-abi (GH-25134) With this change, "Tests / Check if generated files are up to date" job started fails (on PR 25135): "Some symbols from the limited API are missing: PyType_HasFeature". I fixed this issue in bpo-43690 which removes PyType_HasFeature from Doc/data/stable_abi.dat. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 09:59:41 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 01 Apr 2021 13:59:41 +0000 Subject: [issue43695] Improve `=` in f-strings In-Reply-To: <1617279956.14.0.806481637406.issue43695@roundup.psfhosted.org> Message-ID: <1617285581.18.0.937209034793.issue43695@roundup.psfhosted.org> Eric V. Smith added the comment: I don't see how this would be possible in general. What would you do with a function call that has side effects? f'{a()+b+c=}' ? You'd end up calling a() twice, or inventing your own expression evaluator. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 10:07:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Apr 2021 14:07:30 +0000 Subject: [issue43694] Tkinter scaling does not work on some linux systems In-Reply-To: <1617276832.36.0.11586467537.issue43694@roundup.psfhosted.org> Message-ID: <1617286050.36.0.158338437651.issue43694@roundup.psfhosted.org> Serhiy Storchaka added the comment: >From "man font": FONT OPTIONS -size size The desired size of the font. If the size argument is a posi? tive number, it is interpreted as a size in points. If size is a negative number, its absolute value is interpreted as a size in pixels. If a font cannot be displayed at the specified size, a nearby size will be chosen. If size is unspecified or zero, a platform-dependent default size will be chosen. Sizes should normally be specified in points so the application will remain the same ruler size on the screen, even when chang? ing screen resolutions or moving scripts across platforms. How? ever, specifying pixels is useful in certain circumstances such as when a piece of text must line up with respect to a fixed- size bitmap. The mapping between points and pixels is set when the application starts, based on properties of the installed monitor, but it can be overridden by calling the tk scaling com? mand. If the font size is specified in absolute pixels the scaling factor does not affect it. See fix_scaling() in Lib/idlelib/run.py for example how to handle this problem. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 10:15:17 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Apr 2021 14:15:17 +0000 Subject: [issue43695] Improve `=` in f-strings In-Reply-To: <1617279956.14.0.806481637406.issue43695@roundup.psfhosted.org> Message-ID: <1617286517.03.0.944685182701.issue43695@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think it goes too far. It was initially designed as a simple for implementation and use feature which covers a large amount of use cases of using f-strings for debugging. You propose to add syntactically a new postfix operator which is valid only in "="-substisutions in f-strings, with complex semantic. It would be difficult to implement, and it would significantly complicate Python grammar. Also it will prevent using ? for other purposes in Python expressions in future. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 10:25:08 2021 From: report at bugs.python.org (A_D) Date: Thu, 01 Apr 2021 14:25:08 +0000 Subject: [issue43694] Tkinter scaling does not work on some linux systems In-Reply-To: <1617276832.36.0.11586467537.issue43694@roundup.psfhosted.org> Message-ID: <1617287108.23.0.744123057603.issue43694@roundup.psfhosted.org> A_D added the comment: I wasnt referring to fonts, I was refering to window scaling in general, which includes widgets and other things. Which are _also_ not being scaled correctly. The example code doesnt mess with fonts at all either, which either means the default behaves in an unexpected manner, or just that as I said scaling just straight doesnt work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 10:38:06 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Apr 2021 14:38:06 +0000 Subject: [issue43694] Tkinter scaling does not work on some linux systems In-Reply-To: <1617276832.36.0.11586467537.issue43694@roundup.psfhosted.org> Message-ID: <1617287886.61.0.612935813105.issue43694@roundup.psfhosted.org> Serhiy Storchaka added the comment: What did you expect to get? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 10:42:40 2021 From: report at bugs.python.org (A_D) Date: Thu, 01 Apr 2021 14:42:40 +0000 Subject: [issue43694] Tkinter scaling does not work on some linux systems In-Reply-To: <1617276832.36.0.11586467537.issue43694@roundup.psfhosted.org> Message-ID: <1617288160.57.0.311016386577.issue43694@roundup.psfhosted.org> A_D added the comment: I'd expect the windows themselves to change size based on the percentage requested. eg as shown here https://user-images.githubusercontent.com/4589845/95577562-0a794500-0a3b-11eb-914e-9a5afc500b65.png (semirelated issue: https://github.com/EDCD/EDMarketConnector/issues/750 ) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 11:00:00 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Apr 2021 15:00:00 +0000 Subject: [issue43694] Tkinter scaling does not work on some linux systems In-Reply-To: <1617276832.36.0.11586467537.issue43694@roundup.psfhosted.org> Message-ID: <1617289200.37.0.302319297019.issue43694@roundup.psfhosted.org> Serhiy Storchaka added the comment: The size of of the window is determined by the size of its components. The size of the label and the munu is determined by the size of the font. If font has the same size and you output the same string (or string containing characters of the same proportion) you will get windows with the same size. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 11:00:41 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 01 Apr 2021 15:00:41 +0000 Subject: [issue27129] Wordcode, part 2 In-Reply-To: <1464268387.83.0.862540030058.issue27129@psf.upfronthosting.co.za> Message-ID: <1617289241.41.0.17453414399.issue27129@roundup.psfhosted.org> Mark Shannon added the comment: New changeset fcb55c0037baab6f98f91ee38ce84b6f874f034a by Mark Shannon in branch 'master': bpo-27129: Use instruction offsets, not byte offsets, in bytecode and internally. (GH-25069) https://github.com/python/cpython/commit/fcb55c0037baab6f98f91ee38ce84b6f874f034a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 11:13:58 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Apr 2021 15:13:58 +0000 Subject: [issue43692] Raise SyntaxError on implicit string concatentation in list In-Reply-To: <1617272885.12.0.631985643929.issue43692@roundup.psfhosted.org> Message-ID: <1617290038.22.0.39871721069.issue43692@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is valid Python syntax, so SyntaxErorr cannot be raised. SyntaxWarning is an option, but the Python compiler only emits it if we absolutely sure that the code contains a bug (either it does not work as intended or can work differently on other implementations or in future Python releases). And I am afraid that a lot of correct code (including the stdlib) contains implicit string concatentation in list. It is better to left such warning on third-party checkers which have options to control what warnings to emit, and not enable it by default. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 11:16:16 2021 From: report at bugs.python.org (Samuel Freilich) Date: Thu, 01 Apr 2021 15:16:16 +0000 Subject: [issue31466] No easy way to change float formatting when subclassing encoder.JSONEncoder In-Reply-To: <1505382493.14.0.667053401798.issue31466@psf.upfronthosting.co.za> Message-ID: <1617290176.14.0.614527873438.issue31466@roundup.psfhosted.org> Samuel Freilich added the comment: I think the less-minor issue, of which this is a small subset, is that JSONEncoder doesn't allow changing the behavior for default-serializable types at all. That means you can't choose to lose less information in round-trip serialization/deserialization, if that's what you want (e.g. there's no way to round-trip serialize a tuple with JSONEncoder, though it's trivial to do that for a set). ---------- nosy: +sfreilich _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 11:23:45 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 01 Apr 2021 15:23:45 +0000 Subject: [issue43683] Handle generator (and coroutine) state in the bytecode. In-Reply-To: <1617209103.34.0.926095267338.issue43683@roundup.psfhosted.org> Message-ID: <1617290625.2.0.658151642416.issue43683@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +23885 pull_request: https://github.com/python/cpython/pull/25138 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 11:26:11 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 01 Apr 2021 15:26:11 +0000 Subject: [issue26053] regression in pdb output between 2.7 and 3.5 In-Reply-To: <1452296621.32.0.373600761217.issue26053@psf.upfronthosting.co.za> Message-ID: <1617290771.78.0.924302560137.issue26053@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 652bfdee9495dca241d48278742fe035b7a82bdb by Irit Katriel in branch 'master': bpo-26053: Fix args echoed by pdb run command (#22033) https://github.com/python/cpython/commit/652bfdee9495dca241d48278742fe035b7a82bdb ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 11:26:19 2021 From: report at bugs.python.org (Samuel Freilich) Date: Thu, 01 Apr 2021 15:26:19 +0000 Subject: [issue12657] Cannot override JSON encoding of basic type subclasses In-Reply-To: <1311964088.32.0.0267577465373.issue12657@psf.upfronthosting.co.za> Message-ID: <1617290779.01.0.900578629379.issue12657@roundup.psfhosted.org> Samuel Freilich added the comment: > A modern solution for this is to define a singledispatch function (with implementations for your custom types) and pass it as the `default` parameter to the dump functions. Does that work? I thought the default function only got called for non-serializable types. I'm running into the same issue with some code that would like to do round-trip serialization of a datastructure (which doesn't need 100% generality of supported values but would like to deal with the existing structure of types). Dealing with set is easy, for example: def default(obj): # pass to default parameter of json.dumps if isinstance(obj, frozenset): return {'_class': 'set', 'items': list(obj)} ... def object_hook(obj): # pass to object_hook parameter of json.loads if obj.get('_class') == 'set': return set(decoded_dict['items']) ... But you can't do the equivalent thing for tuple, even if you override encode/iterencode. It seems like the JSON module is making performance versus generality tradeoffs, it doesn't make a fresh call to encode/iterencode for every dict key/value for example. Which is fine, but it would be nice if there was a mode that allowed getting custom behavior for every type, taking the performance cost. ---------- nosy: +sfreilich _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 11:31:03 2021 From: report at bugs.python.org (Samuel Freilich) Date: Thu, 01 Apr 2021 15:31:03 +0000 Subject: [issue12657] Cannot override JSON encoding of basic type subclasses In-Reply-To: <1311964088.32.0.0267577465373.issue12657@psf.upfronthosting.co.za> Message-ID: <1617291063.49.0.525115393589.issue12657@roundup.psfhosted.org> Samuel Freilich added the comment: A fully general solution for this might require a separate way to override the behavior for serializing dict keys (since those have to be serialized as strings). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 11:49:52 2021 From: report at bugs.python.org (Paul Moore) Date: Thu, 01 Apr 2021 15:49:52 +0000 Subject: [issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages Message-ID: <1617292192.88.0.998553072276.issue43697@roundup.psfhosted.org> New submission from Paul Moore : I am trying to write a meta path finder that "redirects" module loads to a different part of the filesystem. There's not much information in the importlib documentation, but PEP 451 says "find_spec() must return a spec with "loader" set to None (a.k.a. not set) and with submodule_search_locations set to the same portions as would have been provided by find_loader()". I have done that, and it does work as long as all parts of the namespace package are handled by the *same* metapath loader. But if I have (for instance) one portion of the namespace package handled by my finder, and want to leave the filesystem finder to handle other parts, that doesn't work. Is there a supported way to set up a finder on sys.meta_path which will expose just one "portion" of a namespace package? ---------- assignee: brett.cannon components: Documentation messages: 389997 nosy: brett.cannon, paul.moore priority: normal severity: normal status: open title: Importlib documentation does not cover how meta path finders should handle namespace packages type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 11:52:05 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 01 Apr 2021 15:52:05 +0000 Subject: [issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages In-Reply-To: <1617292192.88.0.998553072276.issue43697@roundup.psfhosted.org> Message-ID: <1617292325.76.0.988348207337.issue43697@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 12:01:52 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 01 Apr 2021 16:01:52 +0000 Subject: [issue26053] regression in pdb output between 2.7 and 3.5 In-Reply-To: <1452296621.32.0.373600761217.issue26053@psf.upfronthosting.co.za> Message-ID: <1617292912.7.0.0760389208273.issue26053@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +23886 pull_request: https://github.com/python/cpython/pull/25139 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 12:16:44 2021 From: report at bugs.python.org (A_D) Date: Thu, 01 Apr 2021 16:16:44 +0000 Subject: [issue43694] Tkinter scaling does not work on some linux systems In-Reply-To: <1617276832.36.0.11586467537.issue43694@roundup.psfhosted.org> Message-ID: <1617293804.98.0.928714630728.issue43694@roundup.psfhosted.org> A_D added the comment: Okay that makes sense to me. But then my next question is, why does this work on some linux systems and not others without having a specified font? Something funky about the font size? because I'd expect the platform defaults to at least be the same on different linux systems. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 12:59:51 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 01 Apr 2021 16:59:51 +0000 Subject: [issue43691] Comparison of OrderedDict() and dict() In-Reply-To: <1617270176.28.0.957679341953.issue43691@roundup.psfhosted.org> Message-ID: <1617296391.96.0.440591899659.issue43691@roundup.psfhosted.org> Raymond Hettinger added the comment: Unfortunately, the existing behaviors are guaranteed and cannot be changing without breaking code ? the OrderedDict class was designed to be mostly substitutable for regular dicts in existing code. Personally, I think it would have been better if OrderedDict equality always worked the same way a dict equality, but I was overruled and that ship sailed long ago. It is what it is. ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 13:01:44 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 01 Apr 2021 17:01:44 +0000 Subject: [issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date In-Reply-To: <1617181085.74.0.392624279534.issue43677@roundup.psfhosted.org> Message-ID: <1617296504.55.0.56097146377.issue43677@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 13:02:47 2021 From: report at bugs.python.org (Brett Cannon) Date: Thu, 01 Apr 2021 17:02:47 +0000 Subject: [issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages In-Reply-To: <1617292192.88.0.998553072276.issue43697@roundup.psfhosted.org> Message-ID: <1617296567.87.0.0212759043936.issue43697@roundup.psfhosted.org> Brett Cannon added the comment: There is no mechanism as the entire concept of a namespace package is implemented in importlib.machinery.PathFinder itself and not the generic import system (see https://github.com/python/cpython/blob/652bfdee9495dca241d48278742fe035b7a82bdb/Lib/importlib/_bootstrap_external.py#L1339-L1369). So at the sys.meta_path level, the entire concept of namespace packages isn't even a thing; namespace packages only exist because FileFinder itself makes namespace package possible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 13:03:43 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 01 Apr 2021 17:03:43 +0000 Subject: [issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date In-Reply-To: <1617181085.74.0.392624279534.issue43677@roundup.psfhosted.org> Message-ID: <1617296623.78.0.927533123715.issue43677@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset e689cdca3c14aab8d2d454b79ddd661b238fd301 by Zackery Spytz in branch 'master': bpo-43677: Fix a minor error in Doc/howto/descriptor.rst (#25123) https://github.com/python/cpython/commit/e689cdca3c14aab8d2d454b79ddd661b238fd301 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 13:04:07 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 01 Apr 2021 17:04:07 +0000 Subject: [issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date In-Reply-To: <1617181085.74.0.392624279534.issue43677@roundup.psfhosted.org> Message-ID: <1617296647.71.0.802529961629.issue43677@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +23887 pull_request: https://github.com/python/cpython/pull/25140 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 13:04:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 17:04:01 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617296641.18.0.31249479086.issue43688@roundup.psfhosted.org> STINNER Victor added the comment: I wrote a microbenchmark on Py_INCREF()+Py_DECREF(): $ python3 -m pyperf compare_to ref.json limited.json Mean +- std dev: [ref] 3.45 ns +- 0.17 ns -> [limited] 6.03 ns +- 0.21 ns: 1.75x slower If a function is only made of Py_INCREF() and Py_DECREF(), it can be up to 1.8x slower in the worst case. But in practice, I don't think that functions are only made of Py_INCREF() and Py_DECREF(). They do a few other things. I'm not sure how to run a "macro benchmark" on my PR 25131, since I don't know any C extension doing anything useful. There is xxlimited, but it does almost nothing. What would be a fair benchmark for this change? -- To run my microbenchmark: git apply bench.patch ./configure --with-lto --enable-optimizations make ./python -m venv env ./env/bin/python -m pip install pyperf ./env/bin/python ../bench_limited.py -o ../limited.json -v ./env/bin/python ../bench_testcapi.py -o ../ref.json -v ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 13:04:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 17:04:22 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617296662.79.0.904480319728.issue43688@roundup.psfhosted.org> Change by STINNER Victor : Added file: https://bugs.python.org/file49925/bench_limited.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 13:04:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 17:04:27 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617296667.83.0.282818844806.issue43688@roundup.psfhosted.org> Change by STINNER Victor : Added file: https://bugs.python.org/file49926/bench_testcapi.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 13:04:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 17:04:32 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617296672.65.0.93816003286.issue43688@roundup.psfhosted.org> Change by STINNER Victor : Added file: https://bugs.python.org/file49927/bench.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 14:04:25 2021 From: report at bugs.python.org (Paul Moore) Date: Thu, 01 Apr 2021 18:04:25 +0000 Subject: [issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages In-Reply-To: <1617292192.88.0.998553072276.issue43697@roundup.psfhosted.org> Message-ID: <1617300265.58.0.184329464573.issue43697@roundup.psfhosted.org> Paul Moore added the comment: OK, cool. That might be worth explaining somewhere in the docs (although I don't really know where, as I'm not sure where namespace packages are documented, either :-)) I'm not at all sure what would happen if we have meta path finders A and B on sys.meta_path in that order, and A.find_spec("foo.bar") returns a spec, but A.find_spec("foo") doesn't and B.find_spec("foo") does. I think the honest answer is "I get a headache" ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 14:18:39 2021 From: report at bugs.python.org (Vladimir Ryabtsev) Date: Thu, 01 Apr 2021 18:18:39 +0000 Subject: [issue43698] Use syntactically correct examples on abc package page Message-ID: <1617301119.32.0.268651511376.issue43698@roundup.psfhosted.org> New submission from Vladimir Ryabtsev : There are code snippets on the package's page (https://docs.python.org/3.10/library/abc.html) like this: class C(ABC): @classmethod @abstractmethod def my_abstract_classmethod(cls, ...): ... Here, the author probably wanted to demonstrate that the method may have _any other arguments_ in addition to `cls`, but it makes the code not compilable: def my_abstract_classmethod(cls, ...): ^ SyntaxError: invalid syntax Additionally it uses the same Ellipsis as in the method's body (that is supposed to indicate a stub), which is confusing. I think that all code samples must be syntactically correct, so that if a reader copypastes them into their code editor they would work right away. I suggest to remove ellipsis in the argument lists everywhere on the page and replace them with one of the following: - sample parameters such as `a, b, c` or `my_arg1, my_arg2`, - `*args, **kwargs`, - nothing. ---------- assignee: docs at python components: Documentation messages: 390004 nosy: Vladimir Ryabtsev, docs at python priority: normal severity: normal status: open title: Use syntactically correct examples on abc package page type: compile error versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 14:26:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Apr 2021 18:26:21 +0000 Subject: [issue43694] Tkinter scaling does not work on some linux systems In-Reply-To: <1617276832.36.0.11586467537.issue43694@roundup.psfhosted.org> Message-ID: <1617301581.13.0.333281646523.issue43694@roundup.psfhosted.org> Serhiy Storchaka added the comment: AFAIK X Window uses two font systems: for bitmap fonts and for scalable fonts. If default fonts on your system are bitmap fonts, they are not scaled. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 15:06:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Apr 2021 19:06:10 +0000 Subject: [issue26053] regression in pdb output between 2.7 and 3.5 In-Reply-To: <1452296621.32.0.373600761217.issue26053@psf.upfronthosting.co.za> Message-ID: <1617303970.92.0.651835082494.issue26053@roundup.psfhosted.org> STINNER Victor added the comment: New changeset bd4ab8e73906a4f12d5353f567228b7c7497baf7 by Irit Katriel in branch 'master': bpo-26053: Fix test_pdb.test_issue26053() (GH-25139) https://github.com/python/cpython/commit/bd4ab8e73906a4f12d5353f567228b7c7497baf7 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 15:11:24 2021 From: report at bugs.python.org (Carsten Docktor) Date: Thu, 01 Apr 2021 19:11:24 +0000 Subject: [issue43692] Raise SyntaxError on implicit string concatentation in list In-Reply-To: <1617272885.12.0.631985643929.issue43692@roundup.psfhosted.org> Message-ID: <1617304284.6.0.562317889826.issue43692@roundup.psfhosted.org> Carsten Docktor added the comment: I'd consider this a bug, because I find it quite error prone. But I get the point that it might be currently used. Thank you for your response. I'll rely on third party checkers for this. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 15:19:30 2021 From: report at bugs.python.org (Brett Cannon) Date: Thu, 01 Apr 2021 19:19:30 +0000 Subject: [issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages In-Reply-To: <1617292192.88.0.998553072276.issue43697@roundup.psfhosted.org> Message-ID: <1617304770.38.0.793858891911.issue43697@roundup.psfhosted.org> Brett Cannon added the comment: > I'm not sure where namespace packages are documented https://docs.python.org/3/reference/import.html#namespace-packages > I'm not at all sure what would happen if we have meta path finders A and B on sys.meta_path in that order, and A.find_spec("foo.bar") returns a spec, but A.find_spec("foo") doesn't and B.find_spec("foo") does. Nothing special. The import system just asks the meta path finder whether they can handle a module, and if they return a spec they can, if they don't then they can't. So it is of no concern whether two different meta path importers handle the same package for whatever reason. A successful import is a successful import. ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 15:25:26 2021 From: report at bugs.python.org (A_D) Date: Thu, 01 Apr 2021 19:25:26 +0000 Subject: [issue43694] Tkinter scaling does not work on some linux systems In-Reply-To: <1617276832.36.0.11586467537.issue43694@roundup.psfhosted.org> Message-ID: <1617305126.34.0.518325925553.issue43694@roundup.psfhosted.org> A_D added the comment: Thanks so much for your help. To anyone in the future trying to figure this out: Apparently the default opensuse fonts (which are noto) are _not_ scalable. In my testing the following is enough to solve the issue. ``` tk.font.nametofont('TkDefaultFont').configure(family='DejaVu Sans', size=10) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 15:47:28 2021 From: report at bugs.python.org (Brett Cannon) Date: Thu, 01 Apr 2021 19:47:28 +0000 Subject: [issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages In-Reply-To: <1617292192.88.0.998553072276.issue43697@roundup.psfhosted.org> Message-ID: <1617306448.68.0.562929812819.issue43697@roundup.psfhosted.org> Change by Brett Cannon : ---------- assignee: brett.cannon -> docs at python nosy: +docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 16:05:39 2021 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9_Lu=C3=ADs_Lopes_da_Silva?=) Date: Thu, 01 Apr 2021 20:05:39 +0000 Subject: [issue43699] ERROR: Could not find a version that satisfies the requirement MetaTrader5 Message-ID: <1617307539.35.0.971168865861.issue43699@roundup.psfhosted.org> New submission from Andr? Lu?s Lopes da Silva : Dear, I am trying to install MetaTrader5 via pip. But this return this message: Defaulting to user installation because normal site-packages is not writeable WARNING: Keyring is skipped due to an exception: Failed to unlock the keyring! ERROR: Could not find a version that satisfies the requirement MetaTrader5 ERROR: No matching distribution found for MetaTrader5 I use linux ubuntu. Thanks ---------- components: Installation messages: 390010 nosy: andre_luis priority: normal severity: normal status: open title: ERROR: Could not find a version that satisfies the requirement MetaTrader5 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 17:05:32 2021 From: report at bugs.python.org (Stephen Thorne) Date: Thu, 01 Apr 2021 21:05:32 +0000 Subject: [issue17519] unittest should not try to run abstract classes In-Reply-To: <1363951466.19.0.505441528041.issue17519@psf.upfronthosting.co.za> Message-ID: <1617311132.28.0.765352192597.issue17519@roundup.psfhosted.org> Stephen Thorne added the comment: I have done some experimentation here and thought through this feature request. The concept we are trying to deliver is: "I would like to share functionality between test classes, by having an abstract parent, with concrete leaves" The metaclass abc.ABCMeta provides functionality that means two things: - any class with this metaclass (so the class and all its subclasses, typically) that have @abc.abstractmethod or @abc.abstractproperty decorated methods will be treated as abstract - any class that is treated as abstract will raise an exception immediately, to make it clear to the programmer (and unit tests) that a programming error has occured. Following this through, we end up with two ways in which this can go wrong in unit testing if we ask our unit testing framework to not test abstract classes. This is a complete example, with both failure modes illustrated: Consider: class AbstractTestCase(unittest.TestCase, metaclass=abc.ABCMeta): ... class FooTest(AbstractTestCase): def foo(self): return 1 In this case, AbstractTestCase will not be skipped: this is because without any abstract methods inside it: it's not actually considered 'abstract', and is a concrete class. In the second case: class AbstractTestCase(unittest.TestCase, metaclass=abc.ABCMeta): @abc.abstractmethod def foo(self): ... @abc.abstractmethod def bar(self): ... class FooTest(AbstractTestCase): def foo(self): return 1 In this case, because AbstractTestCase has 2 abstract methods, it will be skipped. No tests run. But also FooTest will be skipped because it has 1 abstract method, and is therefore also abstract. If this were a 'normal' program, we would see an exception raised when FooTest is instanciated, but because we're skipping tests in abstract classes, we skip all the tests and exit with success. My gut feeling on this is that what we really want is a decorator that says: Skip this class, and only this class, explicitly. All subclasses are concrete, only this one is abstract. ---------- nosy: +sthorne _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 17:07:10 2021 From: report at bugs.python.org (Paul Moore) Date: Thu, 01 Apr 2021 21:07:10 +0000 Subject: [issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages In-Reply-To: <1617292192.88.0.998553072276.issue43697@roundup.psfhosted.org> Message-ID: <1617311230.0.0.197612127739.issue43697@roundup.psfhosted.org> Paul Moore added the comment: > if they return a spec they can, if they don't then they can't What I've never really got clear in my mind is how dotted names get handled. But that's probably just a matter of needing to experiment a bit (I don't think it's particularly complicated, I just need to get a better feel for it). > https://docs.python.org/3/reference/import.html#namespace-packages Ouch. I'd completely missed how much there is in there. Sorry about that, I should have done my research. Thanks for the help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 17:36:38 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 01 Apr 2021 21:36:38 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved In-Reply-To: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> Message-ID: <1617312998.2.0.333001412789.issue41638@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Can this be closed, Serhiy? ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 18:17:15 2021 From: report at bugs.python.org (Brett Cannon) Date: Thu, 01 Apr 2021 22:17:15 +0000 Subject: [issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages In-Reply-To: <1617292192.88.0.998553072276.issue43697@roundup.psfhosted.org> Message-ID: <1617315435.18.0.858347716204.issue43697@roundup.psfhosted.org> Brett Cannon added the comment: > What I've never really got clear in my mind is how dotted names get handled. Essentially: 1. Check if parent is imported; if not then import (working your way all the way back to the top if necessary) 2. Ask the sys.meta_path finders if they can handle the module 3. Use the loader from the spec 4. Add the imported module as an attribute on the parent If you start from https://github.com/python/cpython/blob/master/Lib/importlib/__init__.py#L108 you can see how it all works. The Python code is actually not that complicated, especially if you ignore all the old PEP 302 compatibility code ?. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 18:24:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 01 Apr 2021 22:24:36 +0000 Subject: [issue43699] ERROR: Could not find a version that satisfies the requirement MetaTrader5 In-Reply-To: <1617307539.35.0.971168865861.issue43699@roundup.psfhosted.org> Message-ID: <1617315876.47.0.623978379851.issue43699@roundup.psfhosted.org> Irit Katriel added the comment: Why do you think this is a python bug? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 18:25:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 01 Apr 2021 22:25:53 +0000 Subject: [issue43699] ERROR: Could not find a version that satisfies the requirement MetaTrader5 In-Reply-To: <1617307539.35.0.971168865861.issue43699@roundup.psfhosted.org> Message-ID: <1617315953.47.0.847963122583.issue43699@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> third party status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 18:52:53 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 01 Apr 2021 22:52:53 +0000 Subject: [issue43700] Replace Zulip badge with Discourse badge in README Message-ID: <1617317573.33.0.295703072915.issue43700@roundup.psfhosted.org> New submission from Erlend Egeberg Aasland : Suggesting to follow the dev guide and replace the Zulip badge with a Discourse badge in README.rst. Quoting the dev guide, section 2.4. Zulip: "This is no longer actively monitored by core devs. Consider asking your questions on Discourse or on the python-dev mailing list." See also: - https://python.zulipchat.com - https://devguide.python.org/help/#zulip - https://discuss.python.org/t/discourse-github-integration/355 - https://github.com/python/devguide/issues/625 - https://github.com/python/devguide/pull/630 ---------- assignee: docs at python components: Documentation messages: 390016 nosy: Mariatta, docs at python, erlendaasland, willingc priority: normal severity: normal status: open title: Replace Zulip badge with Discourse badge in README _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 18:54:13 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 01 Apr 2021 22:54:13 +0000 Subject: [issue43700] Replace Zulip badge with Discourse badge in README In-Reply-To: <1617317573.33.0.295703072915.issue43700@roundup.psfhosted.org> Message-ID: <1617317653.5.0.213913840616.issue43700@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch pull_requests: +23888 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25141 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 19:17:45 2021 From: report at bugs.python.org (David Bolen) Date: Thu, 01 Apr 2021 23:17:45 +0000 Subject: [issue27129] Wordcode, part 2 In-Reply-To: <1464268387.83.0.862540030058.issue27129@psf.upfronthosting.co.za> Message-ID: <1617319065.26.0.0927632786819.issue27129@roundup.psfhosted.org> David Bolen added the comment: Note that this commit appears to be causing exceptions for the Win10 buildbot, failing the PyCode_Addr2Line assertion in codeobject.c line 1252. The assertion seems to pop up at differing points during each test run, but the builder has yet to complete a full test run successfully. ---------- nosy: +db3l _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 19:44:46 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 01 Apr 2021 23:44:46 +0000 Subject: [issue43695] Improve `=` in f-strings In-Reply-To: <1617279956.14.0.806481637406.issue43695@roundup.psfhosted.org> Message-ID: <1617320686.01.0.193584938554.issue43695@roundup.psfhosted.org> Eric V. Smith added the comment: I'm going to close this. I agree with Serhiy that it's pushing f-strings too far. If you really want to pursue this, you'll need to specify the semantics much more clearly, and then bring it up on the python-ideas mailing list. But I don't want to give you false hope: I really don't think we'd ever accept this, given how complex it would be. That said, thanks for making me think about how this would work! ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 19:57:12 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 01 Apr 2021 23:57:12 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617321432.59.0.930339907576.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 036fc7de24cc961d65b60fba266104009feb2797 by Inada Naoki in branch 'master': bpo-43651: Fix EncodingWarning in test_warnings (GH-25126) https://github.com/python/cpython/commit/036fc7de24cc961d65b60fba266104009feb2797 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 19:59:21 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 01 Apr 2021 23:59:21 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617321561.25.0.413465706326.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset c0ec4486dc7dd70fea39d1473ac9a9ac568378fe by Inada Naoki in branch 'master': bpo-43651: Fix EncodingWarning in lib2to3/pgen2/pgen.py (GH-25127) https://github.com/python/cpython/commit/c0ec4486dc7dd70fea39d1473ac9a9ac568378fe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 20:02:04 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 02 Apr 2021 00:02:04 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617321724.6.0.777382114022.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 80017752ba938852d53f9d83a404b4ecd9ff2baa by Inada Naoki in branch 'master': bpo-43651: Fix test_compileall with PEP 597 (GH-25128) https://github.com/python/cpython/commit/80017752ba938852d53f9d83a404b4ecd9ff2baa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 20:06:36 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Apr 2021 00:06:36 +0000 Subject: [issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date In-Reply-To: <1617181085.74.0.392624279534.issue43677@roundup.psfhosted.org> Message-ID: <1617321996.94.0.541981242637.issue43677@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset d104a786fff5980360056d908a2d952b42306171 by Miss Islington (bot) in branch '3.9': bpo-43677: Fix a minor error in Doc/howto/descriptor.rst (GH-25123) (#25140) https://github.com/python/cpython/commit/d104a786fff5980360056d908a2d952b42306171 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 20:07:11 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Apr 2021 00:07:11 +0000 Subject: [issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date In-Reply-To: <1617181085.74.0.392624279534.issue43677@roundup.psfhosted.org> Message-ID: <1617322031.53.0.34908402209.issue43677@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for the bug report. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 20:18:12 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 02 Apr 2021 00:18:12 +0000 Subject: [issue27129] Wordcode, part 2 In-Reply-To: <1464268387.83.0.862540030058.issue27129@psf.upfronthosting.co.za> Message-ID: <1617322692.71.0.296817654237.issue27129@roundup.psfhosted.org> Mark Shannon added the comment: That assertion is correct, and hasn't changed. Do you have a traceback? The buildbot just shows the assertion message with no context. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 20:27:48 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 02 Apr 2021 00:27:48 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617323268.87.0.472164861914.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +23889 pull_request: https://github.com/python/cpython/pull/25142 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 20:58:17 2021 From: report at bugs.python.org (David Bolen) Date: Fri, 02 Apr 2021 00:58:17 +0000 Subject: [issue27129] Wordcode, part 2 In-Reply-To: <1464268387.83.0.862540030058.issue27129@psf.upfronthosting.co.za> Message-ID: <1617325097.08.0.287684827603.issue27129@roundup.psfhosted.org> David Bolen added the comment: Unfortunately, not at the moment - what's in the buildbot log is what's available. The RTL assertion aborts the process. The tests involved (such as test_clinic) do seem reproducible in a few separate tries, though again, all they do is terminate. As the assertion should be correct, I'm guessing it's reflecting an earlier corruption. There's some other oddities, such as the "Leaf" related failures in test_peg_generator that showed up at the same time, in case that offers any hint. Since Leaf and StringLeaf are almost next to each other in grammar.py I can't see how it can be undefined. The worker only has the core build tools version of VS so can't directly debug this further locally. I can look into using a different machine to try to get some details, but I'm not sure as to timing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 21:12:43 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Fri, 02 Apr 2021 01:12:43 +0000 Subject: [issue43549] Outdated descriptions for configuring valgrind. In-Reply-To: <1616127772.89.0.516830285286.issue43549@roundup.psfhosted.org> Message-ID: <1617325963.77.0.0723809725941.issue43549@roundup.psfhosted.org> Change by Xinmeng Xia : ---------- type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 21:40:18 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 02 Apr 2021 01:40:18 +0000 Subject: [issue26053] regression in pdb output between 2.7 and 3.5 In-Reply-To: <1452296621.32.0.373600761217.issue26053@psf.upfronthosting.co.za> Message-ID: <1617327618.18.0.56047792745.issue26053@roundup.psfhosted.org> Guido van Rossum added the comment: Do you need my help here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 22:13:32 2021 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Fri, 02 Apr 2021 02:13:32 +0000 Subject: [issue43691] Comparison of OrderedDict() and dict() In-Reply-To: <1617270176.28.0.957679341953.issue43691@roundup.psfhosted.org> Message-ID: <1617329612.02.0.267716239891.issue43691@roundup.psfhosted.org> ???? ????????? added the comment: I don't agree. There are no specifications regarding the question. Since anything relying on specific implementation (not specification) should not be considered as something we should support or take care of. Raising exception is the best thing since it will show real bug in applications. ---------- resolution: not a bug -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 22:16:11 2021 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Fri, 02 Apr 2021 02:16:11 +0000 Subject: [issue43691] Comparison of OrderedDict() and dict() In-Reply-To: <1617270176.28.0.957679341953.issue43691@roundup.psfhosted.org> Message-ID: <1617329771.12.0.305814012477.issue43691@roundup.psfhosted.org> ???? ????????? added the comment: https://mail.python.org/pipermail/python-ideas/2015-December/037472.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 22:41:53 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Apr 2021 02:41:53 +0000 Subject: [issue43691] Comparison of OrderedDict() and dict() In-Reply-To: <1617270176.28.0.957679341953.issue43691@roundup.psfhosted.org> Message-ID: <1617331313.24.0.936732199195.issue43691@roundup.psfhosted.org> Raymond Hettinger added the comment: > There are no specifications regarding the question. >From the OrderedDict docs: """ Equality tests between OrderedDict objects are order-sensitive and are implemented as list(od1.items())==list(od2.items()). Equality tests between OrderedDict objects and other Mapping objects are order-insensitive like regular dictionaries. This allows OrderedDict objects to be substituted anywhere a regular dictionary is used. """ Also, there are tests to verify these behaviors. From Lib/test/test_ordered_dict.py: def test_equality(self): OrderedDict = self.OrderedDict pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)] shuffle(pairs) od1 = OrderedDict(pairs) od2 = OrderedDict(pairs) self.assertEqual(od1, od2) # same order implies equality pairs = pairs[2:] + pairs[:2] od2 = OrderedDict(pairs) self.assertNotEqual(od1, od2) # different order implies inequality # comparison to regular dict is not order sensitive self.assertEqual(od1, dict(od2)) self.assertEqual(dict(od2), od1) # different length implied inequality self.assertNotEqual(od1, OrderedDict(pairs[:-1])) > Raising exception is the best thing since it will show > real bug in applications. Changing the implementation now will break correct code that relies the documented behavior. The change would also violate an intentional day one design goal to have ordered dictionaries be substitutable for regular dicts in existing code that may not have any concept of order. Per PEP 372: """ Is the ordered dict a dict subclass? Why? Yes. Like defaultdict, an ordered dictionary subclasses dict. Being a dict subclass make some of the methods faster (like __getitem__ and __len__). More importantly, being a dict subclass lets ordered dictionaries be usable with tools like json that insist on having dict inputs by testing isinstance(d, dict) """ > I don't agree. That's not relevant. The time to debate the merits of this API passed 13 years ago. Guido made the final decision on the equality logic. And now that the code is deployed and widely adopted, it is far too late to change it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 22:48:50 2021 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Fri, 02 Apr 2021 02:48:50 +0000 Subject: [issue43691] Comparison of OrderedDict() and dict() In-Reply-To: <1617270176.28.0.957679341953.issue43691@roundup.psfhosted.org> Message-ID: <1617331730.67.0.514720430919.issue43691@roundup.psfhosted.org> ???? ????????? added the comment: Shame on me. You are right. ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 23:30:52 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Apr 2021 03:30:52 +0000 Subject: [issue43700] Replace Zulip badge with Discourse badge in README In-Reply-To: <1617317573.33.0.295703072915.issue43700@roundup.psfhosted.org> Message-ID: <1617334252.77.0.64118370789.issue43700@roundup.psfhosted.org> miss-islington added the comment: New changeset bef7b26f7229f8b7cde843118a7bc7e2b00f0372 by Erlend Egeberg Aasland in branch 'master': bpo-43700: Replace Zulip badge with Discourse badge (GH-25141) https://github.com/python/cpython/commit/bef7b26f7229f8b7cde843118a7bc7e2b00f0372 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 23:31:20 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Apr 2021 03:31:20 +0000 Subject: [issue43700] Replace Zulip badge with Discourse badge in README In-Reply-To: <1617317573.33.0.295703072915.issue43700@roundup.psfhosted.org> Message-ID: <1617334280.68.0.434802032612.issue43700@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +23890 pull_request: https://github.com/python/cpython/pull/25143 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 23:31:29 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Apr 2021 03:31:29 +0000 Subject: [issue43700] Replace Zulip badge with Discourse badge in README In-Reply-To: <1617317573.33.0.295703072915.issue43700@roundup.psfhosted.org> Message-ID: <1617334289.93.0.559632260877.issue43700@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +23891 pull_request: https://github.com/python/cpython/pull/25144 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 23:36:06 2021 From: report at bugs.python.org (Masoud Azizi) Date: Fri, 02 Apr 2021 03:36:06 +0000 Subject: [issue43701] Add this optionality Message-ID: <1617334566.18.0.191998092151.issue43701@roundup.psfhosted.org> New submission from Masoud Azizi : I want to rediuse two var togeder! When i do that buy sum is rediuse to zero and not effect the sellsum buySum[pair] -= sellSum[pair] sellSum[pair] -= buySum[pair] Cuz of that i try this statment but its not work! Its a simple code that will python support it: buySum[pair],sellSum[pair] -= sellSum[pair], buySum[pair] Please add this optionallity to python ---------- messages: 390032 nosy: mablue priority: normal severity: normal status: open title: Add this optionality type: enhancement versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 23:54:05 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 02 Apr 2021 03:54:05 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617335645.87.0.798573753074.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 8bbfeb3330c10d52274bb85fce59ae614f0500bf by Inada Naoki in branch 'master': bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25142) https://github.com/python/cpython/commit/8bbfeb3330c10d52274bb85fce59ae614f0500bf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 23:58:14 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Apr 2021 03:58:14 +0000 Subject: [issue43700] Replace Zulip badge with Discourse badge in README In-Reply-To: <1617317573.33.0.295703072915.issue43700@roundup.psfhosted.org> Message-ID: <1617335894.49.0.887700762514.issue43700@roundup.psfhosted.org> miss-islington added the comment: New changeset a217e0ab98e883a550da001e95cb3452c1a6b9da by Miss Islington (bot) in branch '3.9': bpo-43700: Replace Zulip badge with Discourse badge (GH-25141) https://github.com/python/cpython/commit/a217e0ab98e883a550da001e95cb3452c1a6b9da ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 23:58:31 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Apr 2021 03:58:31 +0000 Subject: [issue43700] Replace Zulip badge with Discourse badge in README In-Reply-To: <1617317573.33.0.295703072915.issue43700@roundup.psfhosted.org> Message-ID: <1617335911.46.0.540879103716.issue43700@roundup.psfhosted.org> miss-islington added the comment: New changeset 154f86f056c0f68cadd310e68fd2855f9fc9a5a8 by Miss Islington (bot) in branch '3.8': bpo-43700: Replace Zulip badge with Discourse badge (GH-25141) https://github.com/python/cpython/commit/154f86f056c0f68cadd310e68fd2855f9fc9a5a8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 1 23:59:26 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 02 Apr 2021 03:59:26 +0000 Subject: [issue43700] Replace Zulip badge with Discourse badge in README In-Reply-To: <1617317573.33.0.295703072915.issue43700@roundup.psfhosted.org> Message-ID: <1617335966.11.0.689175488685.issue43700@roundup.psfhosted.org> Zachary Ware added the comment: Thanks for the patch! ---------- nosy: +zach.ware resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 00:06:20 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 02 Apr 2021 04:06:20 +0000 Subject: [issue43567] regen.vcxproj cannot regenerate some necessary files In-Reply-To: <1616238138.44.0.687655765468.issue43567@roundup.psfhosted.org> Message-ID: <1617336380.43.0.148376378065.issue43567@roundup.psfhosted.org> Guido van Rossum added the comment: Jiaxin: "Resolution: works for me" is meant for the triager to indicate that there is no bug, or at least that the repro given in the bug report doesn't trigger the bug in the triager's environment. It does *not* mean that a patch works for the submitter of the issue. But thanks for letting us know that Steve's patch works for you! :-) ---------- resolution: works for me -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 00:15:11 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 02 Apr 2021 04:15:11 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617336911.15.0.599322818797.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +23892 pull_request: https://github.com/python/cpython/pull/25145 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 00:16:14 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 02 Apr 2021 04:16:14 +0000 Subject: [issue43702] [Windows] correctly sort and remove duplicates in _winapi getenvironment() Message-ID: <1617336974.49.0.41114511179.issue43702@roundup.psfhosted.org> New submission from Eryk Sun : getenvironment() in Modules/_winapi.c needs to sort variables in the environment block and remove duplicates case insensitively [1]. The sort order used to matter with SetEnvironmentVairableW(). As soon as it reached a name in the environment block that compared greater than the target name, it would insert a new variable. Nowadays, SetEnvironmentVairableW() searches the entire environment block before inserting a new value. Regardless, at the very least, getenvironment() is not well-behaved and not setting the environment in the documented sort order that users, and possibly other programs, expect. Case-insensitive sorting in Windows uses upper case. The variable names in the mapping can be added to a list and sorted with a key function that's based on LCMapStringEx() [2], with the flag LCMAP_UPPERCASE. Loop over the sorted list to create the environment block. Remove duplicates by skipping a name that compares equal to the previously stored name according to CompareStringOrdinal() [3]. _winapi.LCMapStringEx(src, flags=LCMAP_UPPERCASE, locale=LOCALE_NAME_INVARIANT) could also be used in ntpath.normcase(), which would resolve bpo-42658. --- [1] https://docs.microsoft.com/en-us/windows/win32/procthread/changing-environment-variables [2] https://docs.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-lcmapstringex [3] https://docs.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-comparestringordinal ---------- components: Extension Modules, Windows messages: 390038 nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: [Windows] correctly sort and remove duplicates in _winapi getenvironment() type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 00:43:22 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 02 Apr 2021 04:43:22 +0000 Subject: [issue37804] Remove Thread.isAlive in Python 3.9 In-Reply-To: <1565364852.41.0.891047152339.issue37804@roundup.psfhosted.org> Message-ID: <1617338602.49.0.384370845354.issue37804@roundup.psfhosted.org> Jelle Zijlstra added the comment: The threading documentation for 3.9 still claims "While they are not listed below, the camelCase names used for some methods and functions in this module in the Python 2.x series are still supported by this module." It would be better to mention when isAlive was removed. The method is still used in some major libraries, like NLTK (https://github.com/nltk/nltk/blob/637af5380d6071517a5f0d224649e5c3560b5f91/nltk/inference/api.py#L536). Documenting the removal clearly in the threading docs would make it easier for developers to upgrade. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 01:45:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Apr 2021 05:45:26 +0000 Subject: [issue26053] regression in pdb output between 2.7 and 3.5 In-Reply-To: <1452296621.32.0.373600761217.issue26053@psf.upfronthosting.co.za> Message-ID: <1617342326.39.0.824574682761.issue26053@roundup.psfhosted.org> Irit Katriel added the comment: It?s fixed now. The tests failed when we merged this old PR. I guess they passed a few months ago but something changed in the meantime. I don?t know if there?s something to do in the CI to prevent this (expire the test run after a while?) If we want to backport then we need both PRs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 02:00:17 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Apr 2021 06:00:17 +0000 Subject: [issue43695] Improve `=` in f-strings In-Reply-To: <1617279956.14.0.806481637406.issue43695@roundup.psfhosted.org> Message-ID: <1617343217.57.0.081430867126.issue43695@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think there is a slim chance of implementing similar feature in future. If once we implement pytest-like asserts, we will need to add special expression evaluator which saves all intermediate results of subexpressions and pass them to some hook (together with string representation of subexpressions). The same evaluator with different hook could be used for "="-substitutions in f-strings. So {a+b-c=} could be evaluated to "a=20, b=40, a+b=60, c=10, a+b-c=50". But it is too early to talk about it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 02:04:06 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Apr 2021 06:04:06 +0000 Subject: [issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved In-Reply-To: <1598422615.42.0.67853581727.issue41638@roundup.psfhosted.org> Message-ID: <1617343446.89.0.269425492731.issue41638@roundup.psfhosted.org> Serhiy Storchaka added the comment: Sure. Thanks for the reminder. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 03:25:32 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 02 Apr 2021 07:25:32 +0000 Subject: [issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning In-Reply-To: <1615868389.17.0.260147645451.issue43510@roundup.psfhosted.org> Message-ID: <1617348332.25.0.817369258358.issue43510@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +23893 pull_request: https://github.com/python/cpython/pull/25146 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 04:23:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Apr 2021 08:23:31 +0000 Subject: [issue26053] regression in pdb output between 2.7 and 3.5 In-Reply-To: <1452296621.32.0.373600761217.issue26053@psf.upfronthosting.co.za> Message-ID: <1617351811.84.0.582224844.issue26053@roundup.psfhosted.org> STINNER Victor added the comment: > If we want to backport then we need both PRs. Commit 652bfdee9495dca241d48278742fe035b7a82bdb is a bugfix and this issue is marked as Python 3.8-3.10, so yeah, a backport is worth it. You can create a PR for Python 3.9 combining the two commits. I like to use "git cherry-pick -x " manually for that. And then, use the label to backport this PR to Python 3.8. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 04:39:19 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 02 Apr 2021 08:39:19 +0000 Subject: [issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning In-Reply-To: <1615868389.17.0.260147645451.issue43510@roundup.psfhosted.org> Message-ID: <1617352759.22.0.252608101938.issue43510@roundup.psfhosted.org> Inada Naoki added the comment: New changeset bec8c787ec72d73b39011bde3f3a93e9bb1174b7 by Inada Naoki in branch 'master': bpo-43510: Fix emitting EncodingWarning from _io module. (GH-25146) https://github.com/python/cpython/commit/bec8c787ec72d73b39011bde3f3a93e9bb1174b7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 04:47:34 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Apr 2021 08:47:34 +0000 Subject: [issue37804] Remove Thread.isAlive in Python 3.9 In-Reply-To: <1565364852.41.0.891047152339.issue37804@roundup.psfhosted.org> Message-ID: <1617353254.93.0.0817045296522.issue37804@roundup.psfhosted.org> STINNER Victor added the comment: > The threading documentation for 3.9 still claims "While they are not listed below, the camelCase names used for some methods and functions in this module in the Python 2.x series are still supported by this module." It would be better to mention when isAlive was removed. Do you want to propose a PR for that? I see still 4 camelCase methods in threading.Thread: * 'getName' => Thread.name can be get * 'setName' => Thread.name can be set * 'isDaemon' => Thread.name can be get * 'setDaemon' => Thread.daemon can be set ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 05:34:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 02 Apr 2021 09:34:39 +0000 Subject: [issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1617356079.03.0.160069637718.issue36384@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- priority: release blocker -> deferred blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 05:35:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 02 Apr 2021 09:35:23 +0000 Subject: [issue43223] [security] http.server: Open Redirection if the URL path starts with // In-Reply-To: <1613302956.91.0.878390782912.issue43223@roundup.psfhosted.org> Message-ID: <1617356123.7.0.611944699483.issue43223@roundup.psfhosted.org> ?ukasz Langa added the comment: Deferred the blocker to a regular release due to lack of activity in time for the current expedited releases. ---------- priority: release blocker -> deferred blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 05:35:30 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 02 Apr 2021 09:35:30 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1617356130.54.0.641455918248.issue43124@roundup.psfhosted.org> ?ukasz Langa added the comment: Deferred the blocker to a regular release due to lack of activity in time for the current expedited releases. ---------- priority: release blocker -> deferred blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 05:35:18 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 02 Apr 2021 09:35:18 +0000 Subject: [issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1617356118.1.0.793223661278.issue36384@roundup.psfhosted.org> ?ukasz Langa added the comment: Deferred the blocker to the next regular release due to lack of activity in time for the current expedited releases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 06:00:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Apr 2021 10:00:43 +0000 Subject: [issue43687] use unicode_state empty string before unicode_init. without define WITH_DOC_STRINGS In-Reply-To: <1617248361.55.0.452091252277.issue43687@roundup.psfhosted.org> Message-ID: <1617357643.75.0.719989901455.issue43687@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner nosy_count: 1.0 -> 2.0 pull_requests: +23894 pull_request: https://github.com/python/cpython/pull/25147 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 06:20:04 2021 From: report at bugs.python.org (Roundup Robot) Date: Fri, 02 Apr 2021 10:20:04 +0000 Subject: [issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak In-Reply-To: <1565194972.64.0.065323919799.issue37788@roundup.psfhosted.org> Message-ID: <1617358804.98.0.696460941825.issue37788@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 11.0 -> 12.0 pull_requests: +23895 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25148 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 06:24:09 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 02 Apr 2021 10:24:09 +0000 Subject: [issue43664] Long computations in pdb.run() lead to segfault In-Reply-To: <1617078944.41.0.741182615703.issue43664@roundup.psfhosted.org> Message-ID: <1617359049.46.0.78254964641.issue43664@roundup.psfhosted.org> Ronald Oussoren added the comment: ```pdb.run(...)``` is ends up in ```bdb.Bdb.run```, which uses compile and exec to run the code. And indeed: >>> compile("1+2" * 1000000, "-", "exec") zsh: segmentation fault python3.9 ---------- components: +Interpreter Core nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 06:40:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Apr 2021 10:40:44 +0000 Subject: [issue26053] regression in pdb output between 2.7 and 3.5 In-Reply-To: <1452296621.32.0.373600761217.issue26053@psf.upfronthosting.co.za> Message-ID: <1617360044.85.0.851802694428.issue26053@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +23896 pull_request: https://github.com/python/cpython/pull/25149 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 07:03:35 2021 From: report at bugs.python.org (Romuald Brunet) Date: Fri, 02 Apr 2021 11:03:35 +0000 Subject: [issue43703] xml.etree parser does not accept valid control characters Message-ID: <1617361415.63.0.134050826709.issue43703@roundup.psfhosted.org> New submission from Romuald Brunet : Python XML parser (xml.etree) does not seems to allow control characters that are invalid in XML 1.0, but valid in XML 1.1 [1] [2] Considering the following sample: import xml.etree.ElementTree as ET bad = 'bar  baz' print(ET.fromstring(bad)) The parser raises the following error: ParseError: reference to invalid character number: line 1, column 30 [1] https://www.w3.org/TR/xml11/Overview.html#charsets [2] https://www.w3.org/TR/xml11/Overview.html#sec-xml11 ---------- components: XML messages: 390050 nosy: Romuald priority: normal severity: normal status: open title: xml.etree parser does not accept valid control characters versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 07:16:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Apr 2021 11:16:59 +0000 Subject: [issue26053] regression in pdb output between 2.7 and 3.5 In-Reply-To: <1452296621.32.0.373600761217.issue26053@psf.upfronthosting.co.za> Message-ID: <1617362219.9.0.14444671159.issue26053@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7ad56e254519047aeb9c669b9ea2f2bf0acfd401 by Irit Katriel in branch '3.9': [3.9] bpo-26053: Fix args echoed by pdb run command (GH-25149) https://github.com/python/cpython/commit/7ad56e254519047aeb9c669b9ea2f2bf0acfd401 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 07:17:09 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Apr 2021 11:17:09 +0000 Subject: [issue26053] regression in pdb output between 2.7 and 3.5 In-Reply-To: <1452296621.32.0.373600761217.issue26053@psf.upfronthosting.co.za> Message-ID: <1617362229.74.0.309475566739.issue26053@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +23897 pull_request: https://github.com/python/cpython/pull/25150 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 07:33:38 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Apr 2021 11:33:38 +0000 Subject: [issue26053] regression in pdb output between 2.7 and 3.5 In-Reply-To: <1452296621.32.0.373600761217.issue26053@psf.upfronthosting.co.za> Message-ID: <1617363218.06.0.297276593628.issue26053@roundup.psfhosted.org> miss-islington added the comment: New changeset 2049bb2517c08b0d9eaaa4dd624afa5d60e8b5a8 by Miss Islington (bot) in branch '3.8': [3.9] bpo-26053: Fix args echoed by pdb run command (GH-25149) https://github.com/python/cpython/commit/2049bb2517c08b0d9eaaa4dd624afa5d60e8b5a8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 07:39:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Apr 2021 11:39:55 +0000 Subject: [issue26053] regression in pdb output between 2.7 and 3.5 In-Reply-To: <1452296621.32.0.373600761217.issue26053@psf.upfronthosting.co.za> Message-ID: <1617363595.11.0.597132543792.issue26053@roundup.psfhosted.org> Irit Katriel added the comment: Thanks, Victor. I created a workflow issue for the CI question: https://github.com/python/core-workflow/issues/393 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 08:03:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Apr 2021 12:03:52 +0000 Subject: [issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1617365032.7.0.61054568564.issue39947@roundup.psfhosted.org> STINNER Victor added the comment: About setting frame local variables, see: * bpo-42197: Disable automatic update of frame locals during tracing * bpo-30744: Local variable assignment is broken when combined with threads + tracing + closures * PEP 558: Defined semantics for locals() https://www.python.org/dev/peps/pep-0558/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 08:33:24 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 02 Apr 2021 12:33:24 +0000 Subject: [issue43703] xml.etree parser does not accept valid control characters In-Reply-To: <1617361415.63.0.134050826709.issue43703@roundup.psfhosted.org> Message-ID: <1617366804.54.0.80526310219.issue43703@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +eli.bendersky, scoder, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 08:37:37 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 02 Apr 2021 12:37:37 +0000 Subject: [issue43664] Long computations in pdb.run() lead to segfault In-Reply-To: <1617078944.41.0.741182615703.issue43664@roundup.psfhosted.org> Message-ID: <1617367057.99.0.893834888196.issue43664@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This looks like a duplicate of https://bugs.python.org/issue42714 which has been fixed. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 08:42:29 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 02 Apr 2021 12:42:29 +0000 Subject: [issue37804] Remove Thread.isAlive in Python 3.9 In-Reply-To: <1565364852.41.0.891047152339.issue37804@roundup.psfhosted.org> Message-ID: <1617367349.17.0.640011851354.issue37804@roundup.psfhosted.org> Jelle Zijlstra added the comment: Sure, I can submit a PR. While we're at it, we should probably also deprecate the setter/getter methods that you mention. Here's what I propose doing: - On 3.10 (or 3.11 if it's too late for 3.10), make getName and friends throw a DeprecationWarning, scheduling them for removal in 3.12 or 3.13 - On 3.8 and lower, update the docs to explicitly call out the names of the deprecated methods - On 3.9 and higher, update the docs similarly but mention that threading.isAlive was already removed If there's no objection, I'll open separate issues and PRs for these in a few days. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 08:46:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Apr 2021 12:46:22 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617367582.74.0.280234127551.issue43688@roundup.psfhosted.org> STINNER Victor added the comment: I modified my PR 25131 to only implement Py_INCREF/Py_DECREF as opaque function calls under two conditions: * Python is built in debug mode * Py_LIMITED_API macro targets Python 3.10 or newer So this PR 25131 now only has an impact on performance if Python is built in debug mode. Performance on Python built in release mode is not affected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 08:49:06 2021 From: report at bugs.python.org (Joshua Root) Date: Fri, 02 Apr 2021 12:49:06 +0000 Subject: [issue43568] Drop support for Mac OS X < 10.3 module linking In-Reply-To: <1616245702.65.0.278864424752.issue43568@roundup.psfhosted.org> Message-ID: <1617367746.69.0.112090383677.issue43568@roundup.psfhosted.org> Joshua Root added the comment: Here's the PR for pypa/distutils, which is just relaxing the MDT check since it has to work with older Python versions: https://github.com/pypa/distutils/pull/36 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 09:07:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Apr 2021 13:07:00 +0000 Subject: [issue37804] Remove Thread.isAlive in Python 3.9 In-Reply-To: <1565364852.41.0.891047152339.issue37804@roundup.psfhosted.org> Message-ID: <1617368820.11.0.782806187468.issue37804@roundup.psfhosted.org> STINNER Victor added the comment: > we should probably also deprecate the setter/getter methods that you mention You can deprecate them. Please open a new issue for that, this one is closed and specific to Thread.isAlive. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 09:28:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Apr 2021 13:28:19 +0000 Subject: [issue43687] use unicode_state empty string before unicode_init. without define WITH_DOC_STRINGS In-Reply-To: <1617248361.55.0.452091252277.issue43687@roundup.psfhosted.org> Message-ID: <1617370099.73.0.0541710894811.issue43687@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 442ad74fc2928b095760eb89aba93c28eab17f9b by Victor Stinner in branch 'master': bpo-43687: Py_Initialize() creates singletons earlier (GH-25147) https://github.com/python/cpython/commit/442ad74fc2928b095760eb89aba93c28eab17f9b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 09:29:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Apr 2021 13:29:23 +0000 Subject: [issue43687] use unicode_state empty string before unicode_init. without define WITH_DOC_STRINGS In-Reply-To: <1617248361.55.0.452091252277.issue43687@roundup.psfhosted.org> Message-ID: <1617370163.26.0.429211114777.issue43687@roundup.psfhosted.org> STINNER Victor added the comment: It's now fixed, thanks for the bug report. ---------- components: +Interpreter Core resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 09:42:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Apr 2021 13:42:09 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617370929.51.0.146617507513.issue43688@roundup.psfhosted.org> STINNER Victor added the comment: In release mode, I get the libraries: * xxlimited.cpython-310-x86_64-linux-gnu.so * xxlimited_35.cpython-310-x86_64-linux-gnu.so In debug mode, I get the libraries: * xxlimited.cpython-310d-x86_64-linux-gnu.so * xxlimited_35.cpython-310d-x86_64-linux-gnu.so It's still a different ABI: "cpython-310" vs "cpython-310d" ("D" for debug). So there is risk to be confused between the stable ABI in release mode and the stable ABI in debug mode :-) I don't how how to get the ".abi3.so" suffix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 09:45:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Apr 2021 13:45:45 +0000 Subject: [issue36465] Make release and debug ABI compatible In-Reply-To: <1553814102.98.0.064217796616.issue36465@roundup.psfhosted.org> Message-ID: <1617371145.08.0.274117575215.issue36465@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3359cab038968935b40344fad7c30d211f9692e4 by Victor Stinner in branch 'master': bpo-43688: Support the limited C API in debug mode (GH-25131) https://github.com/python/cpython/commit/3359cab038968935b40344fad7c30d211f9692e4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 09:45:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Apr 2021 13:45:45 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617371145.02.0.321054072214.issue43688@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3359cab038968935b40344fad7c30d211f9692e4 by Victor Stinner in branch 'master': bpo-43688: Support the limited C API in debug mode (GH-25131) https://github.com/python/cpython/commit/3359cab038968935b40344fad7c30d211f9692e4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 09:53:44 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Apr 2021 13:53:44 +0000 Subject: [issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384) In-Reply-To: <1593075260.88.0.835474638855.issue41111@roundup.psfhosted.org> Message-ID: <1617371624.9.0.186522572517.issue41111@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +23898 pull_request: https://github.com/python/cpython/pull/25151 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 09:56:29 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 02 Apr 2021 13:56:29 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1617371789.5.0.837414143392.issue43693@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +23899 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25152 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 10:20:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Apr 2021 14:20:12 +0000 Subject: [issue43703] xml.etree parser does not accept valid control characters In-Reply-To: <1617361415.63.0.134050826709.issue43703@roundup.psfhosted.org> Message-ID: <1617373212.2.0.535192953621.issue43703@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is a known issue, see issue11804 and issue39512. In short, the underlying library for XML parsing (expat) does not support XML 1.1 and does not have plans to support it. And seems that XML 1.1 is a dead standard if it is not supported in popular parsing libraries. >From where you get your XML data? What programs generated them? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 10:39:51 2021 From: report at bugs.python.org (Romuald Brunet) Date: Fri, 02 Apr 2021 14:39:51 +0000 Subject: [issue43703] xml.etree parser does not accept valid control characters In-Reply-To: <1617361415.63.0.134050826709.issue43703@roundup.psfhosted.org> Message-ID: <1617374391.14.0.204005394279.issue43703@roundup.psfhosted.org> Romuald Brunet added the comment: Thanks for the quick reply We're getting data from about a hundred different providers around the world; some of them not really keen on standards, so we already have some hacks to fix invalid XML. We'll add one to the list In that particular case, the XML was invalid anyway since it was an XML 1.0 document, and the character was sent as "binary" (\x19) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 10:46:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Apr 2021 14:46:16 +0000 Subject: [issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF) In-Reply-To: <1617259651.04.0.276896882913.issue43688@roundup.psfhosted.org> Message-ID: <1617374776.47.0.402084851459.issue43688@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9bb5658bd122d40fff9f34a912be3297b303d18b by Victor Stinner in branch 'master': bpo-43688: Support "make regen-limited-abi" in debug mode (GH-25133) https://github.com/python/cpython/commit/9bb5658bd122d40fff9f34a912be3297b303d18b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 10:48:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Apr 2021 14:48:20 +0000 Subject: [issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384) In-Reply-To: <1593075260.88.0.835474638855.issue41111@roundup.psfhosted.org> Message-ID: <1617374900.11.0.740787130469.issue41111@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 240bcf82a11fe7433a61da70605e924c53b88096 by Victor Stinner in branch 'master': bpo-41111: xxlimited.c defines Py_LIMITED_API (GH-25151) https://github.com/python/cpython/commit/240bcf82a11fe7433a61da70605e924c53b88096 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 11:09:54 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Apr 2021 15:09:54 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1617376194.14.0.8396756073.issue43693@roundup.psfhosted.org> Raymond Hettinger added the comment: This doesn't look simpler to me. We will forever lose mental clock cycles disentangling the locals and cells. So, I don't think they should be commingled. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 11:28:49 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 02 Apr 2021 15:28:49 +0000 Subject: [issue31956] Add start and stop parameters to the array.index() In-Reply-To: <1509966827.68.0.213398074469.issue31956@psf.upfronthosting.co.za> Message-ID: <1617377329.43.0.89124609677.issue31956@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset afd12650580725ac598b2845384771c14c4f952e by Zackery Spytz in branch 'master': bpo-31956: Add start and stop parameters to array.index() (GH-25059) https://github.com/python/cpython/commit/afd12650580725ac598b2845384771c14c4f952e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 11:30:36 2021 From: report at bugs.python.org (Eric Gavrel) Date: Fri, 02 Apr 2021 15:30:36 +0000 Subject: =?utf-8?q?=5Bissue36207=5D_r=C3=A9f=C3=A9rencement_naturel?= In-Reply-To: <1551865321.24.0.407834320039.issue36207@roundup.psfhosted.org> Message-ID: <1617377436.5.0.945425415355.issue36207@roundup.psfhosted.org> Eric Gavrel added the comment: Le sujet n'?tait il pas ? l'origine New submission from Steve Newcomb : This is especially weird because the Python source code says: class ShareableList: [...] def __init__(self, sequence=None, *, name=None): ---------- components: Library (Lib) files: shareableListBug.txt messages: 390080 nosy: steve.newcomb priority: normal severity: normal status: open title: ShareableList() raises TypeError when passing "name" keyword type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file49928/shareableListBug.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 12:32:20 2021 From: report at bugs.python.org (Ammar Askar) Date: Fri, 02 Apr 2021 16:32:20 +0000 Subject: [issue43705] [docs] Document that SyntaxError's offsets are 1-indexed Message-ID: <1617381140.86.0.138560656668.issue43705@roundup.psfhosted.org> New submission from Ammar Askar : As pointed out by Guido in https://bugs.python.org/issue43555, we switched to making the column offsets for SyntaxError be 1-indexed consistently in https://bugs.python.org/issue34683 The rationale is explained by Guido and expanded upon in follow up comments here: https://github.com/python/cpython/pull/9338#pullrequestreview-155989089 This property however was not actually ever added to SyntaxError's documentation: https://docs.python.org/3/library/exceptions.html#SyntaxError ---------- assignee: docs at python components: Documentation messages: 390081 nosy: ammar2, docs at python, gvanrossum, terry.reedy priority: normal severity: normal status: open title: [docs] Document that SyntaxError's offsets are 1-indexed versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 12:42:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Apr 2021 16:42:31 +0000 Subject: [issue27129] Wordcode, part 2 In-Reply-To: <1464268387.83.0.862540030058.issue27129@psf.upfronthosting.co.za> Message-ID: <1617381751.45.0.898663594127.issue27129@roundup.psfhosted.org> STINNER Victor added the comment: I get two crashes on Windows with Python built in debug mode: * I got a crash. I wasn't sure if it was an issue of incremental build, so I rebuilt Python. * On a fresh build, Python crashed on the CALL_FUNCTION_KW opcode, when loading names, names was equal to 0xFFFFFFFFFFFFFFFF: names = POP(); assert(PyTuple_Check(names)); <=== HERE Moreover, f->f_code was equal to 0xCBCBCBCBCBCBCBCB. But it was really weird. I added assertion to ensure that f->f_code was not equal 0xCBCBCBCBCBCBCBCB: the assertion didn't fail. * I ran "git clean -fdx" and built again Python. This time, it went fine, moreover the whole test suite passed cleanly!? "== Tests result: SUCCESS ==" and "386 tests OK." I build Python with: PCbuild\build.bat -d -p x64 -e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 12:57:49 2021 From: report at bugs.python.org (Ammar Askar) Date: Fri, 02 Apr 2021 16:57:49 +0000 Subject: [issue43705] [docs] Document that SyntaxError's offsets are 1-indexed In-Reply-To: <1617381140.86.0.138560656668.issue43705@roundup.psfhosted.org> Message-ID: <1617382669.18.0.96971455051.issue43705@roundup.psfhosted.org> Change by Ammar Askar : ---------- keywords: +patch pull_requests: +23900 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25153 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 13:36:26 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 02 Apr 2021 17:36:26 +0000 Subject: [issue43706] enumerate() instantiation time reducing by using PEP 590 vectorcall In-Reply-To: <1617384973.81.0.220949587115.issue43706@roundup.psfhosted.org> Message-ID: <1617384986.05.0.907436428213.issue43706@roundup.psfhosted.org> Change by Dong-hee Na : ---------- type: -> performance versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 13:36:13 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 02 Apr 2021 17:36:13 +0000 Subject: [issue43706] enumerate() instantiation time reducing by using PEP 590 vectorcall Message-ID: <1617384973.81.0.220949587115.issue43706@roundup.psfhosted.org> New submission from Dong-hee Na : Finally, I success to implement PEP 590 for enumerate type which is the well-used type in Python. Amazingly enhanced! +-----------------+------------------------+----------------------------+ | Benchmark | enumerate_bench_master | enumerate_bench_vectorcall | +=================+========================+============================+ | bench enumerate | 527 ns | 380 ns: 1.39x faster | +-----------------+------------------------+----------------------------+ ---------- files: bench_enumerate.py messages: 390083 nosy: corona10, vstinner, xtreak priority: normal severity: normal status: open title: enumerate() instantiation time reducing by using PEP 590 vectorcall Added file: https://bugs.python.org/file49929/bench_enumerate.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 13:53:45 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 02 Apr 2021 17:53:45 +0000 Subject: [issue43706] enumerate() instantiation time reducing by using PEP 590 vectorcall In-Reply-To: <1617384973.81.0.220949587115.issue43706@roundup.psfhosted.org> Message-ID: <1617386025.05.0.708158741895.issue43706@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +23901 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25154 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 13:57:47 2021 From: report at bugs.python.org (Maximilian Roos) Date: Fri, 02 Apr 2021 17:57:47 +0000 Subject: [issue43707] onerror in tempfile has an invalid raise expression Message-ID: <1617386267.48.0.621517587734.issue43707@roundup.psfhosted.org> New submission from Maximilian Roos : The raise expression [here](https://github.com/python/cpython/blob/ad442a674ca443feec43a88a2d3671784712e550/Lib/tempfile.py#L826) isn't valid, since it isn't in an except block. It'll still raise, given it's invalid, though not with the exception it should be raising with... I think this diff will fix it, I can put this in as a PR if that's reasonable. Though I'm not sure how to test it ? we need to generate an error that's not covered by the existing cases. ```diff diff --git a/Lib/tempfile.py b/Lib/tempfile.py index efcf7a7fb3..227e25d0fc 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -823,7 +823,7 @@ def resetperms(path): pass else: if not ignore_errors: - raise + raise exc_info[1] _shutil.rmtree(name, onerror=onerror) ``` ---------- components: Library (Lib) messages: 390084 nosy: max-sixty priority: normal severity: normal status: open title: onerror in tempfile has an invalid raise expression type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 14:13:52 2021 From: report at bugs.python.org (David Bolen) Date: Fri, 02 Apr 2021 18:13:52 +0000 Subject: [issue27129] Wordcode, part 2 In-Reply-To: <1464268387.83.0.862540030058.issue27129@psf.upfronthosting.co.za> Message-ID: <1617387232.69.0.634825322402.issue27129@roundup.psfhosted.org> David Bolen added the comment: Ah, Victor, that helps. I was having trouble reproducing the problem on a different system. I was suspecting a small difference in compiler version, but I hadn't considered it being because I started fresh. >From what I can see, a particular build tree can be successful if it remains on either side of the instruction commit, but you can't cross the boundary - in either direction. There's clearly some build artifact not being reset properly that gets out of sync. I've been able to create odd name errors even in older commits as long as the first one I build is at or after the instruction commit. But a pristine checkout on the buildbot of the latest master works, as does a git clean on the tree. I always use the buildbot scripts for building and they invoke a full clean first. So either the clean process on Windows is missing something, or there's an artifact that is supposed to be kept in sync in the source tree itself that isn't. I'm not familiar enough with the internals to guess at which yet. I suppose given that it's not a problem on other buildbots argues for the clean issue, although I suppose it could also be something that is only kept in the tree to benefit a subset of systems, like Windows. (While resetting the checkouts on the buildbot should therefore fix the current exceptions, I'm going to leave that alone for the moment, since that leaves it positioned to confirm any subsequent fix) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 14:33:56 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 02 Apr 2021 18:33:56 +0000 Subject: [issue42380] Build windows binaries with MS VS2019 16.8+ / MSVC 19.28+ In-Reply-To: <1605562580.81.0.356035250253.issue42380@roundup.psfhosted.org> Message-ID: <1617388436.45.0.345677802946.issue42380@roundup.psfhosted.org> Steve Dower added the comment: Closing this as not a bug, since the toolchain used to build CPython itself has no impact on the toolchain that extensions can use. If your build tool is not detecting newer versions of MSVC, you'll need to file that against whichever backend you are using. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 14:40:32 2021 From: report at bugs.python.org (Steve Newcomb) Date: Fri, 02 Apr 2021 18:40:32 +0000 Subject: [issue43704] ShareableList() raises TypeError when passing "name" keyword In-Reply-To: <1617380901.37.0.319201562014.issue43704@roundup.psfhosted.org> Message-ID: <1617388832.5.0.395650264453.issue43704@roundup.psfhosted.org> Steve Newcomb added the comment: I just tried the same thing on Python-3.10.0a6. Same behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 14:53:37 2021 From: report at bugs.python.org (David Bolen) Date: Fri, 02 Apr 2021 18:53:37 +0000 Subject: [issue27129] Wordcode, part 2 In-Reply-To: <1464268387.83.0.862540030058.issue27129@psf.upfronthosting.co.za> Message-ID: <1617389617.43.0.255524394071.issue27129@roundup.psfhosted.org> David Bolen added the comment: I'm out of time for a bit, but it appears that the root issue is old pyc files in Tools/clinic/__pycache__ that aren't removed during a clean process, and appear to be the source of all of the errors. Manually pruning that folder fixes things. I believe the regular (non-Windows) makefile automatically prunes all __pycache__ folders in the tree during clean which is probably why that's not an issue on other systems. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 15:10:46 2021 From: report at bugs.python.org (_) Date: Fri, 02 Apr 2021 19:10:46 +0000 Subject: [issue31842] pathlib: "Incorrect function" during resolve() In-Reply-To: <1508707873.05.0.213398074469.issue31842@psf.upfronthosting.co.za> Message-ID: <1617390646.22.0.677433123704.issue31842@roundup.psfhosted.org> _ added the comment: Still happening on Python 3.9.2 on Win10 when using a Ram Drive. Any chance of getting this fixed? ---------- nosy: +riffitos _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 15:12:49 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 02 Apr 2021 19:12:49 +0000 Subject: [issue43707] onerror in tempfile has an invalid raise expression In-Reply-To: <1617386267.48.0.621517587734.issue43707@roundup.psfhosted.org> Message-ID: <1617390769.94.0.00649544881929.issue43707@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Adding Serhiy, who added the code in question in commit e9b51c0ad81da1da11ae65840ac8b50a8521373c (GH-10320, bpo-26660, bpo-35144). ---------- nosy: +erlendaasland, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 15:17:20 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 02 Apr 2021 19:17:20 +0000 Subject: [issue43707] onerror in tempfile has an invalid raise expression In-Reply-To: <1617386267.48.0.621517587734.issue43707@roundup.psfhosted.org> Message-ID: <1617391040.29.0.568959035603.issue43707@roundup.psfhosted.org> Eryk Sun added the comment: > It'll still raise, given it's invalid, though not with the > exception it should be raising with... onerror() is always called to handle an exception, and `raise` will re-raise that exception. Is there a specific case where this isn't working as expected for you? ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 15:19:00 2021 From: report at bugs.python.org (Steve Newcomb) Date: Fri, 02 Apr 2021 19:19:00 +0000 Subject: [issue43704] ShareableList() raises TypeError when passing "name" keyword In-Reply-To: <1617380901.37.0.319201562014.issue43704@roundup.psfhosted.org> Message-ID: <1617391140.2.0.865256660802.issue43704@roundup.psfhosted.org> Steve Newcomb added the comment: And again with 3.8.8, with the same result. I also tried just using the same shared memory manager again within the same process, just as shown in the documentation. Same result: TypeError: ShareableList() got an unexpected keyword argument 'name' I must be missing something too obvious for me to see it? Or has ShareableList not worked at least since 3.8.8? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 15:26:15 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Apr 2021 19:26:15 +0000 Subject: [issue42248] Raised exception in Enum keeping user objects alive unnecessarily In-Reply-To: <1604350009.17.0.208770748804.issue42248@roundup.psfhosted.org> Message-ID: <1617391575.54.0.393412103965.issue42248@roundup.psfhosted.org> Mark Dickinson added the comment: I'm running into this, too, on Python 3.9.2; in my case it's causing segmentation faults in a wxPython-based application. Those segfaults aren't the fault of the reference cycle, of course; they're a result of wxPython being finicky about object cleanup order, but the existence of the enum reference cycle does make it harder to maneuver wxPython into a place where it doesn't crash. ---------- nosy: +ethan.furman, mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 15:35:42 2021 From: report at bugs.python.org (Brett Cannon) Date: Fri, 02 Apr 2021 19:35:42 +0000 Subject: [issue43672] Raise ImportWarning when calling find_loader() In-Reply-To: <1617119093.18.0.759506550026.issue43672@roundup.psfhosted.org> Message-ID: <1617392142.83.0.893038244279.issue43672@roundup.psfhosted.org> Brett Cannon added the comment: New changeset f97dc800689ba98783dac8dc51f87f7c6f413ac6 by Brett Cannon in branch 'master': bpo-43672: raise ImportWarning when calling find_loader() (GH-25119) https://github.com/python/cpython/commit/f97dc800689ba98783dac8dc51f87f7c6f413ac6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 15:36:01 2021 From: report at bugs.python.org (Brett Cannon) Date: Fri, 02 Apr 2021 19:36:01 +0000 Subject: [issue43672] Raise ImportWarning when calling find_loader() In-Reply-To: <1617119093.18.0.759506550026.issue43672@roundup.psfhosted.org> Message-ID: <1617392161.16.0.238179463447.issue43672@roundup.psfhosted.org> Change by Brett Cannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 15:36:42 2021 From: report at bugs.python.org (Brett Cannon) Date: Fri, 02 Apr 2021 19:36:42 +0000 Subject: [issue42135] [importlib] Deprecate find_module() & find_loader() mplementations In-Reply-To: <1603494695.54.0.8376376438.issue42135@roundup.psfhosted.org> Message-ID: <1617392202.93.0.285181842749.issue42135@roundup.psfhosted.org> Change by Brett Cannon : ---------- title: [importlib] Deprecate find_module() implementations -> [importlib] Deprecate find_module() & find_loader() mplementations _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 16:22:45 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Apr 2021 20:22:45 +0000 Subject: [issue42248] Raised exception in Enum keeping user objects alive unnecessarily In-Reply-To: <1604350009.17.0.208770748804.issue42248@roundup.psfhosted.org> Message-ID: <1617394965.77.0.911700223253.issue42248@roundup.psfhosted.org> Mark Dickinson added the comment: Here's a cut-down example, at the prompt: Python 3.9.2 (default, Mar 31 2021, 05:47:22) [Clang 11.0.3 (clang-1103.0.32.62)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import signal >>> class App: pass ... >>> def create_app(): ... app = App() ... signal.signal(signal.SIGINT, signal.SIG_DFL) ... >>> create_app() At this point, since the App() instance was local to create_app, and wasn't returned, I'd expect there to be no App objects alive in the system. But it turns out there's still an App object being kept alive: >>> import gc >>> [obj for obj in gc.get_objects() if type(obj) is App] [<__main__.App object at 0x10acb3d90>] The cause is a call to _int_to_enum in signal.py which attempts to coerce the default signal handler to an element of Handlers. That coercion fails, leaving an exception ValueError(' is not a valid Handlers') The traceback on that exception leads to the frame containing the call to Enum.__new__, which in turn contains a reference ve_exc back to the exception. [In the real code, App was a wx.App object, and the App.__init__ method played the role of create_app.] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 16:24:01 2021 From: report at bugs.python.org (Maximilian Roos) Date: Fri, 02 Apr 2021 20:24:01 +0000 Subject: [issue43707] onerror in tempfile has an invalid raise expression In-Reply-To: <1617386267.48.0.621517587734.issue43707@roundup.psfhosted.org> Message-ID: <1617395041.18.0.327727866586.issue43707@roundup.psfhosted.org> Maximilian Roos added the comment: I see @eryksun ? by convention `onerror` is always called in an except block, and so having a bare `raise` outside of an explicit except block is OK. Thanks for clarifying. I'll close this. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 16:30:08 2021 From: report at bugs.python.org (WHK) Date: Fri, 02 Apr 2021 20:30:08 +0000 Subject: [issue43708] Tkinter theme settings object schema is missing Message-ID: <1617395408.51.0.908032380158.issue43708@roundup.psfhosted.org> New submission from WHK : By example style = ttk.Style() style.theme_settings('default', settings={ '.': [] }) Tkinter settings schema or typed data is missing. By example: _tkinter.TclError: Invalid state name d This error message does not provide the missing parameter information, by example expected: "Tupe is required in .::Map background, not dict" ---------- components: Tkinter messages: 390097 nosy: WHK102 priority: normal severity: normal status: open title: Tkinter theme settings object schema is missing versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 16:56:43 2021 From: report at bugs.python.org (David Bolen) Date: Fri, 02 Apr 2021 20:56:43 +0000 Subject: [issue43709] Windows Tools\buildbot\clean.bat misses some needed pyc/pyo removal Message-ID: <1617397003.07.0.230481208149.issue43709@roundup.psfhosted.org> New submission from David Bolen : The Tools\buildbot\clean.bat script used on Windows only removes pyc/pyo files from the Lib tree, leaving some files beneath Tools (clinic and peg_generator) and Parser (asdl). This can cause failures following commits that affect those files, such as fcb55c0037baab6f98f91ee38ce84b6f874f034a (in issue #27129) leading to subsequent crashes or anomalous behavior. This appears to have been true for a while, though only the 3.10 branch ran into the issue, so any fix might also be back-ported to the other active branches. ---------- components: Build, Windows messages: 390098 nosy: db3l, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows Tools\buildbot\clean.bat misses some needed pyc/pyo removal type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 16:59:25 2021 From: report at bugs.python.org (David Bolen) Date: Fri, 02 Apr 2021 20:59:25 +0000 Subject: [issue27129] Wordcode, part 2 In-Reply-To: <1464268387.83.0.862540030058.issue27129@psf.upfronthosting.co.za> Message-ID: <1617397165.07.0.529329757319.issue27129@roundup.psfhosted.org> David Bolen added the comment: I've opened issue #43709 for fixing the buildbot clean script under Windows. It needs to clean the Tools and Parser trees, not just Lib (and there are a few other folders involved besides clinic) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 17:03:02 2021 From: report at bugs.python.org (David Bolen) Date: Fri, 02 Apr 2021 21:03:02 +0000 Subject: [issue43709] Windows Tools\buildbot\clean.bat misses some needed pyc/pyo removal In-Reply-To: <1617397003.07.0.230481208149.issue43709@roundup.psfhosted.org> Message-ID: <1617397382.95.0.866628947431.issue43709@roundup.psfhosted.org> David Bolen added the comment: Something like this is a quick 'n dirty minimal fix - at least it seems to solve the problem that arose in issue #27129 on the Win10 buildbot: --- a/Tools/buildbot/clean.bat +++ b/Tools/buildbot/clean.bat @@ -11,6 +11,8 @@ call "%pcbuild%\build.bat" -t Clean -k -d %* echo Deleting .pyc/.pyo files ... del /s "%root%\Lib\*.pyc" "%root%\Lib\*.pyo" +del /s "%root%\Tools\*.pyc" "%root%\Tools\*.pyo" +del /s "%root%\Parser\*.pyc" "%root%\Parser\*.pyo" echo Deleting test leftovers ... rmdir /s /q "%root%\build" but since this only covers the buildbot script, someone working within the regular VS IDE and just using the clean target of the projects could presumably run into the same issue. Or is there some other way to fully clean a working tree from within the IDE? Not sure how important that is to address in any event. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 17:23:12 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 02 Apr 2021 21:23:12 +0000 Subject: [issue43684] Add combined opcodes In-Reply-To: <1617230432.54.0.49540913796.issue43684@roundup.psfhosted.org> Message-ID: <1617398592.29.0.951745741502.issue43684@roundup.psfhosted.org> Guido van Rossum added the comment: Microbench results for ADD_INT: https://github.com/python/cpython/pull/25090#issuecomment-810441738 I have a few others like this lined up -- Mark recommended submitting them one at a time to make review easier. My philosophy here (which I learned from Tim Peters in the early 2000s) is that even though each individual improvement has no measurable effect on a general benchmark (as shown in the same comment), the combined effect of a number of tiny improvements can be significant. We have reached a point where there are very few individual changes possible that still have a significant effect, but we should not use this as an excuse to stop trying to improve performance. I have mislaid the results that made me think this particular opcode is a good candidate; I will go back to reproduce that result and get back to you here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 17:25:38 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Apr 2021 21:25:38 +0000 Subject: [issue43705] [docs] Document that SyntaxError's offsets are 1-indexed In-Reply-To: <1617381140.86.0.138560656668.issue43705@roundup.psfhosted.org> Message-ID: <1617398738.85.0.0311894615475.issue43705@roundup.psfhosted.org> miss-islington added the comment: New changeset b2a91e0c9ee18b50cc86b21211c2258520a9f5d0 by Ammar Askar in branch 'master': bpo-43705: Document that SyntaxError's offsets are 1-indexed (GH-25153) https://github.com/python/cpython/commit/b2a91e0c9ee18b50cc86b21211c2258520a9f5d0 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 17:25:47 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Apr 2021 21:25:47 +0000 Subject: [issue43705] [docs] Document that SyntaxError's offsets are 1-indexed In-Reply-To: <1617381140.86.0.138560656668.issue43705@roundup.psfhosted.org> Message-ID: <1617398747.43.0.596316939983.issue43705@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +23902 pull_request: https://github.com/python/cpython/pull/25155 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 17:25:56 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Apr 2021 21:25:56 +0000 Subject: [issue43705] [docs] Document that SyntaxError's offsets are 1-indexed In-Reply-To: <1617381140.86.0.138560656668.issue43705@roundup.psfhosted.org> Message-ID: <1617398756.66.0.848004394786.issue43705@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +23903 pull_request: https://github.com/python/cpython/pull/25156 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 17:48:26 2021 From: report at bugs.python.org (David Bolen) Date: Fri, 02 Apr 2021 21:48:26 +0000 Subject: [issue43709] Windows Tools\buildbot\clean.bat misses some needed pyc/pyo removal In-Reply-To: <1617397003.07.0.230481208149.issue43709@roundup.psfhosted.org> Message-ID: <1617400106.85.0.260327080154.issue43709@roundup.psfhosted.org> Change by David Bolen : ---------- keywords: +patch pull_requests: +23904 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25157 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 17:55:37 2021 From: report at bugs.python.org (Tom Aldcroft) Date: Fri, 02 Apr 2021 21:55:37 +0000 Subject: [issue29672] `catch_warnings` context manager causes all warnings to be printed every time, even after exiting In-Reply-To: <1488234596.55.0.435492915134.issue29672@psf.upfronthosting.co.za> Message-ID: <1617400537.44.0.0955301643598.issue29672@roundup.psfhosted.org> Tom Aldcroft added the comment: I encountered this issue today and want to +1 getting some attention on this. The disconnected nature of this issue makes it especially difficult to understand -- any package in the stack can change this hidden global variable `_filters_version` in the warnings module that then impacts the local behavior of warnings in the user script. The only way I was able to finally understand that an update to an obscure dependency was breaking our regression testing was by reading the `warnings` source code and then monkey patching it to print diagnostic information. Even a documentation update would be useful. This could explain not only `catch_warnings()`, but in general the unexpected feature that if any package anywhere in the stack sets a warning filter, then that globally resets whether a warning has been seen before (via the call to `_filters_mutated()`). ---------- nosy: +taldcroft versions: -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 17:58:54 2021 From: report at bugs.python.org (Tim Peters) Date: Fri, 02 Apr 2021 21:58:54 +0000 Subject: [issue43684] Add combined opcodes In-Reply-To: <1617230432.54.0.49540913796.issue43684@roundup.psfhosted.org> Message-ID: <1617400734.24.0.305734413512.issue43684@roundup.psfhosted.org> Tim Peters added the comment: """ My philosophy here (which I learned from Tim Peters in the early 2000s) is that even though each individual improvement has no measurable effect on a general benchmark (as shown in the same comment), the combined effect of a number of tiny improvements can be significant. """ And sometimes more so than the na?ve sum of their individual contributions! Although this was often much clearer on older architectures and compilers (both more predictable). Indeed, in the old days I routinely checked "optimizations" in that _slowed_ microbenchmarks, provided they reduced the work on the critical path, and didn't make the code markedly harder to follow (but reducing the critical path usually makes the code clearer!). Because, sooner or later, compilers will get smart enough to see what I saw, and generate better code. And then these can compound. Like "oh! these three temp variables don't actually need to be materialized at all anymore, and suddenly I have few enough that do need to be materialized that _all_ of them can live in fast registers...". So, at some point, the next seemingly insignificant optimization checked in could _appear_ to have an "inexplicable" benefit, by breaking the bottleneck on _some_ inscrutable HW resource overtaxed on the critical path by the original code. So optimize for what a smart compiler will eventually do, not what they happen to do today ;-) Profile-guided optimization was a major step in that direction. Saddest to me: layers of indirection introduced to support marginal features, because "well, they don't slow down pybench by much at all". That's the opposite: over time, they can compound to do worse damage than the sum of their individual burdens. In the end, Everything Counts?. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 18:18:21 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 02 Apr 2021 22:18:21 +0000 Subject: [issue43684] Add combined opcodes In-Reply-To: <1617230432.54.0.49540913796.issue43684@roundup.psfhosted.org> Message-ID: <1617401901.26.0.328799665592.issue43684@roundup.psfhosted.org> Guido van Rossum added the comment: Statically, in the stdlib, about 1 in a 1000 opcodes is an ADD_INT candidate. I'll have to do some more work to come up with a dynamic count. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 18:26:26 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Apr 2021 22:26:26 +0000 Subject: [issue43705] [docs] Document that SyntaxError's offsets are 1-indexed In-Reply-To: <1617381140.86.0.138560656668.issue43705@roundup.psfhosted.org> Message-ID: <1617402386.18.0.536740123404.issue43705@roundup.psfhosted.org> miss-islington added the comment: New changeset 06653f8d15a8a84ee0f43f739704a9a63c27de54 by Miss Islington (bot) in branch '3.8': bpo-43705: Document that SyntaxError's offsets are 1-indexed (GH-25153) https://github.com/python/cpython/commit/06653f8d15a8a84ee0f43f739704a9a63c27de54 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 18:26:37 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Apr 2021 22:26:37 +0000 Subject: [issue43705] [docs] Document that SyntaxError's offsets are 1-indexed In-Reply-To: <1617381140.86.0.138560656668.issue43705@roundup.psfhosted.org> Message-ID: <1617402397.77.0.466493247413.issue43705@roundup.psfhosted.org> miss-islington added the comment: New changeset 63c69440c7adb0de1d191a8d3d100b335d5c2f81 by Miss Islington (bot) in branch '3.9': bpo-43705: Document that SyntaxError's offsets are 1-indexed (GH-25153) https://github.com/python/cpython/commit/63c69440c7adb0de1d191a8d3d100b335d5c2f81 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 18:33:56 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Apr 2021 22:33:56 +0000 Subject: [issue43154] code.InteractiveConsole can crash if sys.excepthook is broken In-Reply-To: <1612715190.56.0.748623074825.issue43154@roundup.psfhosted.org> Message-ID: <1617402836.79.0.857991881859.issue43154@roundup.psfhosted.org> Terry J. Reedy added the comment: code.InteractiveInterpreter handles SyntaxErrors separately in showsyntaxerror rather than showtraceback. The same problem arises with a bad excepthook in line 129. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 18:43:00 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Apr 2021 22:43:00 +0000 Subject: [issue43684] Add combined opcodes In-Reply-To: <1617230432.54.0.49540913796.issue43684@roundup.psfhosted.org> Message-ID: <1617403380.96.0.786128107324.issue43684@roundup.psfhosted.org> Raymond Hettinger added the comment: > Statically, in the stdlib, about 1 in a 1000 opcodes > is an ADD_INT candidate. I would expect that ADD_INT would typically occur in loops, so even if it is a rare opcode statically, it will really count when it used. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 18:51:09 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Apr 2021 22:51:09 +0000 Subject: [issue19080] Enrich SyntaxError with additional information In-Reply-To: <1379968925.72.0.669299760684.issue19080@psf.upfronthosting.co.za> Message-ID: <1617403869.82.0.848892453261.issue19080@roundup.psfhosted.org> Terry J. Reedy added the comment: I am closing because 2 of your 3 examples (and many others) have had the messages changed in an effort to be more informative. But Pablo can reverse this if he wants. In 3.10: >>> * 2 SyntaxError: can't use starred expression here +2 and -2 are also valid expressions. /2 is not and still gets the old message. >>> 2 * SyntaxError: invalid syntax # Same. >>> if a=1: pass SyntaxError: expected ':' # At '=', which *is* an error. Also not what you you suggested, which points to the impossibility of guessing what the coder meant. ---------- nosy: +pablogsal resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 18:53:41 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Apr 2021 22:53:41 +0000 Subject: [issue43705] [docs] Document that SyntaxError's offsets are 1-indexed In-Reply-To: <1617381140.86.0.138560656668.issue43705@roundup.psfhosted.org> Message-ID: <1617404021.55.0.887836789183.issue43705@roundup.psfhosted.org> Terry J. Reedy added the comment: Should we mention that the 4 attributes are also available as a 4-tuple that is the 2nd item of the args tuple, after the message? Doing so will help when illustrating the following. For syntax errors in f-string fields, the expanded doc is still incomplete/erroneous. The text attribute is the replacement expression wrapped in parentheses (or with {} replaced by ()), with \n added; the column is the (1-based) offset within that constructed source. >>> try: compile("f'Bad {a b} field'", '', 'exec') except SyntaxError as e: print(e.args) ('f-string: invalid syntax', ('', 1, 4, '(a b)\n')) This was brought to my attention a week or so ago because IDLE still thinks that 4 refers to the 'a' of 'Bad' and marks it is the error location. I had to deduce the rule from examples. Whether for this issue or a new one, I am thinking of something like the following. --- For syntax error instances, the args attribute is (error-message, details-tuple). The str returns only the error message. For convenience, the four details are also available as separate attributes. For errors in f-string fields, the message is prefixed by "f-string:" and the offset is the offset in a text constructed from the replacement expression. For example, compiling f'Bad {a b} field' results in the following args attribute: ('f-string: invalid syntax', ('', 1, 4, '(a b)\n')). I think it okay to require the reader to match '{a b}' and '(a b)\n' to deduce the transformation rule. Messages other than 'invalid syntax', like 'closing parenthesis ...' get the same prefix. Anything Python specific can be labelled as such. ---------- nosy: -miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 21:20:46 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Apr 2021 01:20:46 +0000 Subject: [issue43634] Extensions build does not respect --jobs setting In-Reply-To: <1616785110.97.0.460566550998.issue43634@roundup.psfhosted.org> Message-ID: <1617412846.28.0.689022774863.issue43634@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +ncoghlan, petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 21:27:05 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Apr 2021 01:27:05 +0000 Subject: [issue43656] StackSummary.format fails if str(value) fails In-Reply-To: <1617010609.77.0.749976985588.issue43656@roundup.psfhosted.org> Message-ID: <1617413225.11.0.521721694582.issue43656@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 21:30:12 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Apr 2021 01:30:12 +0000 Subject: [issue43671] segfault when using tkinter + pygame for ~5 minutes In-Reply-To: <1617114887.1.0.547947822619.issue43671@roundup.psfhosted.org> Message-ID: <1617413412.95.0.50664164875.issue43671@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 21:30:29 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Apr 2021 01:30:29 +0000 Subject: [issue43671] segfault when using pygame for ~5 minutes In-Reply-To: <1617114887.1.0.547947822619.issue43671@roundup.psfhosted.org> Message-ID: <1617413429.35.0.165585638319.issue43671@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: segfault when using tkinter + pygame for ~5 minutes -> segfault when using pygame for ~5 minutes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 21:33:47 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Apr 2021 01:33:47 +0000 Subject: [issue43671] segfault when using pygame for ~5 minutes In-Reply-To: <1617114887.1.0.547947822619.issue43671@roundup.psfhosted.org> Message-ID: <1617413627.29.0.417370357377.issue43671@roundup.psfhosted.org> Terry J. Reedy added the comment: I would not be surprised if using the gui features of both tkinter and pygame together did cause a crash, as both would be competing for the screen. Ditto if both were handling key and mouse events. That might be closed instead as "won't fix" ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 21:52:36 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Apr 2021 01:52:36 +0000 Subject: [issue43684] Add combined opcodes In-Reply-To: <1617230432.54.0.49540913796.issue43684@roundup.psfhosted.org> Message-ID: <1617414756.56.0.915000727941.issue43684@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 22:00:40 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Apr 2021 02:00:40 +0000 Subject: [issue43689] difflib: mention other "problematic" characters in documentation In-Reply-To: <1617264551.39.0.962049035907.issue43689@roundup.psfhosted.org> Message-ID: <1617415240.26.0.711530690051.issue43689@roundup.psfhosted.org> Terry J. Reedy added the comment: The quote is in the following section. https://docs.python.org/3/library/difflib.html#difflib.Differ I do not really understand the previous line "Lines beginning with ??? attempt to guide the eye to intraline differences, and were not present in either input sequence. " Can you give examples where '?' occurs, with tabs and spaces (newlines would not be within a line).? ---------- nosy: +terry.reedy versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 22:09:35 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Apr 2021 02:09:35 +0000 Subject: [issue43699] ERROR: Could not find a version that satisfies the requirement MetaTrader5 In-Reply-To: <1617307539.35.0.971168865861.issue43699@roundup.psfhosted.org> Message-ID: <1617415775.45.0.23541439721.issue43699@roundup.psfhosted.org> Terry J. Reedy added the comment: Andre', direct issue like this to discussion forums like python-list. ---------- nosy: +terry.reedy stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 22:26:57 2021 From: report at bugs.python.org (Tim Peters) Date: Sat, 03 Apr 2021 02:26:57 +0000 Subject: [issue43689] difflib: mention other "problematic" characters in documentation In-Reply-To: <1617264551.39.0.962049035907.issue43689@roundup.psfhosted.org> Message-ID: <1617416817.16.0.697503623497.issue43689@roundup.psfhosted.org> Tim Peters added the comment: Lines beginning with "?" are entirely synthetic: they were not present in either input. So that's what that part means. I'm not clear on what else could be materially clearer without greatly bloating the text. For example, >>> d = difflib.Differ() >>> for L in d.compare(["abcefghijkl\n"], ["a cxefghijkl\n"]): print(L, end="") - abcefghijkl ? ^ + a cxefghijkl ? ^ + The "?" lines guide the eye to the places that differ: "b" was replaced by a blank, and "x" was inserted. The marks on the "?" lines are intended to point out exactly where changes (substitutions, insertions, deletions) occurred. If the second input had a tab instead of a blank, the "+" wouldn't _appear_ to be under the "x" at all. It would instead "look like" a long string of blanks was between "a" and "c" in the first input, and the "+" would appear to be under one of them somewhere near the middle of the empty space. Tough luck. Use tab characters (or any other kind of "goofy" whitespace) in input to visual tools, and you deserve whatever you get :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 23:09:40 2021 From: report at bugs.python.org (Christoph Gohlke) Date: Sat, 03 Apr 2021 03:09:40 +0000 Subject: [issue43710] Access violations in C extension modules on Python 3.9.3 Message-ID: <1617419380.7.0.273976800885.issue43710@roundup.psfhosted.org> New submission from Christoph Gohlke : First reported at https://github.com/numpy/numpy/issues/18720 After upgrading to Python 3.9.3, 32-bit on Windows, importing numpy (installed via `pip install numpy`) crashes: ``` Microsoft Windows [Version 10.0.19041.906] C:\Python39-32>python -X dev Python 3.9.3 (tags/v3.9.3:e723086, Apr 2 2021, 11:01:03) [MSC v.1928 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import numpy Windows fatal exception: access violation Current thread 0x0000105c (most recent call first): File "", line 228 in _call_with_frames_removed File "", line 1116 in exec_module File "", line 680 in _load_unlocked File "", line 986 in _find_and_load_unlocked File "", line 1007 in _find_and_load File "", line 228 in _call_with_frames_removed File "", line 1116 in exec_module File "", line 680 in _load_unlocked File "", line 986 in _find_and_load_unlocked File "", line 1007 in _find_and_load File "", line 228 in _call_with_frames_removed File "", line 1116 in exec_module File "", line 680 in _load_unlocked File "", line 986 in _find_and_load_unlocked File "", line 1007 in _find_and_load File "C:\Python39-32\lib\site-packages\numpy\random\_pickle.py", line 1 in File "", line 228 in _call_with_frames_removed File "", line 790 in exec_module File "", line 680 in _load_unlocked File "", line 986 in _find_and_load_unlocked File "", line 1007 in _find_and_load File "", line 228 in _call_with_frames_removed File "", line 1058 in _handle_fromlist File "C:\Python39-32\lib\site-packages\numpy\random\__init__.py", line 179 in File "", line 228 in _call_with_frames_removed File "", line 790 in exec_module File "", line 680 in _load_unlocked File "", line 986 in _find_and_load_unlocked File "", line 1007 in _find_and_load File "", line 228 in _call_with_frames_removed File "", line 1058 in _handle_fromlist File "C:\Python39-32\lib\site-packages\numpy\__init__.py", line 156 in File "", line 228 in _call_with_frames_removed File "", line 790 in exec_module File "", line 680 in _load_unlocked File "", line 986 in _find_and_load_unlocked File "", line 1007 in _find_and_load File "", line 1 in ``` Rebuilding numpy from source against Python 3.9.3 fixes this crash, but many other packages compiled against older versions of Python 3.9.x still crash. I think this might be due to . In `bpo-42500: Fix recursion in or after except (GH-23568) (#24501)`, the public `PyThreadState` struct changed. This breaks ABI compatibility for code that is directly accessing the `PyThreadState` struct members, which is not uncommon. E.g. in Cython . This code will fail on 32-bit. On 64-bit it passes because of fortunate struct alignment AFAICT. ---------- components: Extension Modules, Windows messages: 390116 nosy: cgohlke, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Access violations in C extension modules on Python 3.9.3 type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 2 23:39:59 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 03 Apr 2021 03:39:59 +0000 Subject: [issue43710] Access violations in C extension modules on Python 3.9.3 In-Reply-To: <1617419380.7.0.273976800885.issue43710@roundup.psfhosted.org> Message-ID: <1617421199.06.0.81875784827.issue43710@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +Mark.Shannon, lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 02:47:41 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Apr 2021 06:47:41 +0000 Subject: [issue43689] difflib: mention other "problematic" characters in documentation In-Reply-To: <1617264551.39.0.962049035907.issue43689@roundup.psfhosted.org> Message-ID: <1617432461.65.0.340045707483.issue43689@roundup.psfhosted.org> Terry J. Reedy added the comment: After 3+ years of Github I did not remember that B&W diffs use lines with change position markers and in particular that at they (often? always?) start with ?s. IDLE also uses color to mark positions (for syntax errors). The following would have been clearer to me and likely to people who have never seen such lines. "Location marker lines beginning with ??? use symbols to guide the eye to intraline differences." Tim, you seem to still think that tabs are especially problematical. J?rgen, without evidence otherwise, I agree with this. Adding other chars to the sentence would dilute the current focus on tabs. Hence my request for examples to justify doing so. Sorry I was not as clear as I could and should have been. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 04:04:50 2021 From: report at bugs.python.org (Martin Panter) Date: Sat, 03 Apr 2021 08:04:50 +0000 Subject: [issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak In-Reply-To: <1565194972.64.0.065323919799.issue37788@roundup.psfhosted.org> Message-ID: <1617437090.63.0.901457037304.issue37788@roundup.psfhosted.org> Martin Panter added the comment: Anselm's pull request PR 15175 looked hopeful to me. I've been using those changes in our builds at work for a while. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 04:27:22 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=BCrgen_Gmach?=) Date: Sat, 03 Apr 2021 08:27:22 +0000 Subject: [issue43689] difflib: mention other "problematic" characters in documentation In-Reply-To: <1617264551.39.0.962049035907.issue43689@roundup.psfhosted.org> Message-ID: <1617438442.25.0.0577525015606.issue43689@roundup.psfhosted.org> J?rgen Gmach added the comment: First I need to apologize for not providing more info already when I created the issue. Initially, I did not even plan to create an issue, and thought the PR with the context of the current documentation would be sufficient information. Thanks for taking your time anyway! Also, thanks to Tim for explaining the meaning of the question mark in detail. When I read the documentation, I also had to pause a moment to understand the sentence. But I agree with Tim, it is hard to explain it better without getting much more verbose. My initial reason to read (and then to update) the documentation was an output of pytest, which left me puzzled. E AssertionError: assert 'ROOT: No tox...ith_no_t0/p\n' == 'ROOT: No tox..._with_no_t0/p' E Skipping 136 identical leading characters in diff, use -v to show E - ith_no_t0/p E + ith_no_t0/p E ? + Here is the screenshot and some discussion: https://twitter.com/jugmac00/status/1377317886419738624 Using a similar snippet as Tim, here is a minimal example: for L in d.compare(["abcdefghijkl"], ["abcdefghijkl\n"]): print(L) - abcdefghijkl + abcdefghijkl ? + Usually, the output is pretty obvious most of the time, so I never actually noticed the question mark - except when whitespace characters are involved. I was then told that pytest uses difflib, and I was kindly pointed to the Python documentation. As only the tab character was listed, I thought it would be a good idea to add the other whitespace characters as well. After Tim's explanation, I see, that tabs could be especially confusing, while all whitespace characters are on a normal level of confusing :-), especially at the end of the diff. I certainly won't forget what I learned, but maybe my proposal helps one fellow Python user or another. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 06:51:24 2021 From: report at bugs.python.org (Inada Naoki) Date: Sat, 03 Apr 2021 10:51:24 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617447084.61.0.617451205119.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +23905 pull_request: https://github.com/python/cpython/pull/25158 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 06:54:52 2021 From: report at bugs.python.org (Inada Naoki) Date: Sat, 03 Apr 2021 10:54:52 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617447292.84.0.400331878602.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +23906 pull_request: https://github.com/python/cpython/pull/25159 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 07:14:45 2021 From: report at bugs.python.org (Inada Naoki) Date: Sat, 03 Apr 2021 11:14:45 +0000 Subject: [issue43711] cgi.log() uses default encoding Message-ID: <1617448485.13.0.0997125789573.issue43711@roundup.psfhosted.org> New submission from Inada Naoki : See cgi.initlog(): https://github.com/python/cpython/blob/b2a91e0c9ee18b50cc86b21211c2258520a9f5d0/Lib/cgi.py#L82 ``` logfp = open(logfile, "a") ``` This feature is not documented but can be used like this. ``` import cgi cgi.logfile="myapp.log" cgi.log("?????") ``` I want to change log file encoding to UTF-8. Although this is backward incompatible change, it unlikely break user application because it just change the logfile encoding. UTF-8 is safer than locale encoding because UTF-8 supports all valid Unicode strings. ---------- components: Library (Lib) messages: 390120 nosy: methane priority: normal severity: normal status: open title: cgi.log() uses default encoding versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 07:20:14 2021 From: report at bugs.python.org (Inada Naoki) Date: Sat, 03 Apr 2021 11:20:14 +0000 Subject: [issue43711] cgi.log() uses locale encoding In-Reply-To: <1617448485.13.0.0997125789573.issue43711@roundup.psfhosted.org> Message-ID: <1617448814.93.0.812698570792.issue43711@roundup.psfhosted.org> Change by Inada Naoki : ---------- title: cgi.log() uses default encoding -> cgi.log() uses locale encoding _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 07:30:54 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 03 Apr 2021 11:30:54 +0000 Subject: [issue43711] cgi.log() uses locale encoding In-Reply-To: <1617448485.13.0.0997125789573.issue43711@roundup.psfhosted.org> Message-ID: <1617449454.16.0.671308048664.issue43711@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 07:40:57 2021 From: report at bugs.python.org (Inada Naoki) Date: Sat, 03 Apr 2021 11:40:57 +0000 Subject: [issue43712] PEP 597: fileinput uses locale encoding Message-ID: <1617450057.65.0.948181942157.issue43712@roundup.psfhosted.org> New submission from Inada Naoki : fileinput.input() and fileinput.FileInput() don't have `encoding` parameter. User can specify encoding by `openhook=hook_encoded("utf-8")`. But we can not utilize PEP 597, and `encoding="utf-8"` is more user friendly. Additionally, `hook_compressed` doesn't have the encoding parameter. User need to use binary mode or locale encoding. ---------- components: Library (Lib) messages: 390121 nosy: methane priority: normal severity: normal status: open title: PEP 597: fileinput uses locale encoding versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 08:10:43 2021 From: report at bugs.python.org (Mark Shannon) Date: Sat, 03 Apr 2021 12:10:43 +0000 Subject: [issue43710] Access violations in C extension modules on Python 3.9.3 In-Reply-To: <1617419380.7.0.273976800885.issue43710@roundup.psfhosted.org> Message-ID: <1617451843.42.0.299055643806.issue43710@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +23907 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25160 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 08:33:39 2021 From: report at bugs.python.org (Tomer Kalish) Date: Sat, 03 Apr 2021 12:33:39 +0000 Subject: [issue43713] sorted() signature is not accurate in the documentation Message-ID: <1617453219.6.0.129506817169.issue43713@roundup.psfhosted.org> New submission from Tomer Kalish : According to the docs, the sorted function's signature is: sorted(iterable, *, key=None, reverse=False) But when printing its help interactively, the signature is: sorted(iterable, /, *, key=None, reverse=False) The latter seems to be the correct one, as calling sorted(iterable=arr) will raise a TypeError. The signature in the docs should be fixed. ---------- assignee: docs at python components: Documentation messages: 390122 nosy: docs at python, tomer.kalish91 priority: normal severity: normal status: open title: sorted() signature is not accurate in the documentation type: resource usage versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 09:02:32 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sat, 03 Apr 2021 13:02:32 +0000 Subject: [issue43701] Add this optionality In-Reply-To: <1617334566.18.0.191998092151.issue43701@roundup.psfhosted.org> Message-ID: <1617454952.31.0.555785892248.issue43701@roundup.psfhosted.org> Vedran ?a?i? added the comment: Well, just reverse the order of -= in second statement. If you write =-, it will magically work. ;-) But in the general case, sometimes introducing temporary variables is the simplest solution. The alternative would be to implement pointwise -= for tuples, which would be extremely confusing since they already implement += with a completely different semantics. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 09:03:13 2021 From: report at bugs.python.org (Alexander Grigoriev) Date: Sat, 03 Apr 2021 13:03:13 +0000 Subject: [issue43714] re.split(), re.sub(): '\Z' must consume end of string if it matched Message-ID: <1617454993.35.0.466919552737.issue43714@roundup.psfhosted.org> New submission from Alexander Grigoriev : If '\Z' matches as part of a pattern in re.sub() or re.split(), it should consume the end of string, and then '\Z' alone should not match the end of string again. Current behavior: Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> print(re.split(r'/?\Z', 'a/b/c/d/')) ['a/b/c/d', '', ''] >>> print(re.sub(r'/?\Z', '-', 'a/b/c/d/')) a/b/c/d-- Wanted behavior: >>> print(re.split(r'/?\Z', 'a/b/c/d/')) ['a/b/c/d', ''] >>> print(re.sub(r'/?\Z', '-', 'a/b/c/d/')) a/b/c/d- ---------- components: Library (Lib) messages: 390124 nosy: alegrigoriev priority: normal severity: normal status: open title: re.split(), re.sub(): '\Z' must consume end of string if it matched type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 10:45:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Apr 2021 14:45:27 +0000 Subject: [issue43711] cgi.log() uses locale encoding In-Reply-To: <1617448485.13.0.0997125789573.issue43711@roundup.psfhosted.org> Message-ID: <1617461127.83.0.462147348304.issue43711@roundup.psfhosted.org> Serhiy Storchaka added the comment: This is a duplicate of issue41139. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> cgi uses the locale encoding for log files _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 11:56:39 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 03 Apr 2021 15:56:39 +0000 Subject: [issue43713] sorted() signature is not accurate in the documentation In-Reply-To: <1617453219.6.0.129506817169.issue43713@roundup.psfhosted.org> Message-ID: <1617465399.52.0.96194723832.issue43713@roundup.psfhosted.org> Raymond Hettinger added the comment: There is moratorium on the / notation in the main docs. If that moratorium is lifted, we sweep through the docs and apply it. ---------- nosy: +rhettinger resolution: -> later stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 12:38:25 2021 From: report at bugs.python.org (Matthew Barnett) Date: Sat, 03 Apr 2021 16:38:25 +0000 Subject: [issue43714] re.split(), re.sub(): '\Z' must consume end of string if it matched In-Reply-To: <1617454993.35.0.466919552737.issue43714@roundup.psfhosted.org> Message-ID: <1617467905.43.0.702688144499.issue43714@roundup.psfhosted.org> Matthew Barnett added the comment: Do any other regex implementations behave the way you want? In my experience, there's no single "correct" way for a regex to behave; different implementations might give slightly different results, so if the most common ones behave a certain way, then that's the de facto standard, even if it not what you'd expect or want. ---------- nosy: +mrabarnett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 12:41:45 2021 From: report at bugs.python.org (Steve Dower) Date: Sat, 03 Apr 2021 16:41:45 +0000 Subject: [issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1617468105.24.0.540299420197.issue36384@roundup.psfhosted.org> Steve Dower added the comment: (Copied from my comment on the PR, following the one where I said this was ready to go.) Withdrawing the readiness - @ambv and I would prefer to see this behind a flag (probably "strict" parsing), on by default for 3.10, and maybe on by default for 3.9/earlier. The main reasoning being that this isn't our vulnerability, but an inconsistency with other vulnerable libraries. The current fix is the best it can be, but it doesn't prevent the vulnerability, it just causes Python to break first. So it ought to be relatively easy to retain the flexible (though admittedly non-sensical) behaviour for those who currently rely on it. ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 12:42:52 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 03 Apr 2021 16:42:52 +0000 Subject: [issue43701] Add this optionality In-Reply-To: <1617334566.18.0.191998092151.issue43701@roundup.psfhosted.org> Message-ID: <1617468172.11.0.876009534631.issue43701@roundup.psfhosted.org> Ned Deily added the comment: If you want to pursue your suggestion for a change in the language, the best place to do so is first on the python-ideas mailing list (https://mail.python.org/mailman3/lists/python-ideas.python.org/). The issue tracker here is more for bugs and minor enhancements. ---------- nosy: +ned.deily resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 12:45:34 2021 From: report at bugs.python.org (Lukas Vacek) Date: Sat, 03 Apr 2021 16:45:34 +0000 Subject: [issue38794] Setup: support linking openssl statically In-Reply-To: <1573734613.61.0.712380405287.issue38794@roundup.psfhosted.org> Message-ID: <1617468334.52.0.202587490721.issue38794@roundup.psfhosted.org> Lukas Vacek added the comment: For the record, this would have been solved more than a year ago already. When this change was proposed more than a year ago it was rejected with "There is no need to add more configure flags to build Python with a custom OpenSSL installation. " yet now it's ok to add a new option --with-openssl-rpath https://bugs.python.org/issue43466 ? And the first comment there, from python core dev nonetheless, is suggesting static linking as well. Emm... this would have been solved year and half ago. I would be happy to completely drop my proposed (and approved on gihub) changes and implement it in a different way. The maintainer's attitude as demonstrated here can be really harmful in open-source projects (many of us still remember eglibc fork back in the day) but fortunately this is the first time I noticed such attitude among python developers. Importantly the issue is resolved now (did it take a request from IBM's customer to get this implemented ;-) ?) and hopefully a lesson learnt and Christian will be more welcoming and less judgemental of outsiders' contributions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 13:06:49 2021 From: report at bugs.python.org (William Woodruff) Date: Sat, 03 Apr 2021 17:06:49 +0000 Subject: [issue38794] Setup: support linking openssl statically In-Reply-To: <1617468334.52.0.202587490721.issue38794@roundup.psfhosted.org> Message-ID: <20210403170644.eenelce4fn3ng5iv@janus> William Woodruff added the comment: I don't think this is a productive or polite response. If you read the issue linked, you'll note that the other flag added (--with-openssl-rpath) is in furtherance of any *already* supported linking scenario (dynamic, with a non-system-default OpenSSL). The proposed change here is for an *new* linking scenario, i.e. statically linking OpenSSL. I don't blame the maintainers for not wanting to add another build configuration to their plate, especially for something like OpenSSL. It's up to us as end users to make those accommodations on our own, knowing that what we're doing isn't tested or directly supported. The resolution above is, in my book, the ideal one. Best, William On Sat, Apr 03, 2021 at 04:45:34PM +0000, Lukas Vacek wrote: > > Lukas Vacek added the comment: > > For the record, this would have been solved more than a year ago already. > > When this change was proposed more than a year ago it was rejected with "There is no need to add more configure flags to build Python with a custom OpenSSL installation. " yet now it's ok to add a new option --with-openssl-rpath https://bugs.python.org/issue43466 ? > > And the first comment there, from python core dev nonetheless, is suggesting static linking as well. Emm... this would have been solved year and half ago. I would be happy to completely drop my proposed (and approved on gihub) changes and implement it in a different way. > > The maintainer's attitude as demonstrated here can be really harmful in open-source projects (many of us still remember eglibc fork back in the day) but fortunately this is the first time I noticed such attitude among python developers. > > Importantly the issue is resolved now (did it take a request from IBM's customer to get this implemented ;-) ?) and hopefully a lesson learnt and Christian will be more welcoming and less judgemental of outsiders' contributions. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 13:42:34 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 03 Apr 2021 17:42:34 +0000 Subject: [issue17306] Improve the way abstract base classes are shown in help() In-Reply-To: <1361932149.15.0.421194254516.issue17306@psf.upfronthosting.co.za> Message-ID: <1617471754.02.0.524903619771.issue17306@roundup.psfhosted.org> Raymond Hettinger added the comment: Closing this due to lack of interest. ---------- resolution: -> postponed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 14:08:51 2021 From: report at bugs.python.org (Ammar Askar) Date: Sat, 03 Apr 2021 18:08:51 +0000 Subject: [issue43705] [docs] Document that SyntaxError's offsets are 1-indexed In-Reply-To: <1617381140.86.0.138560656668.issue43705@roundup.psfhosted.org> Message-ID: <1617473331.95.0.205277669063.issue43705@roundup.psfhosted.org> Ammar Askar added the comment: Aah thanks for pointing that out Terry, I didn't realize f-strings have different semantics for SyntaxError. Would you mind making a separate issue for that, I'll look into making the documentation for it clearer after I get a chance to investigate. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 14:14:11 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 03 Apr 2021 18:14:11 +0000 Subject: [issue43710] Access violations in C extension modules on Python 3.9.3 In-Reply-To: <1617419380.7.0.273976800885.issue43710@roundup.psfhosted.org> Message-ID: <1617473651.84.0.779954039073.issue43710@roundup.psfhosted.org> ?ukasz Langa added the comment: Tomorrow evening CEST (around 30 hours from now) I intend to release a hotfix 3.9.4 with Mark's fix. ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 15:08:25 2021 From: report at bugs.python.org (Tim Peters) Date: Sat, 03 Apr 2021 19:08:25 +0000 Subject: [issue43593] pymalloc is not aware of Memory Tagging Extension (MTE) and crashes In-Reply-To: <1616419787.13.0.506382582675.issue43593@roundup.psfhosted.org> Message-ID: <1617476905.39.0.90860189933.issue43593@roundup.psfhosted.org> Tim Peters added the comment: Can't really know without a system to try it on, but my best guess is that these asserts are the only thing that will fail with tagging enabled. The obvious "fix" is indeed just to skip them on a platform with tagging enabled. They're meant as a sanity check that only 48 bits are really used for addresses. Which remains true even when tagging is enabled - the tag bits are part of the _pointer_ on AMD, but not part of the address. Taking tagging seriously instead would be a significant project, relying on platform-specific instructions. For a start, obmalloc would have to generate a random 4-bit integer for each object it returns, plug that into 4 specific "high order" bits of the pointer it returns, and tell the OS to associate those 4 bits with each 16-byte chunk of the object's space. mmap()-like calls would also need to be changed, to tell the OS to enable tag checking on the memory slice returned. While caching may or may not speed things up, I'm not seeing how it _could_ help move to 64-bit addresses. As is, the tree needs 8 bytes of bottom-node space for each arena in use, and that's independent of how many address bits there are (it only depends on the arena granularity). I think that could be cut by a factor of 4 by keeping track of arena pool (instead of byte) boundaries in the bottom nodes, meaning that, with the _current_ settings, we'd only need to keep track of the 64=2^6 possible pool addresses in an arena, instead of the 2^20 possible byte addresses. 6 bits fits fine in a signed 8-bit int (but we need a 32-bit int now to hold the 2^20 possible byte addresses in an arena). So the clearest way to ease the space burden of keeping track of truly expansive address spaces is to boost arena size. And, if the tree bottom changed to keep track of pool (instead of byte) addresses, possibly boost pool size too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 15:22:03 2021 From: report at bugs.python.org (Peter J. Farley III) Date: Sat, 03 Apr 2021 19:22:03 +0000 Subject: [issue43715] curses inch() and scrbkgd() documentation ommissions Message-ID: <1617477723.19.0.381446769409.issue43715@roundup.psfhosted.org> New submission from Peter J. Farley III : The documentation for the result values of curses functions inch() and scrbkgd() or how to use those result values are omitted entirely. Documentation should at least describe how to use the result values of these functions without necessarily describing the actual format of the results, which do differ depending on the implementation of curses being used. A suggestion for the documentation change is attached. A separate issue will be filed questioning the need to shift the pair number result of the curses.pair_number() function in the Windows terminal environment. ---------- components: Extension Modules files: curses-doc-change.txt messages: 390136 nosy: pjfarleyiii priority: normal severity: normal status: open title: curses inch() and scrbkgd() documentation ommissions versions: Python 3.8, Python 3.9 Added file: https://bugs.python.org/file49930/curses-doc-change.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 15:34:11 2021 From: report at bugs.python.org (Peter J. Farley III) Date: Sat, 03 Apr 2021 19:34:11 +0000 Subject: [issue43716] curses.pair_number() function incorrect value under Windows Message-ID: <1617478451.24.0.000946150268907.issue43716@roundup.psfhosted.org> New submission from Peter J. Farley III : curses.pair_number() result under Windows (console or Terminal window) value must be shifted by 16 bits to be valid to use as input to the curses.pair_content() function. If the pair number result is not shifted, the call to curses.pair_content() fails with an overflow error: Traceback (most recent call last): File "C:\Users\MyUser\test\curses-color.py", line 126, in curses.wrapper(main) File "C:\Python38\lib\curses\__init__.py", line 105, in wrapper return func(stdscr, *args, **kwds) File "C:\Users\MyUser\test\curses-color.py", line 72, in main fg, bg = curses.pair_content (pair) OverflowError: signed short integer is greater than maximum The attached curses program demonstrates the correct functioning using the pair value shift under Windows. Comment out the "if" and shift lines to reproduce the overflow error. Environment information: Windows 10 (latest updates) Windows cmd.exe window or Windows Terminal Version: 1.6.10571.0 Python 3.8.7 windows-curses 2.2.0 Also tested in: Ubuntu 20.04 (WSL2) ncurses6/focal,now 6.2-0ubuntu2 amd64 ---------- components: Extension Modules files: curses-color-1.py messages: 390137 nosy: pjfarleyiii priority: normal severity: normal status: open title: curses.pair_number() function incorrect value under Windows versions: Python 3.8 Added file: https://bugs.python.org/file49931/curses-color-1.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 15:38:31 2021 From: report at bugs.python.org (Michael Osipov) Date: Sat, 03 Apr 2021 19:38:31 +0000 Subject: [issue43717] Confusing OSError on HTTP CONNECT failure Message-ID: <1617478711.42.0.190186682039.issue43717@roundup.psfhosted.org> New submission from Michael Osipov <1983-01-06 at gmx.net>: When working with proxies and HTTP CONNECT I came across these lines: https://github.com/python/cpython/blob/63c69440c7adb0de1d191a8d3d100b335d5c2f81/Lib/http/client.py#L901-L903 I truly fail to see why this is an OSError. OSErrors (https://docs.python.org/3/library/exceptions.html#os-exceptions) describe a low-level issues, but HTTP is a high level protocol. I would expect something like NotConnected or at least something which derives from HTTPException. OSError is expected on socket issues only. ---------- components: Library (Lib) messages: 390138 nosy: michael-o priority: normal severity: normal status: open title: Confusing OSError on HTTP CONNECT failure type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 15:45:12 2021 From: report at bugs.python.org (Michael Osipov) Date: Sat, 03 Apr 2021 19:45:12 +0000 Subject: [issue43718] HTTP CONNECT response not subject to debug level Message-ID: <1617479112.59.0.978864196695.issue43718@roundup.psfhosted.org> New submission from Michael Osipov <1983-01-06 at gmx.net>: Looking at https://github.com/python/cpython/blob/63c69440c7adb0de1d191a8d3d100b335d5c2f81/Lib/http/client.py#L898 self.debuglevel is not passed to response_class() and for debugging purposes I miss to see: > send: b'CONNECT some-host:443 HTTP/1.0\r\n' > send: b'\r\n' > reply: 'HTTP/1.0 502 Bad Gateway\r\n' reply is missing. It trivial to pass the debug level. ---------- components: Library (Lib) messages: 390139 nosy: michael-o priority: normal severity: normal status: open title: HTTP CONNECT response not subject to debug level versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 16:15:48 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Apr 2021 20:15:48 +0000 Subject: [issue43719] Master build failure on Windows getting file system encoding Message-ID: <1617480948.24.0.651940029044.issue43719@roundup.psfhosted.org> New submission from Terry J. Reedy : After a fresh update from upstream > PCbuild\build.bat -D (or without -D) on my machine ends with python.vcxproj -> f:\dev\3x\PCbuild\amd64\python_d.pdb (Full PDB) Python path configuration: PYTHONHOME = (not set) PYTHONPATH = 'f:\dev\3x\Lib' program name = 'f:\dev\3x\PCbuild\amd64\python_d.exe' isolated = 0 environment = 1 user site = 1 import site = 1 sys._base_executable = 'f:\\dev\\3x\\PCbuild\\amd64\\python_d.exe' sys.base_prefix = 'f:\\dev\\3x' sys.base_exec_prefix = 'f:\\dev\\3x' sys.platlibdir = 'lib' sys.executable = 'f:\\dev\\3x\\PCbuild\\amd64\\python_d.exe' sys.prefix = 'f:\\dev\\3x' sys.exec_prefix = 'f:\\dev\\3x' sys.path = [ 'f:\\dev\\3x\\Lib', 'f:\\dev\\3x\\PCbuild\\amd64\\python310_d.zip', 'f:\\dev\\3x\\DLLs', 'f:\\dev\\3x\\lib', 'f:\\dev\\3x\\PCbuild\\amd64', ] EXEC : Fatal Python warning : init_fs_encoding: failed to get the Python codec of the filesystem encoding [f:\dev\3x\PCbuild\python.vcxproj] Python runtime state: core initialized Traceback (most recent call last): File "f:\dev\3x\Lib\encodings\__init__.py", line 31, in f:\dev\3x\PCbuild\python.vcxproj(123,5): warning MSB3073: The command "setlocal \r f:\dev\3x\PCbuild\python.vcxproj(123,5): warning MSB3073: set PYTHONPATH=f:\dev \3x\Lib\r f:\dev\3x\PCbuild\python.vcxproj(123,5): warning MSB3073: "f:\dev\3x\PCbuild\am d64\python_d.exe" "f:\dev\3x\PC\validate_ucrtbase.py" ucrtbased" exited with co de -1073741819. pythonw.vcxproj -> f:\dev\3x\PCbuild\amd64\pythonw_d.exe pythonw.vcxproj -> f:\dev\3x\PCbuild\amd64\pythonw_d.pdb (Full PDB) EXEC : Fatal Python warning : init_fs_encoding: failed to get the Python codec of the filesystem encoding [f:\dev\3x\PCbuild\python.vcxproj] f:\dev\3x\PCbuild\python.vcxproj(123,5): warning MSB3073: The command "setlocal \r f:\dev\3x\PCbuild\python.vcxproj(123,5): warning MSB3073: set PYTHONPATH=f:\dev \3x\Lib\r f:\dev\3x\PCbuild\python.vcxproj(123,5): warning MSB3073: "f:\dev\3x\PCbuild\am d64\python_d.exe" "f:\dev\3x\PC\validate_ucrtbase.py" ucrtbased" exited with co de -1073741819. I believe I pulled and rebuilt fine just a few days ago. Subsequently running > python ends with Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized Traceback (most recent call last): File "f:\dev\3x\\lib\encodings\__init__.py", line 31, in Running > chkdsk F: /scan revealed no obvious disk error, but there could be corrupted bytes in some file, but I don't know what file(s) to check (if text) or delete and have git redownload. Anyone else have a similar problem? ---------- components: Build, Windows keywords: 3.10regression messages: 390140 nosy: pablogsal, paul.moore, steve.dower, terry.reedy, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: Master build failure on Windows getting file system encoding type: compile error versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 16:45:08 2021 From: report at bugs.python.org (Brett Cannon) Date: Sat, 03 Apr 2021 20:45:08 +0000 Subject: [issue43720] Document various preexisting stdlib deprecations related to import for removal in Python 3.12 Message-ID: <1617482708.53.0.134596819215.issue43720@roundup.psfhosted.org> New submission from Brett Cannon : The following module's have preexisting deprecations with no slated removal version. Since so much of import is getting cleaned up in Python 3.12, these should finally go as well so the APIs are consistent across Python. - imp - pkgutil - importlib.util ---------- assignee: brett.cannon components: Library (Lib) messages: 390141 nosy: brett.cannon priority: normal severity: normal status: open title: Document various preexisting stdlib deprecations related to import for removal in Python 3.12 versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 16:47:30 2021 From: report at bugs.python.org (Brett Cannon) Date: Sat, 03 Apr 2021 20:47:30 +0000 Subject: [issue43720] Document various preexisting stdlib deprecations related to import for removal in Python 3.12 In-Reply-To: <1617482708.53.0.134596819215.issue43720@roundup.psfhosted.org> Message-ID: <1617482850.26.0.00713901012273.issue43720@roundup.psfhosted.org> Change by Brett Cannon : ---------- keywords: +patch pull_requests: +23908 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25167 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 17:06:50 2021 From: report at bugs.python.org (Brett Cannon) Date: Sat, 03 Apr 2021 21:06:50 +0000 Subject: [issue42135] [importlib] Deprecate find_module() & find_loader() mplementations In-Reply-To: <1603494695.54.0.8376376438.issue42135@roundup.psfhosted.org> Message-ID: <1617484010.54.0.211263312818.issue42135@roundup.psfhosted.org> Brett Cannon added the comment: find_spec() also supercedes find_loader(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 17:07:17 2021 From: report at bugs.python.org (Brett Cannon) Date: Sat, 03 Apr 2021 21:07:17 +0000 Subject: [issue42135] [importlib] Deprecate find_module() & find_loader() mplementations In-Reply-To: <1603494695.54.0.8376376438.issue42135@roundup.psfhosted.org> Message-ID: <1617484037.7.0.9560153702.issue42135@roundup.psfhosted.org> Change by Brett Cannon : ---------- assignee: -> brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 17:43:16 2021 From: report at bugs.python.org (Tim Peters) Date: Sat, 03 Apr 2021 21:43:16 +0000 Subject: [issue43593] pymalloc is not aware of Memory Tagging Extension (MTE) and crashes In-Reply-To: <1616419787.13.0.506382582675.issue43593@roundup.psfhosted.org> Message-ID: <1617486196.22.0.848607973139.issue43593@roundup.psfhosted.org> Tim Peters added the comment: BTW, your cache WIP https://github.com/python/cpython/pull/25130/files partly moves to tracking pool (instead of byte) addresses, but any such attempt faces a subtlety: it's not necessarily the case that a pool is entirely "owned" by obmalloc or by the system. It can be split. To be concrete, picture a decimal machine with arenas at 10,000 byte boundaries and pools at 100-byte boundaries, with the system malloc returning 20-byte aligned addresses. If obmalloc gets an arena starting at address 20,020, the pool range(20000, 20100) has its first 20 bytes owned by the system, but its last 80 bytes owned by obmalloc. Pass 20050 to the PR's address_in_range, and it will say it's owned by the system (because its _pool_ address, 20000, is). But it's actually owned by obmalloc. I'm not sure it matters, but it's easy to get a headache trying to out-think it ;-) In that case, obmalloc simply ignores the partial pool at the start, and the first address it can pass out is 20100. So it would never be valid for free() or realloc() to get 20050 as an input. On the other end, the arena would end at byte 20020 + 10000 - 1 = 30019. This seems worse! If 30040 were passed in, that's a system address, but its _pool_ address is 30000, which obmalloc does control. That reminds me now why the current scheme tracks byte addresses instead ;-) It appears it would require more tricks to deal correctly in all cases when system-supplied arenas aren't necessarily aligned to pool addresses (which was never a consideration in the old scheme, since a pool was at largest a system page, and all mmap()-like functions (used to get an arena) in real life return an address at worst page-aligned). Or we'd need to find ways to force mmap() (across different systems' spellings) to return a pool-aligned address for arenas to begin with. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 17:46:15 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Apr 2021 21:46:15 +0000 Subject: [issue43719] Master build failure on Windows getting file system encoding In-Reply-To: <1617480948.24.0.651940029044.issue43719@roundup.psfhosted.org> Message-ID: <1617486375.98.0.534419759373.issue43719@roundup.psfhosted.org> Terry J. Reedy added the comment: Re ""f:\dev\3x\PC\validate_ucrtbase.py" ucrtbased" exited with co de -1073741819." f:\dev\3x>py -3.10 PC\validate_ucrtbase.py ucrtbased C:\WINDOWS\SYSTEM32\ucrtbased.DLL is version 10.0.14393.33 so the failure is due to running the file with the nonfunctional python_d.exe. In a text editor, encodings/__init__.py looks fine. f:\dev\3x>py -3.10 f:\dev\3x\\lib\encodings\__init__.py (to check text further) fails at line 33 from . import alias In any case, line 31 is 'import codecs'. codecs.py looks fine and f:\dev\3x>py -3.10 f:\dev\3x\\lib\codecs.py runs without error, so its text appears to be intact. Perhaps one of the imports of compiled C fail drastically. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 17:47:39 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Apr 2021 21:47:39 +0000 Subject: [issue41969] ttk.RadioButtons mis-sized under Windows 10 UI Scaling, with dpiAware set true In-Reply-To: <1602090157.47.0.836989772149.issue41969@roundup.psfhosted.org> Message-ID: <1617486459.94.0.290159951944.issue41969@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 18:10:37 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 03 Apr 2021 22:10:37 +0000 Subject: [issue43325] Documentation should warn that 'is' is not a safe comparison operator for most values. In-Reply-To: <1614294680.42.0.115546489096.issue43325@roundup.psfhosted.org> Message-ID: <1617487837.26.0.0475917578747.issue43325@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +23909 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25168 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 18:20:22 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Apr 2021 22:20:22 +0000 Subject: [issue43679] ttk.Sizegrip disappears under Windows 10 UI Scaling, with dpiAware set true and >1 scaling In-Reply-To: <1617193566.44.0.678288943132.issue43679@roundup.psfhosted.org> Message-ID: <1617488422.08.0.41546405206.issue43679@roundup.psfhosted.org> Terry J. Reedy added the comment: In issue 33656, we determined that tcl/tk *is* dpi aware and that telling Windows so is needed for proper text display. IDLE now issues the same Windows command (idlelib.pyshell, line 20). This perhaps should be done by Python itself, but that is not my department. In any case, without the setting, text in IDLE Windows is much uglier on my 27 inch 2560 x 1440 screen. IDLE Windows do not currently have sizegrips. This seems to be standard on Windows. One can resize by grabbing the bottom of the lower right corner. But it is a bit finicky. When I run your code, I see the small, faint, sizegrip. Perhaps my screen is not HiDpi enough to see the problem. In any case, this is a tcl/tk issue. Perhaps upgrading to 8.6.11 (#43652) will help, as it is supposed to for the radiobutton issue. ---------- nosy: +serhiy.storchaka, terry.reedy resolution: -> third party stage: -> resolved status: open -> closed versions: +Python 3.10 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 18:26:07 2021 From: report at bugs.python.org (Brett Cannon) Date: Sat, 03 Apr 2021 22:26:07 +0000 Subject: [issue2135] Restructure import.c into PEP 302 importer objects In-Reply-To: <1203289879.4.0.29225339307.issue2135@psf.upfronthosting.co.za> Message-ID: <1617488767.84.0.713584324454.issue2135@roundup.psfhosted.org> Change by Brett Cannon : ---------- pull_requests: +23910 pull_request: https://github.com/python/cpython/pull/25169 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 18:31:21 2021 From: report at bugs.python.org (Brett Cannon) Date: Sat, 03 Apr 2021 22:31:21 +0000 Subject: [issue43720] Document various preexisting stdlib deprecations related to import for removal in Python 3.12 In-Reply-To: <1617482708.53.0.134596819215.issue43720@roundup.psfhosted.org> Message-ID: <1617489081.92.0.0293264732707.issue43720@roundup.psfhosted.org> Brett Cannon added the comment: New changeset dc6d3e1e4c0c1e4b2210edab8fb4762569dc2936 by Brett Cannon in branch 'master': bpo-43720: Update import-related stdlib deprecation messages to say they will be removed in Python 3.12 (GH-25167) https://github.com/python/cpython/commit/dc6d3e1e4c0c1e4b2210edab8fb4762569dc2936 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 18:31:33 2021 From: report at bugs.python.org (Brett Cannon) Date: Sat, 03 Apr 2021 22:31:33 +0000 Subject: [issue43720] Document various preexisting stdlib deprecations related to import for removal in Python 3.12 In-Reply-To: <1617482708.53.0.134596819215.issue43720@roundup.psfhosted.org> Message-ID: <1617489093.21.0.713457036971.issue43720@roundup.psfhosted.org> Change by Brett Cannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 18:48:43 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Apr 2021 22:48:43 +0000 Subject: [issue43652] Upgrade Windows tcl/tk to 8.6.11 In-Reply-To: <1617001631.71.0.115330422511.issue43652@roundup.psfhosted.org> Message-ID: <1617490123.59.0.24564466319.issue43652@roundup.psfhosted.org> Terry J. Reedy added the comment: Did you use revision 0, and in 8.6.11.0, or a later one? As I mentioned in #43719, I cannot currently build master, but I will upload a PR (with .0) for CI to test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 18:58:51 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Apr 2021 22:58:51 +0000 Subject: [issue43652] Upgrade Windows tcl/tk to 8.6.11 In-Reply-To: <1617001631.71.0.115330422511.issue43652@roundup.psfhosted.org> Message-ID: <1617490731.06.0.780333263403.issue43652@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +23911 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25170 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 19:04:53 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Apr 2021 23:04:53 +0000 Subject: [issue43652] Upgrade Windows tcl/tk to 8.6.11 In-Reply-To: <1617001631.71.0.115330422511.issue43652@roundup.psfhosted.org> Message-ID: <1617491093.94.0.119391997178.issue43652@roundup.psfhosted.org> Terry J. Reedy added the comment: The upgrade to 8.6.10 broke a Scale test. The fix for that in #41306 conv = False if get_tk_patchlevel() >= (8, 6, 10) else float_round should still work unless there was a further Scale change. ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 19:10:19 2021 From: report at bugs.python.org (Antony Lee) Date: Sat, 03 Apr 2021 23:10:19 +0000 Subject: [issue43721] Documentation of property.{getter, setter, deleter} fails to mention that a *new* property is returned Message-ID: <1617491419.64.0.547160681333.issue43721@roundup.psfhosted.org> New submission from Antony Lee : property.{getter,setter,deleter} returns a new property with a new {fget,fset,fdel}. This is documented at https://docs.python.org/3/library/functions.html#property, and intended behavior (see e.g. https://bugs.python.org/issue1620). However the corresponding docstrings, e.g. `pydoc property.getter`, are "Descriptor to change the getter (setter, deleter) on a property." This wording suggests that no copy is being made and that the property is mutated in-place. ---------- assignee: docs at python components: Documentation messages: 390149 nosy: Antony.Lee, docs at python priority: normal severity: normal status: open title: Documentation of property.{getter,setter,deleter} fails to mention that a *new* property is returned _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 19:14:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Apr 2021 23:14:21 +0000 Subject: [issue43719] Master build failure on Windows getting file system encoding In-Reply-To: <1617480948.24.0.651940029044.issue43719@roundup.psfhosted.org> Message-ID: <1617491661.88.0.985917946452.issue43719@roundup.psfhosted.org> STINNER Victor added the comment: IMO it's https://bugs.python.org/issue27129#msg389991 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 19:15:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Apr 2021 23:15:31 +0000 Subject: [issue27129] Wordcode, part 2 In-Reply-To: <1464268387.83.0.862540030058.issue27129@psf.upfronthosting.co.za> Message-ID: <1617491731.21.0.644295811679.issue27129@roundup.psfhosted.org> STINNER Victor added the comment: > New changeset fcb55c0037baab6f98f91ee38ce84b6f874f034a by Mark Shannon in branch 'master': > bpo-27129: Use instruction offsets, not byte offsets, in bytecode and internally. (GH-25069) This change broke buildbots, please revert it to repair buildbots. More and more people are affected: https://bugs.python.org/issue43719 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 19:24:12 2021 From: report at bugs.python.org (David Bolen) Date: Sat, 03 Apr 2021 23:24:12 +0000 Subject: [issue27129] Wordcode, part 2 In-Reply-To: <1464268387.83.0.862540030058.issue27129@psf.upfronthosting.co.za> Message-ID: <1617492252.37.0.547497212479.issue27129@roundup.psfhosted.org> David Bolen added the comment: I don't think reverting the commit at this point would necessarily be helpful. While it might fix some systems, it could newly break anyone who happened to do their first build since the commit was in place. I didn't want to bug anyone over the weekend, but I've got a PR as part of issue #43709 that I believe would fix this going forward, if anyone with access might have an opportunity to review it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 19:30:09 2021 From: report at bugs.python.org (David Bolen) Date: Sat, 03 Apr 2021 23:30:09 +0000 Subject: [issue43719] Master build failure on Windows getting file system encoding In-Reply-To: <1617480948.24.0.651940029044.issue43719@roundup.psfhosted.org> Message-ID: <1617492609.14.0.452826675422.issue43719@roundup.psfhosted.org> David Bolen added the comment: Terry, it's not clear to me if this is the same issue (at first blush it appears different) but could you see if you have any pyc files in __pycache__ folders within the Tools or Parser directories in your tree that could be from prior builds? If so, remove them and try a new build? The build.bat script's clean process is not currently cleaning them up, which can lead to various oddities if you reuse a source tree across the commit Victor references, as that invalidates the older files but they aren't regenerated. ---------- nosy: +db3l _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 19:34:31 2021 From: report at bugs.python.org (Inada Naoki) Date: Sat, 03 Apr 2021 23:34:31 +0000 Subject: [issue41139] cgi uses the locale encoding for log files In-Reply-To: <1593257405.62.0.0746372218017.issue41139@roundup.psfhosted.org> Message-ID: <1617492871.37.0.324798180409.issue41139@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 19:44:32 2021 From: report at bugs.python.org (Inada Naoki) Date: Sat, 03 Apr 2021 23:44:32 +0000 Subject: [issue41139] cgi uses the locale encoding for log files In-Reply-To: <1593257405.62.0.0746372218017.issue41139@roundup.psfhosted.org> Message-ID: <1617493472.14.0.227354394352.issue41139@roundup.psfhosted.org> Inada Naoki added the comment: +1 for removing. But let's emit DeprecationWarning for now, and remove it later. ---------- components: +Library (Lib) versions: -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 19:46:01 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 03 Apr 2021 23:46:01 +0000 Subject: [issue43719] Master build failure on Windows getting file system encoding In-Reply-To: <1617480948.24.0.651940029044.issue43719@roundup.psfhosted.org> Message-ID: <1617493561.93.0.395702931884.issue43719@roundup.psfhosted.org> Dennis Sweeney added the comment: I ran into the same issue on Windows 10 and git bisected it to the same first bad commit, fcb55c0037baab6f98f91ee38ce84b6f874f034a The issue persists after rm .\Parser\__pycache__\* My .\Tools directory has no __pycache__. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 19:51:05 2021 From: report at bugs.python.org (David Bolen) Date: Sat, 03 Apr 2021 23:51:05 +0000 Subject: [issue43719] Master build failure on Windows getting file system encoding In-Reply-To: <1617480948.24.0.651940029044.issue43719@roundup.psfhosted.org> Message-ID: <1617493865.88.0.151810515677.issue43719@roundup.psfhosted.org> David Bolen added the comment: Dennis, just to make sure I wasn't too literal, some of the __pycache__ folders are in subdirectories (at least in Tools), so just to double check, you did a recursive search beneath Tools and Parser right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 19:58:02 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 03 Apr 2021 23:58:02 +0000 Subject: [issue27129] Wordcode, part 2 In-Reply-To: <1464268387.83.0.862540030058.issue27129@psf.upfronthosting.co.za> Message-ID: <1617494282.68.0.0185182623384.issue27129@roundup.psfhosted.org> Dennis Sweeney added the comment: I notice this in _bootstrap_external.py: the magic number did not get changed, only the comment: # Python 3.10a2 3433 (RERAISE restores f_lasti if oparg != 0) # Python 3.10a6 3434 (PEP 634: Structural Pattern Matching) # Python 3.10a7 3435 Use instruction offsets (as opposed to byte offsets). # # MAGIC must change whenever the bytecode emitted by the compiler may no # longer be understood by older implementations of the eval loop (usually # due to the addition of new opcodes). # # Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array # in PC/launcher.c must also be updated. MAGIC_NUMBER = (3434).to_bytes(2, 'little') + b'\r\n' _RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 20:01:33 2021 From: report at bugs.python.org (Inada Naoki) Date: Sun, 04 Apr 2021 00:01:33 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617494493.26.0.236104477776.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 35715d1e72b7e15e337087863c75af447199e0fb by Inada Naoki in branch 'master': bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25145) https://github.com/python/cpython/commit/35715d1e72b7e15e337087863c75af447199e0fb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 20:08:17 2021 From: report at bugs.python.org (Inada Naoki) Date: Sun, 04 Apr 2021 00:08:17 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617494897.07.0.608985965919.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +23912 pull_request: https://github.com/python/cpython/pull/25171 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 20:16:06 2021 From: report at bugs.python.org (Skip Montanaro) Date: Sun, 04 Apr 2021 00:16:06 +0000 Subject: [issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384) In-Reply-To: <1593075260.88.0.835474638855.issue41111@roundup.psfhosted.org> Message-ID: <1617495366.72.0.524108916359.issue41111@roundup.psfhosted.org> Skip Montanaro added the comment: The latest commit seems to break the build if configured --with-trace-refs. ---------- nosy: +skip.montanaro _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 20:21:58 2021 From: report at bugs.python.org (Inada Naoki) Date: Sun, 04 Apr 2021 00:21:58 +0000 Subject: [issue43722] PEP 597: FileCookieJar uses locale encoding Message-ID: <1617495718.2.0.60661799695.issue43722@roundup.psfhosted.org> New submission from Inada Naoki : During fixing EncodingWarning in stdlibs, I found FileCookieJar, LWPCookieJar, and MozillaCookieJar use locale encoding for cookie files. I don't know much about cookie file format. If locale encoding is right encoding, we can just use `encoding="locale"` since Python 3.10. Or cookie files should be encoded in UTF-8, or latin-1? ---------- components: Library (Lib) messages: 390160 nosy: methane priority: normal severity: normal status: open title: PEP 597: FileCookieJar uses locale encoding versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 20:22:24 2021 From: report at bugs.python.org (Skip Montanaro) Date: Sun, 04 Apr 2021 00:22:24 +0000 Subject: [issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384) In-Reply-To: <1593075260.88.0.835474638855.issue41111@roundup.psfhosted.org> Message-ID: <1617495744.2.0.101755091713.issue41111@roundup.psfhosted.org> Skip Montanaro added the comment: I should revise that comment. The xxlimited and xxlimited_35 modules fail to build. That seems suboptimal, but perhaps is to be expected. Perhaps it would be better that compiling them not be attempted with configuring --with-trace-refs? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 20:27:28 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Apr 2021 00:27:28 +0000 Subject: [issue43721] Documentation of property.{getter, setter, deleter} fails to mention that a *new* property is returned In-Reply-To: <1617491419.64.0.547160681333.issue43721@roundup.psfhosted.org> Message-ID: <1617496048.71.0.580722401826.issue43721@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 20:29:35 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 04 Apr 2021 00:29:35 +0000 Subject: [issue27129] Wordcode, part 2 In-Reply-To: <1464268387.83.0.862540030058.issue27129@psf.upfronthosting.co.za> Message-ID: <1617496175.07.0.484092223143.issue27129@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- pull_requests: +23913 pull_request: https://github.com/python/cpython/pull/25172 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 20:31:57 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Apr 2021 00:31:57 +0000 Subject: [issue43721] Documentation of property.{getter, setter, deleter} fails to mention that a *new* property is returned In-Reply-To: <1617491419.64.0.547160681333.issue43721@roundup.psfhosted.org> Message-ID: <1617496317.75.0.983483146454.issue43721@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: rhettinger -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 20:33:20 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 04 Apr 2021 00:33:20 +0000 Subject: [issue43719] Master build failure on Windows getting file system encoding In-Reply-To: <1617480948.24.0.651940029044.issue43719@roundup.psfhosted.org> Message-ID: <1617496400.69.0.583686666245.issue43719@roundup.psfhosted.org> Dennis Sweeney added the comment: I could not successfully build even with deletion of __pycache__ in subfolders. I finally got the build to succeed after changing the magic number, so I opened GH-25069. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 20:34:06 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 04 Apr 2021 00:34:06 +0000 Subject: [issue43719] Master build failure on Windows getting file system encoding In-Reply-To: <1617480948.24.0.651940029044.issue43719@roundup.psfhosted.org> Message-ID: <1617496446.69.0.988319714184.issue43719@roundup.psfhosted.org> Dennis Sweeney added the comment: Correction: I opened GH-25172 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 20:51:07 2021 From: report at bugs.python.org (David Bolen) Date: Sun, 04 Apr 2021 00:51:07 +0000 Subject: [issue43709] Windows Tools\buildbot\clean.bat misses some needed pyc/pyo removal In-Reply-To: <1617397003.07.0.230481208149.issue43709@roundup.psfhosted.org> Message-ID: <1617497467.27.0.802342145966.issue43709@roundup.psfhosted.org> David Bolen added the comment: Based on further information in issue #27129 as well as issue #43719 it appears a source of the problem prompting this fix was a failure to update the magic number in the original commit for #27129. The windows clean script does still leave more artifacts than, for example, the Unix Makefile, but it shouldn't have resulted in a problem if the magic number had changed, and it's not clear it has to change after all. So this issue can probably be closed once that is corrected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 20:52:34 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Apr 2021 00:52:34 +0000 Subject: [issue43340] json.load() can raise UnicodeDecodeError, but this is not documented In-Reply-To: <1614450261.52.0.147425024304.issue43340@roundup.psfhosted.org> Message-ID: <1617497554.77.0.58974767041.issue43340@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +23914 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25173 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 21:01:50 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 04 Apr 2021 01:01:50 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py Message-ID: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> New submission from Jelle Zijlstra : Followup from issue37804: deprecate the remaining camelCase aliases, such as threading.currentThread. PR coming soon. ---------- assignee: Jelle Zijlstra components: Library (Lib) messages: 390165 nosy: Jelle Zijlstra, pitrou priority: normal severity: normal status: open title: Deprecate camelCase aliases from threading.py versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 21:08:40 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 04 Apr 2021 01:08:40 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1617498520.26.0.189381509055.issue43723@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- keywords: +patch pull_requests: +23915 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25174 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 21:08:40 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 04 Apr 2021 01:08:40 +0000 Subject: [issue37804] Remove Thread.isAlive in Python 3.9 In-Reply-To: <1565364852.41.0.891047152339.issue37804@roundup.psfhosted.org> Message-ID: <1617498520.52.0.0927916186201.issue37804@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- pull_requests: +23916 pull_request: https://github.com/python/cpython/pull/25174 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 21:24:34 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Apr 2021 01:24:34 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1617499474.36.0.860960976643.issue43723@roundup.psfhosted.org> Raymond Hettinger added the comment: I don't think there is any advantage in doing this. It will just break code that has worked for a very long time. This is the reason that the logging module wasn't changed to more modern naming conventions. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 21:45:40 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Apr 2021 01:45:40 +0000 Subject: [issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong) In-Reply-To: <1391441802.61.0.557224247712.issue20503@psf.upfronthosting.co.za> Message-ID: <1617500740.23.0.889637203448.issue20503@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +23917 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25175 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 22:14:08 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 04 Apr 2021 02:14:08 +0000 Subject: [issue43719] Master build failure on Windows getting file system encoding In-Reply-To: <1617480948.24.0.651940029044.issue43719@roundup.psfhosted.org> Message-ID: <1617502448.08.0.72492151378.issue43719@roundup.psfhosted.org> Terry J. Reedy added the comment: Thanks everyone for the rapid responses. The PR fixes the build for me, with a clean test suite pass, so I added reviewers who could merge, a blurb, and my approval. This can be closed as out-of-date as soon as the (or a) fix is merged. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 22:14:27 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 04 Apr 2021 02:14:27 +0000 Subject: [issue43719] Master build failure on Windows getting file system encoding In-Reply-To: <1617480948.24.0.651940029044.issue43719@roundup.psfhosted.org> Message-ID: <1617502467.58.0.491097938349.issue43719@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- priority: normal -> critical _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 22:20:53 2021 From: report at bugs.python.org (Ateeq Sharfuddin) Date: Sun, 04 Apr 2021 02:20:53 +0000 Subject: [issue34816] raise AttributeError if loading fails in ctypes.LibraryLoader.__getattr__ In-Reply-To: <1538032457.9.0.545547206417.issue34816@psf.upfronthosting.co.za> Message-ID: <1617502853.98.0.309634252426.issue34816@roundup.psfhosted.org> Change by Ateeq Sharfuddin : ---------- keywords: +patch nosy: +ateeq nosy_count: 2.0 -> 3.0 pull_requests: +23918 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/25177 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 22:29:42 2021 From: report at bugs.python.org (Ateeq Sharfuddin) Date: Sun, 04 Apr 2021 02:29:42 +0000 Subject: [issue34816] raise AttributeError if loading fails in ctypes.LibraryLoader.__getattr__ In-Reply-To: <1538032457.9.0.545547206417.issue34816@psf.upfronthosting.co.za> Message-ID: <1617503382.57.0.0731062768071.issue34816@roundup.psfhosted.org> Ateeq Sharfuddin added the comment: First patch fixing only the issue at hand on master. LibraryLoader now catches OSError for FileNotFoundError and raises AttributeError. ---------- Added file: https://bugs.python.org/file49932/34816.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 22:34:59 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Apr 2021 02:34:59 +0000 Subject: [issue27129] Wordcode, part 2 In-Reply-To: <1464268387.83.0.862540030058.issue27129@psf.upfronthosting.co.za> Message-ID: <1617503699.63.0.401093007124.issue27129@roundup.psfhosted.org> Change by Ned Deily : ---------- priority: normal -> release blocker versions: +Python 3.10 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 22:35:59 2021 From: report at bugs.python.org (Alexander Grigoriev) Date: Sun, 04 Apr 2021 02:35:59 +0000 Subject: [issue43714] re.split(), re.sub(): '\Z' must consume end of string if it matched In-Reply-To: <1617454993.35.0.466919552737.issue43714@roundup.psfhosted.org> Message-ID: <1617503759.56.0.31102824184.issue43714@roundup.psfhosted.org> Alexander Grigoriev added the comment: For example, sed: $ sed --version sed (GNU sed) 4.8 Copyright (C) 2020 Free Software Foundation, Inc. $ sed -e 's/-\?$/x/g' <<<'a-b-' a-bx Perl: $ perl --version This is perl 5, version 32, subversion 0 (v5.32.0) built for x86_64-msys-thread-multi Copyright 1987-2020, Larry Wall $ perl -e 'my $x="a-b-"; $x =~ s/-?$/x/g; print $x' a-bxx https://www.freeformatter.com/java-regex-tester.html Java Regular Expression : -?$ Entry to test against : a-b-c- String replacement result: a-b-cx During replacement or split, a match consumes the matched character. It's easy to forget that "end of line" should be considered a (pseudo)character and must also be consumed if it matched. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 22:51:14 2021 From: report at bugs.python.org (Allen) Date: Sun, 04 Apr 2021 02:51:14 +0000 Subject: [issue43724] cannot compute sizeof (long double) Message-ID: <1617504674.05.0.0692778789598.issue43724@roundup.psfhosted.org> Change by Allen : ---------- files: config.log nosy: allenlili priority: normal severity: normal status: open title: cannot compute sizeof (long double) type: compile error versions: Python 3.9 Added file: https://bugs.python.org/file49933/config.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 22:54:54 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Apr 2021 02:54:54 +0000 Subject: [issue43325] Documentation should warn that 'is' is not a safe comparison operator for most values. In-Reply-To: <1614294680.42.0.115546489096.issue43325@roundup.psfhosted.org> Message-ID: <1617504894.9.0.142206273247.issue43325@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset f8775e4f72240faba3947eea8efdd83ee56ae1fd by Raymond Hettinger in branch 'master': bpo-43325: Add FAQ entry for identity tests (GH-25168) https://github.com/python/cpython/commit/f8775e4f72240faba3947eea8efdd83ee56ae1fd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 22:54:57 2021 From: report at bugs.python.org (Allen) Date: Sun, 04 Apr 2021 02:54:57 +0000 Subject: [issue43724] macOS cannot compute sizeof (long double) Message-ID: <1617504897.02.0.00571148024849.issue43724@roundup.psfhosted.org> Change by Allen : ---------- title: cannot compute sizeof (long double) -> macOS cannot compute sizeof (long double) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 22:55:11 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Apr 2021 02:55:11 +0000 Subject: [issue43325] Documentation should warn that 'is' is not a safe comparison operator for most values. In-Reply-To: <1614294680.42.0.115546489096.issue43325@roundup.psfhosted.org> Message-ID: <1617504911.52.0.216095559637.issue43325@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +23919 pull_request: https://github.com/python/cpython/pull/25178 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 23:05:59 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Apr 2021 03:05:59 +0000 Subject: [issue43325] Documentation should warn that 'is' is not a safe comparison operator for most values. In-Reply-To: <1614294680.42.0.115546489096.issue43325@roundup.psfhosted.org> Message-ID: <1617505559.68.0.26031878941.issue43325@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset de0b2b133011953b02536cc78f2499d5d55224f8 by Miss Islington (bot) in branch '3.9': bpo-43325: Add FAQ entry for identity tests (GH-25168) (GH-25178) https://github.com/python/cpython/commit/de0b2b133011953b02536cc78f2499d5d55224f8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 3 23:06:15 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Apr 2021 03:06:15 +0000 Subject: [issue43325] Documentation should warn that 'is' is not a safe comparison operator for most values. In-Reply-To: <1614294680.42.0.115546489096.issue43325@roundup.psfhosted.org> Message-ID: <1617505575.65.0.0452325462853.issue43325@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 00:17:53 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 04 Apr 2021 04:17:53 +0000 Subject: [issue43710] Access violations in C extension modules on Python 3.9.3 In-Reply-To: <1617419380.7.0.273976800885.issue43710@roundup.psfhosted.org> Message-ID: <1617509873.85.0.943959783651.issue43710@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- nosy: +gregory.p.smith nosy_count: 7.0 -> 8.0 pull_requests: +23920 pull_request: https://github.com/python/cpython/pull/25179 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 00:17:54 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 04 Apr 2021 04:17:54 +0000 Subject: [issue42500] crash with unbounded recursion in except statement In-Reply-To: <1606635563.54.0.549807759752.issue42500@roundup.psfhosted.org> Message-ID: <1617509874.0.0.0362662001073.issue42500@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- nosy: +gregory.p.smith nosy_count: 7.0 -> 8.0 pull_requests: +23921 pull_request: https://github.com/python/cpython/pull/25179 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 00:19:30 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 04 Apr 2021 04:19:30 +0000 Subject: [issue43710] Access violations in C extension modules on Python 3.9.3 In-Reply-To: <1617419380.7.0.273976800885.issue43710@roundup.psfhosted.org> Message-ID: <1617509970.84.0.469324949251.issue43710@roundup.psfhosted.org> Gregory P. Smith added the comment: I really suggest a simple rollback (revert) of the change rather than a redo-fix for 3.9.4. Unless you like the idea of a possible 3.9.5 if the redo-fix itself has issues that haven't been given due thought in the rush to undo the 3.9.3 mistake. This leaves more time for a proper fix of bpo-42500 in 3.9 not crafted under duress. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 00:35:13 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 04 Apr 2021 04:35:13 +0000 Subject: [issue43725] Create a release branch ABI stability regression test Message-ID: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> New submission from Gregory P. Smith : In order to automate prevention of ABI regressions in stable releases, we could create an automated ABI stability test generator and check the specific ABI test it generates into each specific release branch. I'm envisioning the main branch only having a code generator that creates such a test, and the release branches only having the output of that as Lib/tests/release_X_Y_ABI_stability_test.py and a policy of never updating that within a release branch without *extreme* attention to detail. Such updates wouldn't happen by default in our current workflow as they're unique and versioned in every release branch so automated backport PRs wouldn't touch them - leaving CI to run them and highlight failures on attempted backports to do inadvertently cause an ABI shift. ---------- components: Build, C API, Interpreter Core, Tests messages: 390173 nosy: gregory.p.smith priority: normal severity: normal stage: needs patch status: open title: Create a release branch ABI stability regression test type: enhancement versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 00:44:41 2021 From: report at bugs.python.org (Chad Netzer) Date: Sun, 04 Apr 2021 04:44:41 +0000 Subject: [issue43574] Regression in overallocation for literal list initialization in v3.9+ In-Reply-To: <1616293914.75.0.599644741052.issue43574@roundup.psfhosted.org> Message-ID: <1617511481.74.0.465113047244.issue43574@roundup.psfhosted.org> Chad Netzer added the comment: For bpo-43574, my initial plan was to change list_resize() so that it wouldn't overallocate empty lists that were resized to be bigger, thus restoring the overallocation behavior for list-literals to be like that of earlier Python releases. However, the list_resize() helper is also used by list appends and inserts, as well as other list methods that change list sizes. This proposed strategy of not-overallocating any resize that starts with an empty list also affects their behavior, and with the list-overallocation calculation that was introduced with bpo-38373, this causes unexpected side-effects on the amount of overallocation used for appending/inserting with an empty list. Therefore, my updated proposal handles this by changing the overallocation behavior in list_resize() only when empty lists are increased by an amount greater than 1 during list_resize(). This basically retains the behavior of not overallocating list-literals, while not changing the behavior for list append/insert on an empty list. To understand why this updated proposed change won't also cause overallocation for length-1 literals, see below how length-1 and length-2 list-literals are compiled using BUILD_LIST instead of LIST_EXTEND: ``` Python 3.9.2 (default, Mar 26 2021, 23:27:12) >>> import dis >>> def foo(): ... [1] ... >>> dis.dis(foo) 2 0 LOAD_CONST 1 (1) 2 BUILD_LIST 1 4 POP_TOP 6 LOAD_CONST 0 (None) 8 RETURN_VALUE >>> def bar(): ... [1,2] ... >>> dis.dis(bar) 2 0 LOAD_CONST 1 (1) 2 LOAD_CONST 2 (2) 4 BUILD_LIST 2 6 POP_TOP 8 LOAD_CONST 0 (None) 10 RETURN_VALUE >>> def baz(): ... [1,2,3] ... >>> dis.dis(baz) 2 0 BUILD_LIST 0 2 LOAD_CONST 1 ((1, 2, 3)) 4 LIST_EXTEND 1 6 POP_TOP 8 LOAD_CONST 0 (None) 10 RETURN_VALUE ``` Hence, the change to list_resize(), which is called by list_extend() but not the BUILD_LIST opcode, won't impact list-literals of length 1 and 2. And to show how the originally proposed change (no overallocation for list_resize() of empty lists) inadvertently changed how list append/insert overallocation worked, let's first take a look at how current Python (3.9+) works: ``` >>> l = [] >>> l.__sizeof__() 40 >>> l.append("a") # First append will overallocate to capacity 4 >>> l.__sizeof__() 72 >>> l.append("b") >>> l.__sizeof__() 72 >>> l.append("c") >>> l.__sizeof__() 72 >>> l.append("d") >>> l.__sizeof__() 72 >>> l.append("e") >>> l.__sizeof__() 104 >>> l2 = ["a"] # Length 1 (and 2) literals don't overallocate >>> l2.__sizeof__() 48 >>> # However, note that the first append will overallocate to capacity 8 >>> l2.append("b") >>> l2.__sizeof__() 104 ``` Note that the list-literal of length 1 isn't overallocated, and that appending to it skips the capacity 4 list and goes straight to capacity 8. However, with my originally proposed change, this overallocation behavior is duplicated even for lists that start empty, because the first append then effectively becomes a non-overallocated list of length and capacity 1, which means that the second append overallocates to capacity 8. Here was the overallocation behavior of my first proposal, when an empty list was appended: ``` Python 3.10.0a6+ (heads/bpo43574-dont-overallocate-list-literals:7436223a71, Apr 3 2021, 16:32:22) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin >>> l = [] >>> l.__sizeof__() 40 >>> l.append("a") >>> l.__sizeof__() # No overallocation on first append 48 >>> l.append("b") >>> l.__sizeof__() # Second append jumps to capacity 8, skipping 4 104 ``` This is unexpected and likely undesirable behavior, as lists being created empty and then appended to should be expected to follow the same documented 4, 8, 16, 24, ... growth pattern for bpo-38373. Fixing this is fairly simple because of the special-casing for length 1 and 2 list-literals, just by checking for the use of append/insert on an empty list. Because they both change the size of a length 0 list to length 1, and the list_resize() for literals always kicks in for changing to lengths 3 or more, this updates proposal will retain the current empty-list insert/append overallocation behavior, while still allowing list-literals of length 1 or more to not overallocate. With this updated proposal, avoiding a change to the behavior of an empty list append/insert, the overallocation for list-literals is still removed, and the current overallocation behavior for empty lists being appended is preserved: ``` Python 3.10.0a6+ (heads/bpo43574-dont-overallocate-list-literals-v2:56b361221d, Apr 3 2021, 17:35) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin >>> l = [] >>> l.__sizeof__() 40 >>> l.append("a") >>> l.__sizeof__() 72 >>> l.append("b") >>> l.__sizeof__() 72 >>> l2 = ["a"] >>> l2.__sizeof__() 48 >>> l2 = ["a", "b", "c"] # list_extend() literal setup case starts w/ 3 elements >>> l2.__sizeof__() 64 ``` So, with this variant on my original proposal, using the current compilation behavior of setting up list-literals of length 3 or greater using list_extend(), we regain the previous Python behavior of not overallocating list-literals, and we also retain the current overallocation behavior for empty lists that are appended to. Just to document it, here are the functions in Objects/listobject.c that are impacted by a change in list_resize(), and the proposed bpo-43574 change in particular: ins1() # insert 1 element in list, including empty list. app1() # append 1 element to list. Same impact as with ins1() list_ass_slice() # can assign a sequence to a list slice, expanding list list_inplace_repeat() # No impact, early exit for len == 0 list_extend() # Now used for list-literals of len > 2 list_pop() # No impact, same behavior for list becoming len == 0 list_ass_subscript() # No impact, list_resize() only called for deletion The list_ass_slice() case is changed by this update, for an empty list, as overallocation will not occur on the first list_extend() with more than 1 element (ie. just like list-literals, the overallocation will be delayed until a future list_resize()). Here's an example of the change, first for current Python 3.9+ behavior: ``` Python 3.9.2 (default, Mar 26 2021, 23:27:12) >>> l = [] >>> l.__sizeof__() 40 >>> l[:] = ["a"] >>> l.__sizeof__() 72 >>> l = [] >>> l[:] = ["a", "b"] >>> l.__sizeof__() 104 >>> l.append("c") >>> l.__sizeof__() 104 ``` and the behavior with my revised proposal for non-overallocation of list-literals: ``` Python 3.10.0a6+ (heads/bpo43574-dont-overallocate-list-literals-v2:56b361221d, Apr 3 2021, 17:35) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin >>> l = [] >>> l.__sizeof__() 40 >>> l[:] = ["a"] >>> l.__sizeof__() 72 >>> l = [] >>> l[:] = ["a", "b"] >>> l.__sizeof__() 56 >>> l.append("c") >>> l.__sizeof__() 104 ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 03:52:01 2021 From: report at bugs.python.org (David Ellsworth) Date: Sun, 04 Apr 2021 07:52:01 +0000 Subject: [issue43726] regex module fails with a quantified backref but succeeds with repeated backref Message-ID: <1617522721.12.0.340315705312.issue43726@roundup.psfhosted.org> New submission from David Ellsworth : The regex /^((x*)\2{3}(?=\2$))*x$/ matches powers of 5 in unary, expressed as strings of "x" characters whose length is the number. The following command line should print "1", but prints nothing: python -c 'import regex; regex.match(r"^((x*)\2{3}(?=\2$))*x$", "x"*125) and print(1)' However, this command does print "1": python -c 'import regex; regex.match(r"^((x*)\2\2\2(?=\2$))*x$", "x"*125) and print(1)' And so does this one: python -c 'import re; re.match(r"^((x*)\2{3}(?=\2$))*x$", "x"*125) and print(1)' The expression "\2\2\2" should behave exactly the same as "\2{3}", but in the "regex" module it does not. Solving the following Code Golf Stack Exchange challenge is what led me to discover this bug: https://codegolf.stackexchange.com/questions/211840/is-that-number-a-two-bit-number%ef%b8%8f/222792#222792 ---------- components: Regular Expressions messages: 390175 nosy: Davidebyzero, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: regex module fails with a quantified backref but succeeds with repeated backref type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 04:01:35 2021 From: report at bugs.python.org (Inada Naoki) Date: Sun, 04 Apr 2021 08:01:35 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617523295.09.0.721274070762.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 3caea9adda7f79ab5d4c5a1905ca62b44e0b3b7b by Inada Naoki in branch 'master': bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25171) https://github.com/python/cpython/commit/3caea9adda7f79ab5d4c5a1905ca62b44e0b3b7b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 04:17:58 2021 From: report at bugs.python.org (Patrick Reader) Date: Sun, 04 Apr 2021 08:17:58 +0000 Subject: [issue43726] regex module fails with a quantified backref but succeeds with repeated backref In-Reply-To: <1617522721.12.0.340315705312.issue43726@roundup.psfhosted.org> Message-ID: <1617524278.23.0.53826803242.issue43726@roundup.psfhosted.org> Patrick Reader added the comment: The `regex` module is a third-party package, not part of the Python standard library. Please report issues here: https://bitbucket.org/mrabarnett/mrab-regex/issues ---------- nosy: +pxeger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 04:31:06 2021 From: report at bugs.python.org (hai shi) Date: Sun, 04 Apr 2021 08:31:06 +0000 Subject: [issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384) In-Reply-To: <1593075260.88.0.835474638855.issue41111@roundup.psfhosted.org> Message-ID: <1617525066.15.0.773688780322.issue41111@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +23922 pull_request: https://github.com/python/cpython/pull/25180 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 04:33:31 2021 From: report at bugs.python.org (Mark Shannon) Date: Sun, 04 Apr 2021 08:33:31 +0000 Subject: [issue27129] Wordcode, part 2 In-Reply-To: <1464268387.83.0.862540030058.issue27129@psf.upfronthosting.co.za> Message-ID: <1617525211.36.0.37231053404.issue27129@roundup.psfhosted.org> Mark Shannon added the comment: New changeset c368ce74d2c9bcbf1ec320466819c2d4768252f7 by Dennis Sweeney in branch 'master': bpo-27129: Update magic numbers and bootstrapping for GH-25069 (GH-25172) https://github.com/python/cpython/commit/c368ce74d2c9bcbf1ec320466819c2d4768252f7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 04:33:46 2021 From: report at bugs.python.org (hai shi) Date: Sun, 04 Apr 2021 08:33:46 +0000 Subject: [issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384) In-Reply-To: <1593075260.88.0.835474638855.issue41111@roundup.psfhosted.org> Message-ID: <1617525226.6.0.72407090935.issue41111@roundup.psfhosted.org> hai shi added the comment: > Perhaps it would be better that compiling them not be attempted with configuring --with-trace-refs? +1. The limited C API can't be build under Py_TRACE_REFS now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 04:41:07 2021 From: report at bugs.python.org (Inada Naoki) Date: Sun, 04 Apr 2021 08:41:07 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617525667.19.0.1731954398.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +23923 pull_request: https://github.com/python/cpython/pull/25181 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 04:49:36 2021 From: report at bugs.python.org (David Ellsworth) Date: Sun, 04 Apr 2021 08:49:36 +0000 Subject: [issue43726] regex module fails with a quantified backref but succeeds with repeated backref In-Reply-To: <1617522721.12.0.340315705312.issue43726@roundup.psfhosted.org> Message-ID: <1617526176.45.0.615271957559.issue43726@roundup.psfhosted.org> David Ellsworth added the comment: Thanks, I didn't realize. I thought it was an official module that wasn't included as part of the main package due to being unfinished. Reported the bug here: https://bitbucket.org/mrabarnett/mrab-regex/issues/408/regex-fails-with-a-quantified ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 07:02:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 04 Apr 2021 11:02:51 +0000 Subject: [issue42500] crash with unbounded recursion in except statement In-Reply-To: <1606635563.54.0.549807759752.issue42500@roundup.psfhosted.org> Message-ID: <1617534171.12.0.465459699529.issue42500@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c7b0feca25fc68ec3e0884b82e5f45a4da011e8e by Gregory P. Smith in branch '3.9': [3.9] bpo-43710: Rollback the 3.9 bpo-42500 fix, it broke the ABI in 3.9.3 (#25179) https://github.com/python/cpython/commit/c7b0feca25fc68ec3e0884b82e5f45a4da011e8e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 07:02:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 04 Apr 2021 11:02:51 +0000 Subject: [issue43710] Access violations in C extension modules on Python 3.9.3 In-Reply-To: <1617419380.7.0.273976800885.issue43710@roundup.psfhosted.org> Message-ID: <1617534171.0.0.0828878760783.issue43710@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c7b0feca25fc68ec3e0884b82e5f45a4da011e8e by Gregory P. Smith in branch '3.9': [3.9] bpo-43710: Rollback the 3.9 bpo-42500 fix, it broke the ABI in 3.9.3 (#25179) https://github.com/python/cpython/commit/c7b0feca25fc68ec3e0884b82e5f45a4da011e8e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 07:03:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 04 Apr 2021 11:03:35 +0000 Subject: [issue43710] Access violations in C extension modules on Python 3.9.3 In-Reply-To: <1617419380.7.0.273976800885.issue43710@roundup.psfhosted.org> Message-ID: <1617534215.84.0.355655039987.issue43710@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 07:46:53 2021 From: report at bugs.python.org (Ned Batchelder) Date: Sun, 04 Apr 2021 11:46:53 +0000 Subject: [issue42823] Incorrect frame.f_lineno when frame.f_trace is set In-Reply-To: <1609777965.06.0.667792191004.issue42823@roundup.psfhosted.org> Message-ID: <1617536813.41.0.552526498904.issue42823@roundup.psfhosted.org> Change by Ned Batchelder : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 07:59:46 2021 From: report at bugs.python.org (bbh) Date: Sun, 04 Apr 2021 11:59:46 +0000 Subject: [issue43727] futures cancelled by ThreadPoolExecutor.shutdown() not yielded by as_completed() Message-ID: <1617537586.46.0.369484002323.issue43727@roundup.psfhosted.org> New submission from bbh : concurrent.futures.ThreadPoolExecutor.shutdown(cancel_futures=True) cancels the pending futures, but the futures remain in the state CANCELLED and never get to the state CANCELLED_AND_NOTIFIED. Thus they are never yielded by concurrent.futures.as_completed(). If I use shutdown(cancel_futures=True) in a loop of as_completed(), the loop will never finish and the program hangs. Not even Ctrl-C works. If I use concurrent.futures.Future.cancel() on all pending futures in the loop, everything works as expected. ---------- components: Library (Lib) messages: 390183 nosy: bigbenhur priority: normal severity: normal status: open title: futures cancelled by ThreadPoolExecutor.shutdown() not yielded by as_completed() type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 08:24:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Apr 2021 12:24:32 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617539072.29.0.85322443151.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This is probably complementary or in the avenue of https://www.python.org/dev/peps/pep-0652/ ---------- nosy: +pablogsal, petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 08:28:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Apr 2021 12:28:02 +0000 Subject: [issue43719] Master build failure on Windows getting file system encoding In-Reply-To: <1617480948.24.0.651940029044.issue43719@roundup.psfhosted.org> Message-ID: <1617539282.1.0.302063779018.issue43719@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Fixed by https://github.com/python/cpython/pull/25172 ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 08:39:07 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Apr 2021 12:39:07 +0000 Subject: [issue24160] Pdb sometimes raises exception when trying to remove a breakpoint defined in a different debugger session In-Reply-To: <1431275416.99.0.134014878289.issue24160@psf.upfronthosting.co.za> Message-ID: <1617539947.21.0.338323708741.issue24160@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately PR21989 has breaking the refleaks buildbots. Example: https://buildbot.python.org/all/#/builders/320/builds/226/steps/5/logs/stdio To reproduce: ? ./python -m test test_pdb -R 3:3 0:00:00 load avg: 1.40 Run tests sequentially 0:00:00 load avg: 1.40 [1/1] test_pdb beginning 6 repetitions 123456 .test test_pdb failed -- Traceback (most recent call last): File "/home/pablogsal/github/cpython/Lib/doctest.py", line 2205, in runTest raise self.failureException(self.format_failure(new.getvalue())) AssertionError: Failed doctest test for test.test_pdb.test_pdb_breakpoints_preserved_across_interactive_sessions File "/home/pablogsal/github/cpython/Lib/test/test_pdb.py", line 326, in test_pdb_breakpoints_preserved_across_interactive_sessions ---------------------------------------------------------------------- File "/home/pablogsal/github/cpython/Lib/test/test_pdb.py", line 330, in test.test_pdb.test_pdb_breakpoints_preserved_across_interactive_sessions Failed example: with PdbTestInput([ # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE 'import test.test_pdb', 'break test.test_pdb.do_something', 'break test.test_pdb.do_nothing', 'break', 'continue', ]): pdb.run('print()') Expected: > (1)() (Pdb) import test.test_pdb (Pdb) break test.test_pdb.do_something Breakpoint 1 at ...test_pdb.py:... (Pdb) break test.test_pdb.do_nothing Breakpoint 2 at ...test_pdb.py:... (Pdb) break Num Type Disp Enb Where 1 breakpoint keep yes at ...test_pdb.py:... 2 breakpoint keep yes at ...test_pdb.py:... (Pdb) continue Got: > (1)()->None (Pdb) import test.test_pdb (Pdb) break test.test_pdb.do_something Breakpoint 1 at /home/pablogsal/github/cpython/Lib/test/test_pdb.py:396 (Pdb) break test.test_pdb.do_nothing Breakpoint 2 at /home/pablogsal/github/cpython/Lib/test/test_pdb.py:393 (Pdb) break Num Type Disp Enb Where 1 breakpoint keep yes at /home/pablogsal/github/cpython/Lib/test/test_pdb.py:396 2 breakpoint keep yes at /home/pablogsal/github/cpython/Lib/test/test_pdb.py:393 (Pdb) continue ---------------------------------------------------------------------- File "/home/pablogsal/github/cpython/Lib/test/test_pdb.py", line 350, in test.test_pdb.test_pdb_breakpoints_preserved_across_interactive_sessions Failed example: with PdbTestInput([ # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE 'break', 'break pdb.find_function', 'break', 'clear 1', 'continue', ]): pdb.run('print()') Expected: > (1)() (Pdb) break Num Type Disp Enb Where 2 breakpoint keep yes at ...test_pdb.py:... 3 breakpoint keep yes at ...pdb.py:... (Pdb) clear 2 Deleted breakpoint 2 at ...test_pdb.py:... (Pdb) clear 3 Deleted breakpoint 3 at ...pdb.py:... (Pdb) continue Got: > (1)()->None (Pdb) break Num Type Disp Enb Where 2 breakpoint keep yes at /home/pablogsal/github/cpython/Lib/test/test_pdb.py:393 3 breakpoint keep yes at /home/pablogsal/github/cpython/Lib/pdb.py:94 (Pdb) clear 2 Deleted breakpoint 2 at /home/pablogsal/github/cpython/Lib/test/test_pdb.py:393 (Pdb) clear 3 Deleted breakpoint 3 at /home/pablogsal/github/cpython/Lib/pdb.py:94 (Pdb) continue test_pdb failed == Tests result: FAILURE == 1 test failed: test_pdb Total duration: 2.8 sec Tests result: FAILURE ---------- nosy: +pablogsal resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 08:40:04 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Apr 2021 12:40:04 +0000 Subject: [issue24160] Pdb sometimes raises exception when trying to remove a breakpoint defined in a different debugger session In-Reply-To: <1431275416.99.0.134014878289.issue24160@psf.upfronthosting.co.za> Message-ID: <1617540004.79.0.482369659316.issue24160@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Per our buildbot policy (https://discuss.python.org/t/policy-to-revert-commits-on-buildbot-failure/404) we will need to revert this in 24 hours if is not fixed to avoid masking future errors. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 08:46:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Apr 2021 12:46:04 +0000 Subject: [issue24160] Pdb sometimes raises exception when trying to remove a breakpoint defined in a different debugger session In-Reply-To: <1431275416.99.0.134014878289.issue24160@psf.upfronthosting.co.za> Message-ID: <1617540364.28.0.861074948207.issue24160@roundup.psfhosted.org> Irit Katriel added the comment: Thanks, I'm looking. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 09:35:58 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Apr 2021 13:35:58 +0000 Subject: [issue24160] Pdb sometimes raises exception when trying to remove a breakpoint defined in a different debugger session In-Reply-To: <1431275416.99.0.134014878289.issue24160@psf.upfronthosting.co.za> Message-ID: <1617543358.21.0.69370155068.issue24160@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +23924 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/25182 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 09:37:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Apr 2021 13:37:18 +0000 Subject: [issue24160] Pdb sometimes raises exception when trying to remove a breakpoint defined in a different debugger session In-Reply-To: <1431275416.99.0.134014878289.issue24160@psf.upfronthosting.co.za> Message-ID: <1617543438.15.0.649241988813.issue24160@roundup.psfhosted.org> Irit Katriel added the comment: With the patch: PS C:\Users\User\src\cpython-dev> ./python -m test test_pdb -R 3:3 Running Debug|x64 interpreter... 0:00:00 Run tests sequentially 0:00:00 [1/1] test_pdb beginning 6 repetitions 123456 ...... == Tests result: SUCCESS == 1 test OK. Total duration: 34.2 sec Tests result: SUCCESS ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 10:33:26 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sun, 04 Apr 2021 14:33:26 +0000 Subject: [issue20626] Manager documentation unclear about lists and thread safeness In-Reply-To: <1392389766.44.0.393784619009.issue20626@psf.upfronthosting.co.za> Message-ID: <1617546806.06.0.0167298290084.issue20626@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: 1. A link was added in commit 86a76684269f940a20366cb42668f1acb0982dca 2. The Programming Guidelines mentions thread safety of proxies: https://docs.python.org/3/library/multiprocessing.html#programming-guidelines Can this be closed? ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 10:43:24 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 04 Apr 2021 14:43:24 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1617547404.88.0.971158642957.issue41370@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj nosy_count: 7.0 -> 8.0 pull_requests: +23925 pull_request: https://github.com/python/cpython/pull/25183 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 11:02:33 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Apr 2021 15:02:33 +0000 Subject: [issue41570] Add DearPyGui to faq/gui.rst Message-ID: <1617548553.97.0.220115465559.issue41570@roundup.psfhosted.org> New submission from Irit Katriel : Jonathan, I see you closed the PR. Did you intend to close this issue as well? ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 11:04:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Apr 2021 15:04:59 +0000 Subject: [issue24160] Pdb sometimes raises exception when trying to remove a breakpoint defined in a different debugger session In-Reply-To: <1431275416.99.0.134014878289.issue24160@psf.upfronthosting.co.za> Message-ID: <1617548699.7.0.958315706989.issue24160@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset aadd4e10fda87b64ea527667238503da326a06e7 by Irit Katriel in branch 'master': bpo-24160: Fix test_pdb refleaks failure (GH-25182) https://github.com/python/cpython/commit/aadd4e10fda87b64ea527667238503da326a06e7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 11:05:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Apr 2021 15:05:35 +0000 Subject: [issue24160] Pdb sometimes raises exception when trying to remove a breakpoint defined in a different debugger session In-Reply-To: <1431275416.99.0.134014878289.issue24160@psf.upfronthosting.co.za> Message-ID: <1617548735.18.0.341091824224.issue24160@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: PR 25182 fixes the issue, so I am closing this again. Thanks for the quick fix, Irit! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 11:14:55 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 04 Apr 2021 15:14:55 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1617549295.8.0.307273658197.issue41370@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 2b5913b4ee5852a28ca1509478f5582beb3aff7b by Ken Jin in branch 'master': bpo-41370: Add note about ForwardRefs and PEP585 generic types in docs (#25183) https://github.com/python/cpython/commit/2b5913b4ee5852a28ca1509478f5582beb3aff7b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 11:14:59 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Apr 2021 15:14:59 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1617549299.45.0.0104123176385.issue41370@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +23926 pull_request: https://github.com/python/cpython/pull/25184 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 11:17:03 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 04 Apr 2021 15:17:03 +0000 Subject: [issue43728] Change the exception type and message raised when _curses is not found. Message-ID: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> New submission from Shreyan Avigyan : When importing the curses module, be it on Windows or Darwin or UNIX-based OS or any other platform, if the _curses module is not found then just a ModuleNotFoundError is raised. But this error is not very informational in case of _curses module. Since the curses module is packaged with the Python interpreter itself at first it may seem, to beginners especially, that the Python interpreter was not installed correctly and then they would go searching for an answer for about 4-5 days. We know that curses library is not installed on windows by default and may or may not be present on other operating systems. Most UNIX system have ncurses or other curses library installed by default. Python errors have a reputation of being very informational. I would like to submit a PR to modify the curses module a little bit by declaring a BaseException class and raising that Exception with the message "_curses module not found. Make sure a curses library is installed" or some kind of message like that. But before I do that I would like to take advice from experienced developers about somethings. Is this change in the exception, raised when _curses module is not found, acceptable by the Python Community? If it is then should a draft PEP be submitted or should a PR be directly submitted to python/cpython? ---------- components: Library (Lib) messages: 390195 nosy: shreyanavigyan priority: normal severity: normal status: open title: Change the exception type and message raised when _curses is not found. type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 11:36:33 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Apr 2021 15:36:33 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1617550593.02.0.826060578081.issue41370@roundup.psfhosted.org> miss-islington added the comment: New changeset d56bcf915b8d5a6afe4555cb6813c8210824e751 by Miss Islington (bot) in branch '3.9': [3.9] bpo-41370: Add note about ForwardRefs and PEP585 generic types in docs (GH-25183) (GH-25184) https://github.com/python/cpython/commit/d56bcf915b8d5a6afe4555cb6813c8210824e751 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 11:57:51 2021 From: report at bugs.python.org (Steve Newcomb) Date: Sun, 04 Apr 2021 15:57:51 +0000 Subject: [issue43704] ShareableList() raises TypeError when passing "name" keyword In-Reply-To: <1617380901.37.0.319201562014.issue43704@roundup.psfhosted.org> Message-ID: <1617551871.81.0.666711155841.issue43704@roundup.psfhosted.org> Steve Newcomb added the comment: The documentation, which needs some improvement, I think. I'll suggest some improvements when I understand things a little better. For the record, it turned out that SharedMemoryManager was irrelevant, as were sockets. That makes sense since memory can't be shared across a network, but the doc nevertheless implies that the socket interface is available. I don't see why. ShareableList is a class in shared_memory.py and is a function name, despite its capitalization, in managers.py, with a different signature. That's massively confusing in combination with the foregoing. In retrospect, I should have started by paying most of my attention to the documentation's numpy example, even though numpy is irrelevant to my problem and the example was more work to sort through than the other, simpler examples. With all that resolved in my mind, I immediately ran aground on https://bugs.python.org/issue38119. In that discussion, Guido notes that [automatic] garbage collection is hard, and I would add that automatic garbage collection is especially hard to deal with when it's not wanted. I'm attaching the script I wrote in order to satisfy myself that turicas's monkeypatch (see issue38119) allows me to create a standing block of shared memory and to unlink it only when I want to. ---------- resolution: -> not a bug Added file: https://bugs.python.org/file49934/5.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 12:06:28 2021 From: report at bugs.python.org (Steve Newcomb) Date: Sun, 04 Apr 2021 16:06:28 +0000 Subject: [issue38119] resource tracker destroys shared memory segments when other processes should still have valid access In-Reply-To: <1568217506.85.0.770661201111.issue38119@roundup.psfhosted.org> Message-ID: <1617552388.36.0.209351649072.issue38119@roundup.psfhosted.org> Steve Newcomb added the comment: Sometimes a leak is exactly what's wanted, i.e. a standing block of shared memory that allows sharing processes come and go ad libitum. I mention this because I haven't seen anyone mention it explicitly. While turicas's monkeypatch covers the use case in which a manually-named block of shared memory is intended to remain indefinitely, it would be best if future versions of shared_memory allowed for such a use case, too. It shouldn't be necessary to monkeypatch in order to have a standing block of shared memory remain ready and waiting even when nobody's using it. ---------- nosy: +steve.newcomb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 12:14:02 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Apr 2021 16:14:02 +0000 Subject: [issue43724] macOS cannot compute sizeof (long double) Message-ID: <1617552842.31.0.0797170032008.issue43724@roundup.psfhosted.org> New submission from Ned Deily : >From the config.log you supplied, it looks the macOS system you are running on was upgraded to the current latest version, 11.2.3, but the Command Line Tools were not. It seems that with recent macOS releases, you often need to do that manually for each bugfix release. Try: xcode-select --install If successful, you should see currently: cc --version Apple clang version 12.0.0 (clang-1200.0.32.29) ---------- nosy: +ned.deily resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 12:30:33 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Apr 2021 16:30:33 +0000 Subject: [issue43724] macOS cannot compute sizeof (long double) In-Reply-To: <1617552842.31.0.0797170032008.issue43724@roundup.psfhosted.org> Message-ID: <1617553833.08.0.425714284384.issue43724@roundup.psfhosted.org> Ned Deily added the comment: P.S. Also check System Preferences -> Software Update for any updates to the Command Line Tools. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 12:51:22 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 04 Apr 2021 16:51:22 +0000 Subject: [issue42128] Structural Pattern Matching (PEP 634) In-Reply-To: <1603466540.96.0.7677855399.issue42128@roundup.psfhosted.org> Message-ID: <1617555082.37.0.1272327393.issue42128@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +23927 pull_request: https://github.com/python/cpython/pull/25185 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 12:55:33 2021 From: report at bugs.python.org (Roundup Robot) Date: Sun, 04 Apr 2021 16:55:33 +0000 Subject: [issue24275] lookdict_* give up too soon In-Reply-To: <1432444109.96.0.971324850141.issue24275@psf.upfronthosting.co.za> Message-ID: <1617555333.5.0.288785592868.issue24275@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 7.0 -> 8.0 pull_requests: +23928 pull_request: https://github.com/python/cpython/pull/25186 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 13:16:58 2021 From: report at bugs.python.org (David Bolen) Date: Sun, 04 Apr 2021 17:16:58 +0000 Subject: [issue43709] Windows Tools\buildbot\clean.bat misses some needed pyc/pyo removal In-Reply-To: <1617397003.07.0.230481208149.issue43709@roundup.psfhosted.org> Message-ID: <1617556618.89.0.741035848829.issue43709@roundup.psfhosted.org> David Bolen added the comment: No longer needed after commit c368ce74d2c9bcbf1ec320466819c2d4768252f7 ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 13:32:50 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 04 Apr 2021 17:32:50 +0000 Subject: [issue38794] Setup: support linking openssl statically In-Reply-To: <1573734613.61.0.712380405287.issue38794@roundup.psfhosted.org> Message-ID: <1617557570.49.0.632929369671.issue38794@roundup.psfhosted.org> Christian Heimes added the comment: Lukas, no, some guy called Bill approached me at our last Illuminati meeting in Hollow Earth. He asked me to implement static linking for his next-gen secret brain chip. In exchange for the favor I was allowed to ride his T-Rex. True story! Thanks, William! :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 13:38:00 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 04 Apr 2021 17:38:00 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617557880.15.0.136350057927.issue43725@roundup.psfhosted.org> Gregory P. Smith added the comment: Indeed. In particular given the 3.9.3 issue I was assuming such a test should include asserting both the sizeof() ABI structs and offsetof() public members of all ABI structs. On each specific first class supported platform. This goes beyond what https://www.python.org/dev/peps/pep-0652/#testing-the-stable-abi currently states to check size and layout rather than just symbol presence. But seems to match the intent. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 13:53:48 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Apr 2021 17:53:48 +0000 Subject: [issue43655] Tkinter: Not setting _NET_WM_WINDOW_TYPE on FileDialog In-Reply-To: <1617008023.65.0.620967294098.issue43655@roundup.psfhosted.org> Message-ID: <1617558828.86.0.0576546362853.issue43655@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +23929 pull_request: https://github.com/python/cpython/pull/25187 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 14:04:05 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Apr 2021 18:04:05 +0000 Subject: [issue43655] Tkinter: Not setting _NET_WM_WINDOW_TYPE on FileDialog In-Reply-To: <1617008023.65.0.620967294098.issue43655@roundup.psfhosted.org> Message-ID: <1617559445.1.0.380516016992.issue43655@roundup.psfhosted.org> Serhiy Storchaka added the comment: PR 25187 makes all Tkinter dialog windows and most IDLE dialog windows (except about and help windows) be recognized as dialogs by window managers on macOS and X Window. It conforms the behavior of standard Tk dialog windows. This change is harmless enough to be backported. ---------- assignee: -> terry.reedy components: +IDLE nosy: +taleinat, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 14:15:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Apr 2021 18:15:32 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617560132.6.0.407674657794.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: We could have a buildbot using https://github.com/lvc/abi-compliance-checker ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 14:17:33 2021 From: report at bugs.python.org (Tim Peters) Date: Sun, 04 Apr 2021 18:17:33 +0000 Subject: [issue43593] pymalloc is not aware of Memory Tagging Extension (MTE) and crashes In-Reply-To: <1616419787.13.0.506382582675.issue43593@roundup.psfhosted.org> Message-ID: <1617560253.33.0.654751713453.issue43593@roundup.psfhosted.org> Tim Peters added the comment: I think it's time to change what address_in_range() tries to answer. It currently gives a precise answer to "is this byte address in a region obmalloc owns?". But that's stronger than what it needs to do its job: the real question is "is this an address that obmalloc could return from its malloc() or realloc() functions?". Because it's only used by free() and realloc(), and they only care where the address they're _passed_ came from. The difference is when an arena is not pool-aligned. Oddball chunks outside of full pools, at both ends of the arena, are never returned by obmalloc then. Instead the tree could be changed to record the starting addresses of the _full_ pools obmalloc controls. Those contain the only addresses obmalloc will ever pass out (from malloc() or realloc()). Like so, where p is the arena base address. This hasn't been tested, and may contain typos or logical errors. I'm far more interested in the latter for now ;-) ideal1 = p & ~ARENA_SIZE_MASK # round down to ideal ideal2 = ideal1 + ARENA_SIZE offset = p - ideal1 b1 = bottom_node(ideal1) b2 = bottom_node(ideal2) if not offset: # already ideal b1.hi = -1 assert b2.lo == 0 elif offset & POOL_SIZE_MASK == 0: # arena is pool-aligned b1.hi = b2.lo = offset else: # Not pool-aligned. # obmalloc won't pass out an address higher than in # the last full pool. # Round offset down to next lower pool address. offset &= ~POOL_SIZE_MASK b2.lo = offset # And won't pass out an address lower than in the # first full pool. offset += POOL_SIZE # same as rounding original offset up # That's almost right for b1.hi, but one exception: if # offset is ARENA_SIZE now, the first full pool is at the # start of ideal2, and no feasible address is in ideal1. assert offset <= ARENA_SIZE b1.hi = offset & ARENA_SIZE_MASK Note that, except for the oddball -1, everything stored in a bottom node is a pool address then, and so there's no need to store their all-zero lowest POOL_BITS bits. .lo and .hi can be shrunk to a signed 8-bit int with the current settings (20 arena bits and 14 pool bits). And caching pool addresses wouldn't have any obscure failing end-cases either: address_in_range() could just as well be passed a pool address to begin with. It would only care about pool addresses, not byte addresses. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 14:19:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Apr 2021 18:19:02 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617560342.01.0.596660235737.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: For example, the tool generates this report for the two 3.9 versions (attached to the issue). ---------- Added file: https://bugs.python.org/file49935/compat_report.html _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 14:35:54 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Apr 2021 18:35:54 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617561354.29.0.338327768001.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Also, we can use libabigail. For instance: root at 7a3947dec3d8:/pytho# abidiff Python-3.9.2/python Python-3.9.3/python Functions changes summary: 0 Removed, 3 Changed (53 filtered out), 0 Added functions Variables changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added variable 3 functions with some indirect sub-type change: [C]'function void PyEval_AcquireThread(PyThreadState*)' at ceval.c:381:1 has some indirect sub-type changes: parameter 1 of type 'PyThreadState*' has sub-type changes: in pointed to type 'typedef PyThreadState' at pystate.h:20:1: underlying type 'struct _ts' at pystate.h:51:1 changed: type size hasn't changed 4 data member changes (2 filtered): 'char _ts::recursion_critical' offset changed from 296 to 320 (in bits) (by +24 bits) 'int _ts::stackcheck_counter' offset changed from 320 to 352 (in bits) (by +32 bits) 'int _ts::tracing' offset changed from 352 to 384 (in bits) (by +32 bits) 'int _ts::use_tracing' offset changed from 384 to 416 (in bits) (by +32 bits) 1 data member change: type of 'char _ts::overflowed' changed: type name changed from 'char' to 'int' type size changed from 8 to 32 (in bits) and name of '_ts::overflowed' changed to '_ts::recursion_headroom' at pystate.h:61:1 [C]'function int _PyErr_CheckSignalsTstate(PyThreadState*)' at signalmodule.c:1684:1 has some indirect sub-type changes: parameter 1 of type 'PyThreadState*' has sub-type changes: in pointed to type 'typedef PyThreadState' at pystate.h:20:1: underlying type 'struct _ts' at pystate.h:51:1 changed: type size hasn't changed no data member changes (6 filtered); no data member change (1 filtered); [C]'function void _PyErr_Clear(PyThreadState*)' at errors.c:426:1 has some indirect sub-type changes: parameter 1 of type 'PyThreadState*' has sub-type changes: in pointed to type 'typedef PyThreadState' at pystate.h:20:1: underlying type 'struct _ts' at pystate.h:51:1 changed: type size hasn't changed no data member changes (6 filtered); no data member change (1 filtered); ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 15:24:31 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 04 Apr 2021 19:24:31 +0000 Subject: [issue43655] Tkinter: make X window & macOS recognize dialogs as such In-Reply-To: <1617008023.65.0.620967294098.issue43655@roundup.psfhosted.org> Message-ID: <1617564271.98.0.252488591962.issue43655@roundup.psfhosted.org> Terry J. Reedy added the comment: Epaine (or Tal?): please test PR-25187 on Mac. ---------- nosy: +epaine title: Tkinter: Not setting _NET_WM_WINDOW_TYPE on FileDialog -> Tkinter: make X window & macOS recognize dialogs as such _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 16:08:48 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 04 Apr 2021 20:08:48 +0000 Subject: [issue43655] Tkinter: make X window & macOS recognize dialogs as such In-Reply-To: <1617008023.65.0.620967294098.issue43655@roundup.psfhosted.org> Message-ID: <1617566928.43.0.893801988608.issue43655@roundup.psfhosted.org> Terry J. Reedy added the comment: I presume 'floatable' means 'can move dialog around on top of the parent window'. On my Mac Air, with 3.8 and 8.6.8, all the dialogs I checked, including About, are already floatable in this sense, not just the search boxes (which already had "::tk::unsupported::MacWindowsStyle" call). Since tk::unsupported is not listed on https://www.tcl.tk/man/tcl8.6/TkCmd/contents.htm, (nor on the 8.5 page) I wonder if it is obsolete, or just hidden. If no one knows, we might ask Kevin Walzer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 16:33:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Apr 2021 20:33:14 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617568394.02.0.297481608254.issue43725@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +23930 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25188 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 16:39:47 2021 From: report at bugs.python.org (Bartosz) Date: Sun, 04 Apr 2021 20:39:47 +0000 Subject: [issue41974] Remove complex.__float__, complex.__floordiv__, etc In-Reply-To: <1602140125.13.0.506221233573.issue41974@roundup.psfhosted.org> Message-ID: <1617568787.04.0.887117192409.issue41974@roundup.psfhosted.org> Bartosz added the comment: The docs for this should probably be updated to reflect the change: https://docs.python.org/3/library/typing.html#typing.runtime_checkable ---------- nosy: +DevilXD _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 17:07:05 2021 From: report at bugs.python.org (Christoph Gohlke) Date: Sun, 04 Apr 2021 21:07:05 +0000 Subject: [issue43710] Access violations in C extension modules on Python 3.9.3 In-Reply-To: <1617419380.7.0.273976800885.issue43710@roundup.psfhosted.org> Message-ID: <1617570425.28.0.811457145378.issue43710@roundup.psfhosted.org> Christoph Gohlke added the comment: Thank you for fixing this issue so fast! Python 3.9.4 works well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 17:11:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Apr 2021 21:11:30 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617570690.27.0.228867092504.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ok, so seems that PR25188 works if the abi dump file for the "correct" version is generated with the same compiler that is used to check the ABI. I think this is acceptable if the workflow is: - As soon as a version is released, we generate in the stable release branch the dump using some docker container with the same compiler as the GitHub CI. - We enable the ABI check only for release branches. - We should make the check mandatory because release managers cannot be checking all backport PRs unfortunately. We make the changes for 3.8 and 3.9 for the time being. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 17:13:06 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Apr 2021 21:13:06 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617570786.08.0.850981322493.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Adding the rest of RM to evaluate the proposed solution ---------- nosy: +lukasz.langa, ned.deily, steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 17:17:39 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Apr 2021 21:17:39 +0000 Subject: [issue43655] Tkinter: make X window & macOS recognize dialogs as such In-Reply-To: <1617008023.65.0.620967294098.issue43655@roundup.psfhosted.org> Message-ID: <1617571059.39.0.112886748547.issue43655@roundup.psfhosted.org> Serhiy Storchaka added the comment: See https://wiki.tcl-lang.org/page/MacWindowStyle . I suppose it affects window decoration. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 17:26:52 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 04 Apr 2021 21:26:52 +0000 Subject: [issue43655] Tkinter: make X window & macOS recognize dialogs as such In-Reply-To: <1617008023.65.0.620967294098.issue43655@roundup.psfhosted.org> Message-ID: <1617571612.12.0.58915430423.issue43655@roundup.psfhosted.org> Terry J. Reedy added the comment: Excuse me, it is the query boxes, not the search boxes, that already have the call. Unlike the other boxes I initially tested, they do not have the traffic lights. I believe that this, not movability, is the effect on mac of 'movableModal'. I tested a messagebox and it also had no traffic lights. What effect does the change have on Linux? On my MacBook, IDLE preferences is too tall, so that the bottom buttons are not visible and the only way to reliably cancel is to click the red button on the title bar. So remove the change for that at least until we have redesigned the dialog to be wide instead of tall. There is also an IDLE issue questioning whether Preferences (and Search) should even be modal. Currently, IDLE file open and save-as drop down from the center of title bar, have no traffic lights, and cannot be moved. Open is the entire width of the screen and could only go up and down. For Open, the underlying window is moved to the center. For Safari, Save as is the same, so I question whether it should be changed. Safari's Open is movable. Neither window for either app currently has traffic lights. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 19:44:25 2021 From: report at bugs.python.org (Thomas Cavalli) Date: Sun, 04 Apr 2021 23:44:25 +0000 Subject: [issue43729] Tutorial Documentation for 3.1.1. Numbers missing "result" Message-ID: <1617579865.45.0.541169648182.issue43729@roundup.psfhosted.org> New submission from Thomas Cavalli : The Division (/) section example uses the commented variable "result" without it being defined. I am counting 4 numbers, (5.6667, 5, 2, 17), that are called result. The correct result can be implied but its poor documentation. So, either change: >>> 17 // 3 # floor division discards the fractional part to >>> result = 17 // 3 # floor division discards the fractional part or change: >>> 5 * 3 + 2 # result * divisor + remainder to >>> 5 * 3 + 2 # floor * divisor + remainder I suggest the latter as it explains the formula for floor. ---------- assignee: docs at python components: Documentation messages: 390217 nosy: docs at python, thomaspcavalli priority: normal severity: normal status: open title: Tutorial Documentation for 3.1.1. Numbers missing "result" type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 20:59:54 2021 From: report at bugs.python.org (Thomas Cavalli) Date: Mon, 05 Apr 2021 00:59:54 +0000 Subject: [issue43730] Tutorial Documentation for 4.7.3.2. Positional-Only Parameters, no "/" ques Message-ID: <1617584394.44.0.298702006886.issue43730@roundup.psfhosted.org> Change by Thomas Cavalli : ---------- nosy: thomaspcavalli priority: normal severity: normal status: open title: Tutorial Documentation for 4.7.3.2. Positional-Only Parameters, no "/" ques _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 21:11:04 2021 From: report at bugs.python.org (Thomas Cavalli) Date: Mon, 05 Apr 2021 01:11:04 +0000 Subject: [issue43730] Tutorial Documentation for 4.7.3.2. Positional-Only Parameters, no "/" ques Message-ID: <1617585064.51.0.708805253102.issue43730@roundup.psfhosted.org> New submission from Thomas Cavalli : The last sentence of this section seems wrong to me: "If there is no / in the function definition, there are no positional-only parameters." Should this better be: "If there is no / in the function definition, there are only positional-only parameters." Reading further down does not seem to me to clarify this question. ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python type: -> enhancement versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 21:12:34 2021 From: report at bugs.python.org (Thomas Cavalli) Date: Mon, 05 Apr 2021 01:12:34 +0000 Subject: [issue43730] Tutorial Documentation for 4.7.3.2. Positional-Only Parameters, no "/" question In-Reply-To: <1617585064.51.0.708805253102.issue43730@roundup.psfhosted.org> Message-ID: <1617585154.09.0.54712841751.issue43730@roundup.psfhosted.org> Change by Thomas Cavalli : ---------- title: Tutorial Documentation for 4.7.3.2. Positional-Only Parameters, no "/" ques -> Tutorial Documentation for 4.7.3.2. Positional-Only Parameters, no "/" question _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 21:13:36 2021 From: report at bugs.python.org (Thomas Cavalli) Date: Mon, 05 Apr 2021 01:13:36 +0000 Subject: [issue43730] Tutorial Documentation for 4.7.3.2. Positional-Only Parameters, no "/" question? In-Reply-To: <1617585064.51.0.708805253102.issue43730@roundup.psfhosted.org> Message-ID: <1617585216.28.0.997094416341.issue43730@roundup.psfhosted.org> Change by Thomas Cavalli : ---------- title: Tutorial Documentation for 4.7.3.2. Positional-Only Parameters, no "/" question -> Tutorial Documentation for 4.7.3.2. Positional-Only Parameters, no "/" question? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 23:12:44 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 05 Apr 2021 03:12:44 +0000 Subject: [issue41974] Remove complex.__float__, complex.__floordiv__, etc In-Reply-To: <1602140125.13.0.506221233573.issue41974@roundup.psfhosted.org> Message-ID: <1617592364.72.0.611517919764.issue41974@roundup.psfhosted.org> Guido van Rossum added the comment: Indeed, Bartosz. Do you think you can help by submitting a PR for the docs? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 23:30:21 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 05 Apr 2021 03:30:21 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617593421.0.0.130059149085.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset de522a89e42a35da9275169b113460c3581e32d7 by Inada Naoki in branch 'master': bpo-43651: PEP 597: Fix test_email (GH-25158) https://github.com/python/cpython/commit/de522a89e42a35da9275169b113460c3581e32d7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 4 23:32:42 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 05 Apr 2021 03:32:42 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617593562.19.0.0214470168124.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset ee952b5c7355cb64179ca9bb77b13e7738132d3d by Inada Naoki in branch 'master': bpo-43651: PEP 597: Fix EncodingWarning in test_filecmp (GH-25159) https://github.com/python/cpython/commit/ee952b5c7355cb64179ca9bb77b13e7738132d3d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 00:11:37 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 05 Apr 2021 04:11:37 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617595897.83.0.877312523379.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset c8e5eb904e12010d2302364e1037c24a30f5e241 by Inada Naoki in branch 'master': bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25181) https://github.com/python/cpython/commit/c8e5eb904e12010d2302364e1037c24a30f5e241 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 00:23:08 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 05 Apr 2021 04:23:08 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617596588.65.0.515686757597.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +23931 pull_request: https://github.com/python/cpython/pull/25189 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 00:29:28 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 05 Apr 2021 04:29:28 +0000 Subject: [issue43731] PEP 597: logging.basicConfig() uses locale encoding. Message-ID: <1617596968.06.0.267322224871.issue43731@roundup.psfhosted.org> New submission from Inada Naoki : logging.basicConfig() uses locale encoding when reading config file. We need to add `encoding=None` parameter and `encoding=io.text_encoding(encoding)` in it. ---------- components: Library (Lib) messages: 390223 nosy: methane priority: normal severity: normal status: open title: PEP 597: logging.basicConfig() uses locale encoding. versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 00:59:27 2021 From: report at bugs.python.org (Thomas Wamm) Date: Mon, 05 Apr 2021 04:59:27 +0000 Subject: [issue43511] tkinter with Tk 8.6.11 is slow on macOS In-Reply-To: <1615875194.4.0.35991043769.issue43511@roundup.psfhosted.org> Message-ID: <1617598767.68.0.0554075182437.issue43511@roundup.psfhosted.org> Thomas Wamm added the comment: I have forked my TerraLunar graphics program to make a simpler more portable version, called "TerraLunar-tkbench.py" to facilitate testing of the tkinter stack for graphics performance. The project folder is at: https://github.com/ThomasWamm/TerraLunar-tkbench.git The folder includes results and commentary from running the program on numerous platforms (MacOS, Windows10, Raspberry OS Linux) and Python versions. Here are the most interesting summary results: ------------------------------------------------------------------------ Apple M1 Mac Mini MacOS 11.2.3 (arm64 Apple Silicon, or Rosetta2 x86_64) Python 3.8.2 Tcl/Tk 8.5.9 TerraLunar-tkbench 0.1.8 runtime = 37 (arm64) Python 3.8.7 Tcl/Tk 8.6.8 TerraLunar-tkbench 0.1.8 runtime = 69 (x86_64) Python 3.9.2 Tcl/Tk 8.6.8 TerraLunar-tkbench 0.1.8 runtime = 69 (x86_64) * Python 3.10.0a6 Tcl/Tk 8.6.11 TerraLunar-tkbench 0.1.8 runtime = 421 (arm64) * * Why is Tcl/Tk 8.6.11 on arm64 so slow? old iMac24-2007 MacOS 10.11.6 on 2.4 GHz Intel Core 2 Duo (x86_64) Python 3.7.3 Tcl/Tk 8.6.8 TerraLunar-tkbench 0.1.8 runtime = 381 Python 3.8.2 Tcl/Tk 8.6.8 TerraLunar-tkbench 0.1.8 runtime = 377 Python 3.9.2 Tcl/Tk 8.6.8 TerraLunar-tkbench 0.1.8 runtime = 379 * Python 3.10.0a6 Tcl/Tk 8.6.11 TerraLunar-tkbench 0.1.8 runtime = 292 * * this is faster than the M1 Mac, differing in silicon and MacOS version. Dell laptop Windows10 i5-8250U >= 1.6 GHz quad-core x86_64 Python 3.9.2 Tcl/Tk 8.6.9 TerraLunar-tkbench 0.1.8 runtime = 7 Python 3.10.0a6 Tcl/Tk 8.6.10 TerraLunar-tkbench 0.1.8 runtime = 7 # Windows10 seems to be the best environment for tkinter.py / Tcl / Tk graphics apps. ---------------------------------------------------------------------- Every Mac platform is sadly much slower than a comparable Windows platform, for tkinter graphics. But the new M1 Mac platform is the slowest by far, slower than even a much older Intel Mac running the same versions of Python 3.10.0a6 and Tk 8.6.11 That's enough involvement for this noobie; I've now learned how complicated this performance issue is. It's not on my critical path, so I'm going back to my regular project far removed from tkinter graphics. Good Luck folks! ...thomas ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 02:00:44 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 05 Apr 2021 06:00:44 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617602444.39.0.942546696693.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +23932 pull_request: https://github.com/python/cpython/pull/25190 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 03:21:34 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 05 Apr 2021 07:21:34 +0000 Subject: [issue43730] Tutorial Documentation for 4.7.3.2. Positional-Only Parameters, no "/" question? In-Reply-To: <1617585064.51.0.708805253102.issue43730@roundup.psfhosted.org> Message-ID: <1617607294.87.0.723097512336.issue43730@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Quoting https://docs.python.org/3.10/tutorial/controlflow.html#positional-only-parameters: "Positional-only parameters are placed before a / (forward-slash). The / is used to logically separate the positional-only parameters from the rest of the parameters. If there is no / in the function definition, there are no positional-only parameters." Note the preposition in the first sentence: Positional-only parameters are placed _before_ a forward slash. See also the examples: https://docs.python.org/3.10/tutorial/controlflow.html#function-examples AFAICS, the docs are clear and understandable. Suggesting closing this as "not a bug". ---------- nosy: +erlendaasland, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 03:24:48 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Apr 2021 07:24:48 +0000 Subject: [issue43730] Tutorial Documentation for 4.7.3.2. Positional-Only Parameters, no "/" question? In-Reply-To: <1617585064.51.0.708805253102.issue43730@roundup.psfhosted.org> Message-ID: <1617607488.05.0.874653751901.issue43730@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 03:38:43 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Apr 2021 07:38:43 +0000 Subject: [issue43728] Change the exception type and message raised when _curses is not found. In-Reply-To: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> Message-ID: <1617608323.93.0.0131391912233.issue43728@roundup.psfhosted.org> Serhiy Storchaka added the comment: ModuleNotFoundError is the correct exception. Its purpose is to be raised for missed modules. I do not know about macOS, but the curses module is not supported on Windows, so it is expected to get ModuleNotFoundError. Some distributions can provide some stdlib modules (like tkinter, or distutils, or tests) as separate packages. ---------- nosy: +brett.cannon, eric.snow, ncoghlan, ned.deily, ronaldoussoren, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 03:39:36 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 05 Apr 2021 07:39:36 +0000 Subject: [issue43729] Tutorial Documentation for 3.1.1. Numbers missing "result" In-Reply-To: <1617579865.45.0.541169648182.issue43729@roundup.psfhosted.org> Message-ID: <1617608376.12.0.309516958061.issue43729@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch nosy: +erlendaasland nosy_count: 2.0 -> 3.0 pull_requests: +23933 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25191 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 03:46:45 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 05 Apr 2021 07:46:45 +0000 Subject: [issue43731] PEP 597: logging.basicConfig() uses locale encoding. In-Reply-To: <1617596968.06.0.267322224871.issue43731@roundup.psfhosted.org> Message-ID: <1617608805.23.0.571168452316.issue43731@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 03:47:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Apr 2021 07:47:09 +0000 Subject: [issue43729] Tutorial Documentation for 3.1.1. Numbers missing "result" In-Reply-To: <1617579865.45.0.541169648182.issue43729@roundup.psfhosted.org> Message-ID: <1617608829.57.0.507053691303.issue43729@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +ezio.melotti, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 03:53:29 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 05 Apr 2021 07:53:29 +0000 Subject: [issue43728] Change the exception type and message raised when _curses is not found. In-Reply-To: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> Message-ID: <1617609209.59.0.66840482118.issue43728@roundup.psfhosted.org> Shreyan Avigyan added the comment: The curses module is not supported on all platforms is very clear. But beginners may seem to think that their python was not installed properly and then they would go around looking for answer. To make it clear I was thinking of how about changing just the message and if required then the type (maybe CursesNotFoundError exception class derived from ModuleNotFoundError class) so that the error message became a little bit informational. The message could be like "_curses library not installed. Install a supported curses library to use the curses module" or something like that? The exception right now looks like this :- ModuleNotFoundError: No module named '_curses' What about something like this :- CursesNotFoundError: "_curses library not installed. Install a supported curses library to use the curses module." N.B.: The curses library still can be used on Windows by using the UniCurses library or Christoph Gohlke's unofficial curses or some other third party library. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 04:39:40 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 05 Apr 2021 08:39:40 +0000 Subject: [issue22538] turtledemo two_canvases reversion In-Reply-To: <1412221871.63.0.0767968395434.issue22538@psf.upfronthosting.co.za> Message-ID: <1617611980.14.0.0421436839659.issue22538@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: FYI, the running the two_canvases example from turtledemo works fine with Python 3.10 on macOS. ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 05:10:36 2021 From: report at bugs.python.org (Jesvi Jonathan) Date: Mon, 05 Apr 2021 09:10:36 +0000 Subject: [issue38263] [Windows] multiprocessing: DupHandle.detach() race condition on DuplicateHandle(DUPLICATE_CLOSE_SOURCE) In-Reply-To: <1569321399.19.0.207011593125.issue38263@roundup.psfhosted.org> Message-ID: <1617613836.11.0.698627475498.issue38263@roundup.psfhosted.org> Jesvi Jonathan added the comment: File "c:/Users/jesvi/Documents/GitHub/Jesvi-Bot-Telegram/scripts/main.py", line 144, in thread_test p.start() File "C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\process.py", line 121, in start self._popen = self._Popen(self) File "C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\context.py", line 327, in _Popen return Popen(process_obj) File "C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\popen_spawn_win32.py", line 93, in __init__ reduction.dump(process_obj, to_child) File "C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) TypeError: cannot pickle '_thread.lock' object Traceback (most recent call last): File "", line 1, in Traceback (most recent call last): File "", line 1, in File "C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\spawn.py", line 107, in spawn_main File "C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\spawn.py", line 107, in spawn_main new_handle = reduction.duplicate(pipe_handle, File "C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\reduction.py", line 79, in duplicate new_handle = reduction.duplicate(pipe_handle, File "C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\reduction.py", line 79, in duplicate return _winapi.DuplicateHandle( OSError: [WinError 6] The handle is invalid return _winapi.DuplicateHandle( OSError: [WinError 6] The handle is invalid ---------- nosy: +jesvi22j type: behavior -> compile error versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 05:57:07 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 05 Apr 2021 09:57:07 +0000 Subject: [issue43728] Change the exception type and message raised when _curses is not found. In-Reply-To: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> Message-ID: <1617616627.34.0.056905549954.issue43728@roundup.psfhosted.org> Shreyan Avigyan added the comment: What about only changing the error message to make it a little bit informational? Something like :- ModuleNotFoundError: _curses library not found. Install a supported _curses library to use the curses module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 07:40:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Apr 2021 11:40:21 +0000 Subject: [issue22538] turtledemo two_canvases reversion In-Reply-To: <1412221871.63.0.0767968395434.issue22538@psf.upfronthosting.co.za> Message-ID: <1617622821.98.0.175745818034.issue22538@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 08:35:59 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 05 Apr 2021 12:35:59 +0000 Subject: [issue43732] PEP 597: mailcap uses locale encoding Message-ID: <1617626159.89.0.666566758003.issue43732@roundup.psfhosted.org> New submission from Inada Naoki : mailcap.getcaps() uses locale encoding. https://github.com/python/cpython/blob/c8e5eb904e12010d2302364e1037c24a30f5e241/Lib/mailcap.py#L33 As my understanding, RFC 1524 uses only ASCII characters. Can we change the encoding to ASCII or UTF-8? ---------- components: Library (Lib) messages: 390231 nosy: methane priority: normal severity: normal status: open title: PEP 597: mailcap uses locale encoding versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 08:46:50 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 05 Apr 2021 12:46:50 +0000 Subject: [issue43733] PEP 597: netrc uses locale encoding. Message-ID: <1617626810.53.0.0987972947565.issue43733@roundup.psfhosted.org> New submission from Inada Naoki : https://github.com/python/cpython/blob/c8e5eb904e12010d2302364e1037c24a30f5e241/Lib/netrc.py#L29 Can we change the encoding="utf-8" and errors="replace"? IMHO, comments are source of UnicodeDecodeError. So we can open file with binary mode and skip comments without decoding it. But we need to decode non-comment lines lines with some encoding anyway. ---------- components: Library (Lib) messages: 390232 nosy: methane priority: normal severity: normal status: open title: PEP 597: netrc uses locale encoding. versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 08:57:55 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 05 Apr 2021 12:57:55 +0000 Subject: [issue43734] PEP 597: pdb uses locale encoding for pdbrc file Message-ID: <1617627475.28.0.0123915505564.issue43734@roundup.psfhosted.org> New submission from Inada Naoki : I think we should use UTF-8 for pdbrc files because the default encoding of Python source files is UTF-8. ---------- components: Library (Lib) messages: 390233 nosy: methane priority: normal severity: normal status: open title: PEP 597: pdb uses locale encoding for pdbrc file versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 09:28:22 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 05 Apr 2021 13:28:22 +0000 Subject: [issue43735] os.popen() and pipes uses locale encoding Message-ID: <1617629302.16.0.0682743607407.issue43735@roundup.psfhosted.org> New submission from Inada Naoki : os.popen() and pipes module doesn't have `encoding` parameter. They use the default (locale) encoding implicitly. As PEP 597, subprocess module won't emit EncodingWarning for PIPEs in Python 3.10. Like that, we should just add `encoding=None` parameter but don't emit EncodingWarning. ---------- components: Library (Lib) messages: 390234 nosy: methane priority: normal severity: normal status: open title: os.popen() and pipes uses locale encoding versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 09:38:13 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 05 Apr 2021 13:38:13 +0000 Subject: [issue43735] PEP 597: os.popen() and pipes uses locale encoding In-Reply-To: <1617629302.16.0.0682743607407.issue43735@roundup.psfhosted.org> Message-ID: <1617629893.51.0.409678233778.issue43735@roundup.psfhosted.org> Change by Inada Naoki : ---------- title: os.popen() and pipes uses locale encoding -> PEP 597: os.popen() and pipes uses locale encoding _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 09:39:25 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 05 Apr 2021 13:39:25 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617629965.35.0.533778367094.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +23934 pull_request: https://github.com/python/cpython/pull/25192 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 09:47:31 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Apr 2021 13:47:31 +0000 Subject: [issue43734] PEP 597: pdb uses locale encoding for pdbrc file In-Reply-To: <1617627475.28.0.0123915505564.issue43734@roundup.psfhosted.org> Message-ID: <1617630451.61.0.451645414602.issue43734@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> pdb uses the locale encoding for .pdbrc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 09:50:31 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Apr 2021 13:50:31 +0000 Subject: [issue43084] curses.window.enclose() should return bool In-Reply-To: <1612104299.75.0.0836135566859.issue43084@roundup.psfhosted.org> Message-ID: <1617630631.7.0.425852592967.issue43084@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset b1dc1aacf8b0f319024a1a3ce91d395956537c11 by Serhiy Storchaka in branch 'master': bpo-43084: Return bool instead of int from curses.window.enclose() (GH-24398) https://github.com/python/cpython/commit/b1dc1aacf8b0f319024a1a3ce91d395956537c11 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 09:50:46 2021 From: report at bugs.python.org (Jonathan Hoffstadt) Date: Mon, 05 Apr 2021 13:50:46 +0000 Subject: [issue41570] Add DearPyGui to faq/gui.rst In-Reply-To: <1617548553.97.0.220115465559.issue41570@roundup.psfhosted.org> Message-ID: <75B74F21-40C0-4EBA-9A7C-EB41838DBC22@yahoo.com> Jonathan Hoffstadt added the comment: I hoped someone else could complete it it. Sent from my iPhone > On Apr 4, 2021, at 10:03 AM, Irit Katriel wrote: > > ? > New submission from Irit Katriel : > > Jonathan, I see you closed the PR. Did you intend to close this issue as well? > > ---------- > nosy: +iritkatriel > status: open -> pending > > _______________________________________ > Python tracker > > _______________________________________ ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 09:50:54 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Apr 2021 13:50:54 +0000 Subject: [issue43084] curses.window.enclose() should return bool In-Reply-To: <1612104299.75.0.0836135566859.issue43084@roundup.psfhosted.org> Message-ID: <1617630654.1.0.437680939598.issue43084@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 09:56:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 05 Apr 2021 13:56:23 +0000 Subject: [issue41570] Add DearPyGui to faq/gui.rst In-Reply-To: <1617548553.97.0.220115465559.issue41570@roundup.psfhosted.org> Message-ID: <1617630983.25.0.626654658441.issue41570@roundup.psfhosted.org> Irit Katriel added the comment: Did you have someone in mind? If you want a stranger to pick it up it might help if you explain on the issue what you are suggesting to change and why you closed the PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 10:19:20 2021 From: report at bugs.python.org (Thomas Cavalli) Date: Mon, 05 Apr 2021 14:19:20 +0000 Subject: [issue43729] Tutorial Documentation for 3.1.1. Numbers missing "result" In-Reply-To: <1617579865.45.0.541169648182.issue43729@roundup.psfhosted.org> Message-ID: <1617632360.85.0.832361160786.issue43729@roundup.psfhosted.org> Change by Thomas Cavalli : ---------- resolution: -> works for me stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 10:37:31 2021 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 05 Apr 2021 14:37:31 +0000 Subject: [issue2889] curses for windows (alternative patch) In-Reply-To: <1210919907.42.0.842256015219.issue2889@psf.upfronthosting.co.za> Message-ID: <1617633451.28.0.604145795446.issue2889@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- nosy: +jkloth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 10:37:34 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 05 Apr 2021 14:37:34 +0000 Subject: [issue43728] Change the exception type and message raised when _curses is not found. In-Reply-To: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> Message-ID: <1617633454.24.0.757019405939.issue43728@roundup.psfhosted.org> Eric V. Smith added the comment: > ModuleNotFoundError: _curses library not found. Install a supported _curses library to use the curses module. Is installing _curses possible, on any supported platform? Or would a better message say that curses is not supported on this platform? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 11:07:08 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 05 Apr 2021 15:07:08 +0000 Subject: [issue43728] Change the exception type and message raised when _curses is not found. In-Reply-To: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> Message-ID: <1617635228.58.0.964441110069.issue43728@roundup.psfhosted.org> Shreyan Avigyan added the comment: > Is installing _curses possible, on any supported platform? Or would a better message say that curses is not supported on this platform? No _curses can't be installed on any platform. I don't know about macOS but _curses can be installed on Windows and Linux (and presumably any UNIX-based OS). On Windows, Christoph Gohlke's unofficial curses, windows-curses and lot's of libraries allows us to use _curses library. Though I think curses can't be used directly on Windows cmd or powershell. Terminals provided by the Mingw-w64 project, the Cygwin project, etc., most presumably support curses library. WSL terminal also seem to support curses (ncurses). So what about a error message like this :- ModuleNotFoundError: _curses library not found. Install a supported _curses library to use the curses module or migrate to a supported platform. N.B.: UniCurses library may work with Windows cmd or powershell because it wraps up the PDCurses library on Windows which was developed specifically to work with Windows. Though UniCurses actually can't be used with the Python built-in module curses. We have to specifically import 'unicurses' to use it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 11:14:08 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 05 Apr 2021 15:14:08 +0000 Subject: [issue43728] Change the exception type and message raised when _curses is not found. In-Reply-To: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> Message-ID: <1617635648.78.0.316925982995.issue43728@roundup.psfhosted.org> Eric V. Smith added the comment: While I wouldn't object to tweaking the message associated with the exception, I'm not sure it's necessary. Googling "curses modulenotfound" gives a number of hits that have good information about the issue. Is there really a practical problem that's being solved here? "migrate to a supported platform" is almost never practical advice. If we make any change, I'd just say it's not supported on this platform. Or maybe "you may be running on platform that is not supported by curses". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 11:18:31 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 05 Apr 2021 15:18:31 +0000 Subject: [issue43728] Change the exception type and message raised when _curses is not found. In-Reply-To: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> Message-ID: <1617635911.83.0.90400588935.issue43728@roundup.psfhosted.org> Shreyan Avigyan added the comment: > "migrate to a supported platform" is almost never practical advice. If we make any change, I'd just say it's not supported on this platform. Or maybe "you may be running on platform that is not supported by curses". Ok...So what about a message like this :- ModuleNotFoundError: _curses library not found. Install a supported _curses library to use the curses module (The _curses library may not be supported on your platform). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 11:55:20 2021 From: report at bugs.python.org (Brett Cannon) Date: Mon, 05 Apr 2021 15:55:20 +0000 Subject: [issue42135] [importlib] Deprecate find_module() & find_loader() mplementations In-Reply-To: <1603494695.54.0.8376376438.issue42135@roundup.psfhosted.org> Message-ID: <1617638120.89.0.449083279791.issue42135@roundup.psfhosted.org> Change by Brett Cannon : ---------- keywords: +patch pull_requests: +23935 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25169 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 11:58:00 2021 From: report at bugs.python.org (Brett Cannon) Date: Mon, 05 Apr 2021 15:58:00 +0000 Subject: [issue43728] Change the exception type and message raised when _curses is not found. In-Reply-To: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> Message-ID: <1617638280.06.0.0684202983409.issue43728@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: -brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 12:25:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 05 Apr 2021 16:25:09 +0000 Subject: [issue27129] Wordcode, part 2 In-Reply-To: <1464268387.83.0.862540030058.issue27129@psf.upfronthosting.co.za> Message-ID: <1617639909.27.0.283658864932.issue27129@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Closing as this is fixed. Feel free to reopen if there is something missing ---------- nosy: +pablogsal resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 12:27:02 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 05 Apr 2021 16:27:02 +0000 Subject: [issue22538] turtledemo two_canvases reversion In-Reply-To: <1412221871.63.0.0767968395434.issue22538@psf.upfronthosting.co.za> Message-ID: <1617640022.63.0.89812418194.issue22538@roundup.psfhosted.org> Terry J. Reedy added the comment: Thank you. I had forgotten about this. It also works as advertised in the module docstring on Windows, 3.8 and 3.10. There has been no change to the code, so a patch to turtle itself must have fixed the problem. ---------- resolution: -> out of date stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 12:49:12 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 05 Apr 2021 16:49:12 +0000 Subject: [issue43728] Change the exception type and message raised when _curses is not found. In-Reply-To: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> Message-ID: <1617641352.83.0.295270701627.issue43728@roundup.psfhosted.org> Shreyan Avigyan added the comment: Is this confirmed? If yes then I'll open a PR on https://github.com/python/cpython ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 13:02:37 2021 From: report at bugs.python.org (Lukas Vacek) Date: Mon, 05 Apr 2021 17:02:37 +0000 Subject: [issue38794] Setup: support linking openssl statically In-Reply-To: <1573734613.61.0.712380405287.issue38794@roundup.psfhosted.org> Message-ID: <1617642157.38.0.384821258141.issue38794@roundup.psfhosted.org> Lukas Vacek added the comment: Thanks for the explanation of the secret workings behind the scenes. What a productive and polite response. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 13:13:36 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 05 Apr 2021 17:13:36 +0000 Subject: [issue43728] Change the exception message raised when _curses is not found. In-Reply-To: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> Message-ID: <1617642816.75.0.645205858911.issue43728@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- title: Change the exception type and message raised when _curses is not found. -> Change the exception message raised when _curses is not found. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 13:13:16 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 05 Apr 2021 17:13:16 +0000 Subject: [issue17305] IDNA2008 encoding is missing In-Reply-To: <1361928766.42.0.728949411958.issue17305@psf.upfronthosting.co.za> Message-ID: <1617642796.1.0.876793797499.issue17305@roundup.psfhosted.org> Christian Heimes added the comment: The issue has been waiting for contributions for 8 years now. So far nobody has shown an interested to address the problem and contribute an IDNA 2008 codec to Python's standard library. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 14:14:11 2021 From: report at bugs.python.org (Bartosz) Date: Mon, 05 Apr 2021 18:14:11 +0000 Subject: [issue41974] Remove complex.__float__, complex.__floordiv__, etc In-Reply-To: <1602140125.13.0.506221233573.issue41974@roundup.psfhosted.org> Message-ID: <1617646451.13.0.572788107259.issue41974@roundup.psfhosted.org> Change by Bartosz : ---------- pull_requests: +23936 pull_request: https://github.com/python/cpython/pull/25197 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 14:44:58 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 05 Apr 2021 18:44:58 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1617648298.28.0.969156131014.issue43693@roundup.psfhosted.org> Guido van Rossum added the comment: To me it looks simpler though. The locals and cells are already stored in a single array, f_localsplus (which also contains the evaluation stack). There are various complications in ceval.c to translate cell indexes to indexes in this array (ein particular the extra local variable 'freevars', which weighs down the stack frame). Making the interpreter simpler by moving things to the compiler also makes it easier for the C compiler to optimize the code of the interpreter better. ---------- nosy: +Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 14:52:51 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 05 Apr 2021 18:52:51 +0000 Subject: [issue43728] Change the exception message raised when _curses is not found. In-Reply-To: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> Message-ID: <1617648771.74.0.682909732618.issue43728@roundup.psfhosted.org> Shreyan Avigyan added the comment: Is this issue ready for a PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 14:53:54 2021 From: report at bugs.python.org (Bartosz) Date: Mon, 05 Apr 2021 18:53:54 +0000 Subject: [issue41974] Remove complex.__float__, complex.__floordiv__, etc In-Reply-To: <1602140125.13.0.506221233573.issue41974@roundup.psfhosted.org> Message-ID: <1617648834.73.0.0554935053558.issue41974@roundup.psfhosted.org> Bartosz added the comment: Done so: https://github.com/python/cpython/pull/25197 Signed the CLA thing too, it seems it'll take a while to update tho. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 15:21:12 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Apr 2021 19:21:12 +0000 Subject: [issue43087] ctypes documentation error In-Reply-To: <1612120039.68.0.861661788705.issue43087@roundup.psfhosted.org> Message-ID: <1617650472.44.0.441790811622.issue43087@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +23937 pull_request: https://github.com/python/cpython/pull/25198 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 15:21:18 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Apr 2021 19:21:18 +0000 Subject: [issue43087] ctypes documentation error In-Reply-To: <1612120039.68.0.861661788705.issue43087@roundup.psfhosted.org> Message-ID: <1617650478.29.0.242784190142.issue43087@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +23938 pull_request: https://github.com/python/cpython/pull/25199 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 15:21:13 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 05 Apr 2021 19:21:13 +0000 Subject: [issue43087] ctypes documentation error In-Reply-To: <1612120039.68.0.861661788705.issue43087@roundup.psfhosted.org> Message-ID: <1617650473.38.0.896374019035.issue43087@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 14829b09eb652f457cf837836909169746a810f0 by Zackery Spytz in branch 'master': bpo-43087: Fix error in ctypes "Incomplete Types" doc (GH-24404) https://github.com/python/cpython/commit/14829b09eb652f457cf837836909169746a810f0 ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 15:37:40 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 05 Apr 2021 19:37:40 +0000 Subject: [issue41837] Upgrade installers to OpenSSL 1.1.1j In-Reply-To: <1600822748.89.0.850484234677.issue41837@roundup.psfhosted.org> Message-ID: <1617651460.37.0.46310096653.issue41837@roundup.psfhosted.org> Ned Deily added the comment: Now updated to OpenSSL 1.1.1k in Issue43631 ---------- priority: deferred blocker -> resolution: -> out of date stage: patch review -> resolved status: open -> closed superseder: -> Update to OpenSSL 1.1.1k _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 15:41:16 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Apr 2021 19:41:16 +0000 Subject: [issue36470] dataclasses.replace raises an exception if InitVar with default argument is not provided. In-Reply-To: <1553860338.68.0.823118501948.issue36470@roundup.psfhosted.org> Message-ID: <1617651676.21.0.975782694599.issue36470@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +23939 pull_request: https://github.com/python/cpython/pull/25200 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 15:41:09 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Apr 2021 19:41:09 +0000 Subject: [issue36470] dataclasses.replace raises an exception if InitVar with default argument is not provided. In-Reply-To: <1553860338.68.0.823118501948.issue36470@roundup.psfhosted.org> Message-ID: <1617651669.94.0.129472514478.issue36470@roundup.psfhosted.org> miss-islington added the comment: New changeset 75220674c07abfc90c2cd7862d04cfa2e2354450 by Zackery Spytz in branch 'master': bpo-36470: Allow dataclasses.replace() to handle InitVars with default values (GH-20867) https://github.com/python/cpython/commit/75220674c07abfc90c2cd7862d04cfa2e2354450 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 15:41:23 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Apr 2021 19:41:23 +0000 Subject: [issue36470] dataclasses.replace raises an exception if InitVar with default argument is not provided. In-Reply-To: <1553860338.68.0.823118501948.issue36470@roundup.psfhosted.org> Message-ID: <1617651683.34.0.333585638959.issue36470@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +23940 pull_request: https://github.com/python/cpython/pull/25201 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 15:48:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Apr 2021 19:48:29 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1617652109.82.0.612074195533.issue43693@roundup.psfhosted.org> Serhiy Storchaka added the comment: LGTM. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 15:48:32 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 05 Apr 2021 19:48:32 +0000 Subject: [issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong) In-Reply-To: <1391441802.61.0.557224247712.issue20503@psf.upfronthosting.co.za> Message-ID: <1617652112.14.0.508204799642.issue20503@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 7bc25ec7276db2a81e7823671a74eeb8aa6b4542 by Raymond Hettinger in branch 'master': bpo-20503: Show how isinstance() works with ABC registered classes. (GH-25175) https://github.com/python/cpython/commit/7bc25ec7276db2a81e7823671a74eeb8aa6b4542 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 15:48:36 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Apr 2021 19:48:36 +0000 Subject: [issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong) In-Reply-To: <1391441802.61.0.557224247712.issue20503@psf.upfronthosting.co.za> Message-ID: <1617652116.45.0.657057447967.issue20503@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +23941 pull_request: https://github.com/python/cpython/pull/25202 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 16:02:01 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 05 Apr 2021 20:02:01 +0000 Subject: [issue43728] Change the exception message raised when _curses is not found. In-Reply-To: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> Message-ID: <1617652921.07.0.482906693181.issue43728@roundup.psfhosted.org> Ned Deily added the comment: "Install a supported _curses library" That's not correct advice. _curses is the name of the support module written in C in the Python Standard Library. If it is not available to import in an installation, it's most likely because the build of the module failed because the third-party libraries that implement curses functionality was not installed or not found during the build. How you install the third-party curses library varies greatly by platform or distribution. Some distributions have multiple variants of curses packages, ones with just libraries and others ("-dev" packages) that include header files necessary for Python to build its _curses module. The Dev Guide has some information on dependencies in general and the details for _curses are in the code in setup.py. It's also possible that the distributor has broken Python curses support out into a separate package. So it's not easy to provide a message with a useful specific suggestion; there are just too many cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 16:07:39 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 05 Apr 2021 20:07:39 +0000 Subject: [issue36470] dataclasses.replace raises an exception if InitVar with default argument is not provided. In-Reply-To: <1553860338.68.0.823118501948.issue36470@roundup.psfhosted.org> Message-ID: <1617653259.91.0.429909069066.issue36470@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset bdee2a389e4b10e1c0ab65bbd4fd03defe7b2837 by Miss Islington (bot) in branch '3.8': bpo-36470: Allow dataclasses.replace() to handle InitVars with default values (GH-20867) (GH-25201) https://github.com/python/cpython/commit/bdee2a389e4b10e1c0ab65bbd4fd03defe7b2837 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 16:07:42 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 05 Apr 2021 20:07:42 +0000 Subject: [issue36470] dataclasses.replace raises an exception if InitVar with default argument is not provided. In-Reply-To: <1553860338.68.0.823118501948.issue36470@roundup.psfhosted.org> Message-ID: <1617653262.52.0.0761351863071.issue36470@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 013c30e5fcee449cee63354d34585d6111782c82 by Miss Islington (bot) in branch '3.9': bpo-36470: Allow dataclasses.replace() to handle InitVars with default values (GH-20867) (GH-25200) https://github.com/python/cpython/commit/013c30e5fcee449cee63354d34585d6111782c82 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 16:11:57 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 05 Apr 2021 20:11:57 +0000 Subject: [issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong) In-Reply-To: <1391441802.61.0.557224247712.issue20503@psf.upfronthosting.co.za> Message-ID: <1617653517.87.0.0175649290255.issue20503@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 028d5286d4255195ba6715e1aeb4bffed6b0279e by Miss Islington (bot) in branch '3.9': bpo-20503: Show how isinstance() works with ABC registered classes. (GH-25175) (GH-25202) https://github.com/python/cpython/commit/028d5286d4255195ba6715e1aeb4bffed6b0279e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 16:12:35 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 05 Apr 2021 20:12:35 +0000 Subject: [issue36470] dataclasses.replace raises an exception if InitVar with default argument is not provided. In-Reply-To: <1553860338.68.0.823118501948.issue36470@roundup.psfhosted.org> Message-ID: <1617653555.47.0.335808151903.issue36470@roundup.psfhosted.org> Eric V. Smith added the comment: Thanks for the fix! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 16:12:39 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 05 Apr 2021 20:12:39 +0000 Subject: [issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong) In-Reply-To: <1391441802.61.0.557224247712.issue20503@psf.upfronthosting.co.za> Message-ID: <1617653559.08.0.16803257623.issue20503@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 17:03:00 2021 From: report at bugs.python.org (Yanghao Hua) Date: Mon, 05 Apr 2021 21:03:00 +0000 Subject: [issue43736] asyncio create_task() odd behavior Message-ID: <1617656580.62.0.948466534657.issue43736@roundup.psfhosted.org> New submission from Yanghao Hua : This code runs perfectly fine with expected behavior: two tasks created, executed in an interleaved manner: from time import time from asyncio import run, create_task, sleep async def task(name, n): for i in range(n): print(f"task-{name}: ", i, time()) await sleep(1) async def top(): t0 = create_task(task("T0", 10)) t1 = create_task(task("T1", 10)) print("starting tasks ...") await t0 await t1 run(top()) Output: starting tasks ... task-T0: 0 1617656271.6513114 task-T1: 0 1617656271.6513336 task-T0: 1 1617656272.6526577 task-T1: 1 1617656272.652813 task-T0: 2 1617656273.654187 task-T1: 2 1617656273.6543217 task-T0: 3 1617656274.655706 task-T1: 3 1617656274.6558387 task-T0: 4 1617656275.65722 task-T1: 4 1617656275.657355 task-T0: 5 1617656276.6587365 task-T1: 5 1617656276.6588728 task-T0: 6 1617656277.660276 task-T1: 6 1617656277.6604114 task-T0: 7 1617656278.6617858 task-T1: 7 1617656278.66192 task-T0: 8 1617656279.6633058 task-T1: 8 1617656279.6634388 task-T0: 9 1617656280.6648436 task-T1: 9 1617656280.6649704 However, with slightly modified `async def top()`, things become executing sequentially: async def top(): print("starting tasks ...") await create_task(task("T0", 10)) await create_task(task("T1", 10)) Output: starting tasks ... task-T0: 0 1617656306.1343822 task-T0: 1 1617656307.1357212 task-T0: 2 1617656308.1369958 task-T0: 3 1617656309.1384225 task-T0: 4 1617656310.1398354 task-T0: 5 1617656311.1412706 task-T0: 6 1617656312.1427014 task-T0: 7 1617656313.1441336 task-T0: 8 1617656314.1455553 task-T0: 9 1617656315.1468768 task-T1: 0 1617656316.1482618 task-T1: 1 1617656317.1496553 task-T1: 2 1617656318.151089 task-T1: 3 1617656319.1525192 task-T1: 4 1617656320.153974 task-T1: 5 1617656321.1554224 task-T1: 6 1617656322.1568594 task-T1: 7 1617656323.1582792 task-T1: 8 1617656324.1597185 task-T1: 9 1617656325.1611636 This breaks the behavior expectation, where created tasks should have been executing in parallel. It seems if a created task is immediately awaited, it is not returning to the top() immediately, and instead, it executes the task and waited until it finishes. Is this a bug, or did I miss something? Thank you. ---------- components: asyncio messages: 390260 nosy: asvetlov, yanghao.py, yselivanov priority: normal severity: normal status: open title: asyncio create_task() odd behavior type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 17:09:31 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 05 Apr 2021 21:09:31 +0000 Subject: [issue23470] OpenBSD buildbot uses wrong stdlib In-Reply-To: <1424074716.69.0.694325234594.issue23470@psf.upfronthosting.co.za> Message-ID: <1617656971.8.0.847970935538.issue23470@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Is the OpenBSD buildbot still active? If no, this issue can be closed. (I can't find the OpenBSD buildbot on https://buildbot.python.org/all/#/) ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 17:23:45 2021 From: report at bugs.python.org (Zachary Ware) Date: Mon, 05 Apr 2021 21:23:45 +0000 Subject: [issue43736] asyncio create_task() odd behavior In-Reply-To: <1617656580.62.0.948466534657.issue43736@roundup.psfhosted.org> Message-ID: <1617657825.63.0.218954805022.issue43736@roundup.psfhosted.org> Zachary Ware added the comment: You missed something :) By immediately awaiting the result of `create_task`, you're synchronizing thing. It's the same as just rearranging the lines of the first example to: t0 = create_task(task("T0", 10)) print("starting tasks ...") await t0 t1 = create_task(task("T1", 10)) await t1 Basically, `t1` simply doesn't exist yet when you ask `t0` to run to completion. ---------- nosy: +zach.ware resolution: -> not a bug status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 17:33:05 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 05 Apr 2021 21:33:05 +0000 Subject: [issue43684] Add combined opcodes In-Reply-To: <1617230432.54.0.49540913796.issue43684@roundup.psfhosted.org> Message-ID: <1617658385.31.0.306259103246.issue43684@roundup.psfhosted.org> Guido van Rossum added the comment: So dynamically, I see about 0.5% of all opcodes are ADD_INT, so higher than statically (which was 0.1%) but still small enough that I'm abandoning work on ADD_INT. I've got a branch where I'm adding POP_JUMP_IF_NONE and POP_JUMP_IF_NOT_NONE (which capture if x is None, if x is not None) but the static count there is still pretty low, around 0.2% statically. These numbers are remarkably stable -- I get 0.2% exactly for mypy, 0.18% for the stdlib. (A bit more in the azure-cli source code: 0.35%.) I expect that the dynamic count here would be a bit higher too: without running it, I'd expect around 1%, if we take it that the average loop does about 5 iterations -- my results for ADD_INT would lead to that conclusion, and this was independently verified by an Instagram blog post from 2017. (https://instagram-engineering.com/profiling-cpython-at-instagram-89d4cbeeb898, search for "loopyness") Is that enough to persevere? I really don't know. I have a few other potential opcode combinations, RETURN_CONST and RETURN_NONE, but since those (by definition) don't occur in a loop, I'm even less optimistic about the value of those. We really should optimize things like LOAD_FAST + LOAD_FAST, which occurs much more frequently. However the way to encode that combination is pretty gross, and I'd rather do that another time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 17:49:56 2021 From: report at bugs.python.org (Anthony Flury) Date: Mon, 05 Apr 2021 21:49:56 +0000 Subject: [issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative Message-ID: <1617659396.43.0.525762996462.issue43737@roundup.psfhosted.org> New submission from Anthony Flury : The behavior of a%b when a is positive and b is negative can be suprising. I understand that the behavior is so that the identity a = (a//b)*b + a%b can be preserved regardless of the signs of a or b. but the result is different from other languages which is why it can be surprising. I would be happy to do the grunt work to make the changes if some can suggest where. Do we - add a warning to the https://docs.python.org/3/tutorial/introduction.html#numbers page, or should we link to a new page that details and explains the behavior. Which is more 'pythonic' in terms of documentation ? ---------- messages: 390264 nosy: anthony-flury priority: normal severity: normal status: open title: Documentation of modulo operator should document behaviour clearly when second operator is negative _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 19:29:08 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 05 Apr 2021 23:29:08 +0000 Subject: [issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative In-Reply-To: <1617659396.43.0.525762996462.issue43737@roundup.psfhosted.org> Message-ID: <1617665348.47.0.0120262723246.issue43737@roundup.psfhosted.org> Steven D'Aprano added the comment: > the result is different from other languages which is why it can be surprising. Maybe the other languages should be documenting their surprising result, which fails to preserve the identity? > Do we - add a warning to the [tutorial] page, or should we link to a new page that details and explains the behavior. Neither. Warnings are for *dangerous or risky behaviour*, this is neither. And we surely don't need an entire new page just to document a minor piece of arithmetic behaviour. The behaviour (although not the rationale for it) is already documented here: https://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations although not here: https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex You could add a note to the table at the second link, and a FAQ next to this: https://docs.python.org/3/faq/programming.html#why-does-22-10-return-3 ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 19:37:41 2021 From: report at bugs.python.org (Ryan McCampbell) Date: Mon, 05 Apr 2021 23:37:41 +0000 Subject: [issue43738] Clarify public name of curses.window Message-ID: <1617665861.34.0.620299558452.issue43738@roundup.psfhosted.org> New submission from Ryan McCampbell : Until 3.8 the curses window class was not directly available in code, but now it is available as `_curses.window`. This is not explicitly stated in the documentation (although it is consistent with how the method signatures are written). It is useful to have a public name for the type to aid IDE's with explicit type annotations, i.e. @curses.wrapper def main(stdscr: curses.window): stdscr.addstr(...) See https://github.com/python/typeshed/pull/5180, which adds this name to type hints in the typeshed project. This name should be more clearly documented so programmers can annotate the type without worrying that it may change (which will cause a runtime error unless it is quoted). ---------- assignee: docs at python components: Documentation messages: 390266 nosy: docs at python, rmccampbell7 priority: normal severity: normal status: open title: Clarify public name of curses.window type: enhancement versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 19:58:22 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 05 Apr 2021 23:58:22 +0000 Subject: [issue43728] Change the exception message raised when _curses is not found. In-Reply-To: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> Message-ID: <1617667102.91.0.482029614526.issue43728@roundup.psfhosted.org> Eric V. Smith added the comment: I agree with Ned. This is why I'm not sure it?s worth changing the message: googling gives good information, and the exact thing to do in order resolve this (if it?s even possible) is dependent on a number of factors that the code raising the exception can?t know. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 20:40:43 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 06 Apr 2021 00:40:43 +0000 Subject: [issue42128] Structural Pattern Matching (PEP 634) In-Reply-To: <1603466540.96.0.7677855399.issue42128@roundup.psfhosted.org> Message-ID: <1617669643.67.0.364191774715.issue42128@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +23942 pull_request: https://github.com/python/cpython/pull/25203 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 21:01:23 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 06 Apr 2021 01:01:23 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617670883.43.0.417767110884.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 3d4af4a876e679431c6a3751667ded63cc6f66c1 by Inada Naoki in branch 'master': bpo-43651: Fix EncodingWarning in sysconfig (GH-25192) https://github.com/python/cpython/commit/3d4af4a876e679431c6a3751667ded63cc6f66c1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 21:51:24 2021 From: report at bugs.python.org (Ma Lin) Date: Tue, 06 Apr 2021 01:51:24 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1617673884.82.0.458649519283.issue41486@roundup.psfhosted.org> Ma Lin added the comment: ping ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 22:17:14 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 06 Apr 2021 02:17:14 +0000 Subject: [issue42128] Structural Pattern Matching (PEP 634) In-Reply-To: <1603466540.96.0.7677855399.issue42128@roundup.psfhosted.org> Message-ID: <1617675434.61.0.071491382052.issue42128@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset f84d5a113680c5a6aaaf9130aed7a34d611748ff by Brandt Bucher in branch 'master': bpo-42128: __match_args__ can't be a list anymore (GH-25203) https://github.com/python/cpython/commit/f84d5a113680c5a6aaaf9130aed7a34d611748ff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 22:17:33 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 06 Apr 2021 02:17:33 +0000 Subject: [issue23470] OpenBSD buildbot uses wrong stdlib In-Reply-To: <1424074716.69.0.694325234594.issue23470@psf.upfronthosting.co.za> Message-ID: <1617675453.53.0.545442602586.issue23470@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 22:18:49 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 06 Apr 2021 02:18:49 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617675529.11.0.0423473418993.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset fb78692f2ad5ee4747f13a73943fbf134b637669 by Inada Naoki in branch 'master': bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25189) https://github.com/python/cpython/commit/fb78692f2ad5ee4747f13a73943fbf134b637669 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 23:19:39 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 06 Apr 2021 03:19:39 +0000 Subject: [issue43689] difflib: mention other "problematic" characters in documentation In-Reply-To: <1617264551.39.0.962049035907.issue43689@roundup.psfhosted.org> Message-ID: <1617679179.92.0.158095492218.issue43689@roundup.psfhosted.org> Terry J. Reedy added the comment: I have an alternate replacement: "These lines can be confusing if the sequences contain tab characters or other characters that result in the indicator symbols in these lines being mislocated." Or leave the current sentence as is. Explanation with the details omitted from the above: In 3.x, strings are unicode. Even if one uses a fixed pitch font for the ascii subset, a majority of characters will be rendered either in a different fixed pitch or with variable pitch. And on a graphics screen that is not simulating a fixed-pitch text terminal (such as Windows console), the so-called double-wide East Asian characters are not really double wide but more like 1.6 times as wide. The details depend on the OS, the font, and perhaps the font size. One can explore this in the font sample box for the Font tab of the IDLE settings dialog. The problems include chars less than 'one space', down to 0 wide. For general unicode, ^ marking does not work. Syntax error marking has the same problem and there is no general solution. Tab is an example of a character that is either displayed as a variable space or a fixed double space ('\t') or larger. If we were to make a change, we should mention, as above, that many non-ascii chars are as especially confusing as tabs. In your example above, the caret at least points to the right space. It correctly indicates some difference beyond the visible end - a non-visible whitespace difference. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 5 23:46:15 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 06 Apr 2021 03:46:15 +0000 Subject: [issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning In-Reply-To: <1615868389.17.0.260147645451.issue43510@roundup.psfhosted.org> Message-ID: <1617680775.69.0.356548055401.issue43510@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 00:02:33 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 06 Apr 2021 04:02:33 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617681753.3.0.500890567154.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 4663e5f39e9f872dcd69545f293e832d5855d084 by Inada Naoki in branch 'master': bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25190) https://github.com/python/cpython/commit/4663e5f39e9f872dcd69545f293e832d5855d084 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 00:15:36 2021 From: report at bugs.python.org (Tim Peters) Date: Tue, 06 Apr 2021 04:15:36 +0000 Subject: [issue43689] difflib: mention other "problematic" characters in documentation In-Reply-To: <1617264551.39.0.962049035907.issue43689@roundup.psfhosted.org> Message-ID: <1617682536.75.0.432349144468.issue43689@roundup.psfhosted.org> Tim Peters added the comment: Terry, your suggested replacement statement looks like an improvement to me. Perhaps the longer explanation could be placed in a footnote. Note that I'm old ;-) I grew up on plain old ASCII, decades & decades ago, and tabs are in fact the only "characters" I've had a problem with in doctests. But then, e.g., I never in my life used goofy things like ASCII "form feed" characters, or NUL bytes, or ... in text either. I don't use Unicode either, except to the extent that Python forces me to when I'm sticking printable ASCII characters inside string quotes ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 00:26:08 2021 From: report at bugs.python.org (Joshua Bronson) Date: Tue, 06 Apr 2021 04:26:08 +0000 Subject: [issue27815] Make SSL suppress_ragged_eofs default more secure In-Reply-To: <1471699151.03.0.676654185488.issue27815@psf.upfronthosting.co.za> Message-ID: <1617683168.24.0.513313220943.issue27815@roundup.psfhosted.org> Change by Joshua Bronson : ---------- nosy: +jab _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 00:32:55 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 06 Apr 2021 04:32:55 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617683575.11.0.0771328943105.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +23943 pull_request: https://github.com/python/cpython/pull/25204 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 00:54:03 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 06 Apr 2021 04:54:03 +0000 Subject: [issue43728] Change the exception message raised when _curses is not found. In-Reply-To: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> Message-ID: <1617684843.55.0.0813661811197.issue43728@roundup.psfhosted.org> Shreyan Avigyan added the comment: Yeah...I agree. Therefore this issue is resolved and I will close this issue now. Thanks everyone for the advice. With Regards ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 00:54:24 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 06 Apr 2021 04:54:24 +0000 Subject: [issue43728] Change the exception message raised when _curses is not found. In-Reply-To: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> Message-ID: <1617684864.53.0.00141480926408.issue43728@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 00:56:58 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 06 Apr 2021 04:56:58 +0000 Subject: [issue43728] Change the exception message raised when _curses is not found. In-Reply-To: <1617549423.3.0.901195728077.issue43728@roundup.psfhosted.org> Message-ID: <1617685018.02.0.495419274195.issue43728@roundup.psfhosted.org> Eric V. Smith added the comment: @shreyanavigyan: Thank you for your efforts to improve Python! ---------- resolution: -> wont fix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 01:14:08 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Apr 2021 05:14:08 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1617686048.41.0.967475737101.issue43176@roundup.psfhosted.org> miss-islington added the comment: New changeset 376ffc6ac491da74920aed1b8e35bc371cb766ac by Iurii Kemaev in branch 'master': bpo-43176: Fix processing of empty dataclasses (GH-24484) https://github.com/python/cpython/commit/376ffc6ac491da74920aed1b8e35bc371cb766ac ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 01:14:36 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Apr 2021 05:14:36 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1617686076.95.0.781766783358.issue43176@roundup.psfhosted.org> Change by miss-islington : ---------- keywords: +patch pull_requests: +23944 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25205 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 01:14:45 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Apr 2021 05:14:45 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1617686085.76.0.942789988656.issue43176@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +23945 pull_request: https://github.com/python/cpython/pull/25206 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 01:32:02 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Apr 2021 05:32:02 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1617687122.26.0.647275180253.issue43176@roundup.psfhosted.org> miss-islington added the comment: New changeset b132be8b43afa739b7eda271b82711d64a83da4f by Miss Islington (bot) in branch '3.8': bpo-43176: Fix processing of empty dataclasses (GH-24484) https://github.com/python/cpython/commit/b132be8b43afa739b7eda271b82711d64a83da4f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 01:42:07 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Tue, 06 Apr 2021 05:42:07 +0000 Subject: [issue43599] Setting long domain of locale.dgettext() crashes Python interpreter In-Reply-To: <1616464498.74.0.582898049043.issue43599@roundup.psfhosted.org> Message-ID: <1617687727.44.0.862712682032.issue43599@roundup.psfhosted.org> Xinmeng Xia added the comment: Attached testing results of gdb and valgrind. (No error is reported for locale.dgettext('abs'*10,'')) $gdb ./python (gdb) run >>> locale.dgettext('abs'*10000000,'') Program received signal SIGSEGV, Segmentation fault. __dcigettext ( domainname=domainname at entry=0xadb030 "absabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsab"..., msgid1=msgid1 at entry=0x7ffff7fc09a0 "", msgid2=msgid2 at entry=0x0, plural=plural at entry=0, n=n at entry=0, category=category at entry=5) at dcigettext.c:675 675 dcigettext.c: No such file or directory. (gdb) valgrind ~$ PYTHONMALLOC=malloc_debug valgrind python Memcheck, a memory error detector ==4870== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==4870== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info ==4870== Command: /home/xxm/Desktop/apifuzz/Python-3.10.0a6/python ==4870== Python 3.10.0a6 (default, Mar 19 2021, 11:45:56) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> locale.dgettext('abs'*10000000,'') Traceback (most recent call last): File "", line 1, in NameError: name 'locale' is not defined >>> import locale >>> locale.dgettext('abs'*10000000,'') ==4870== Warning: client switching stacks? SP change: 0x1ffefff5c0 --> 0x1ffd363220 ==4870== to suppress, use: --max-stackframe=30000032 or greater ==4870== Invalid write of size 8 ==4870== at 0x5797E88: __dcigettext (dcigettext.c:675) ==4870== Address 0x1ffd363218 is on thread 1's stack ==4870== ==4870== ==4870== Process terminating with default action of signal 11 (SIGSEGV) ==4870== Access not within mapped region at address 0x1FFD363218 ==4870== at 0x5797E88: __dcigettext (dcigettext.c:675) ==4870== If you believe this happened as a result of a stack ==4870== overflow in your program's main thread (unlikely but ==4870== possible), you can try to increase the size of the ==4870== main thread stack using the --main-stacksize= flag. ==4870== The main thread stack size used in this run was 8388608. ==4870== Invalid write of size 8 ==4870== at 0x4A2867A: _vgnU_freeres (vg_preloaded.c:57) ==4870== Address 0x1ffd363210 is on thread 1's stack ==4870== ==4870== ==4870== Process terminating with default action of signal 11 (SIGSEGV) ==4870== Access not within mapped region at address 0x1FFD363210 ==4870== at 0x4A2867A: _vgnU_freeres (vg_preloaded.c:57) ==4870== If you believe this happened as a result of a stack ==4870== overflow in your program's main thread (unlikely but ==4870== possible), you can try to increase the size of the ==4870== main thread stack using the --main-stacksize= flag. ==4870== The main thread stack size used in this run was 8388608. ==4870== ==4870== HEAP SUMMARY: ==4870== in use at exit: 35,310,749 bytes in 35,706 blocks ==4870== total heap usage: 87,221 allocs, 51,515 frees, 44,733,752 bytes allocated ==4870== ==4870== LEAK SUMMARY: ==4870== definitely lost: 0 bytes in 0 blocks ==4870== indirectly lost: 0 bytes in 0 blocks ==4870== possibly lost: 35,173,680 bytes in 34,899 blocks ==4870== still reachable: 137,069 bytes in 807 blocks ==4870== suppressed: 0 bytes in 0 blocks ==4870== Rerun with --leak-check=full to see details of leaked memory ==4870== ==4870== For lists of detected and suppressed errors, rerun with: -s ==4870== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0) Segmentation fault (core dumped) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 02:04:27 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 06 Apr 2021 06:04:27 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1617689067.15.0.341544234051.issue43176@roundup.psfhosted.org> Eric V. Smith added the comment: Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 02:37:16 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 06 Apr 2021 06:37:16 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. Message-ID: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> New submission from Shreyan Avigyan : In the example code of the Extending Python with C/C++ documentation the pmodule variable (that stores the return value of PyImport_ImportModule) was never declared. The PR(s) attached to this issue fixes it by declaring and initializing the pmodule variable. This issue is common in all the documentation versions. The first PR will be for documentation version 3.10. If it's accepted then I would request other developers to submit PRs for documentation 3.9, 3.8, 3.7 and 3.6 because I'm having a problem switching to those branches (I'm continuously facing the problem "HEAD detached" if I switch to those branches). Thanking you With Regards ---------- assignee: docs at python components: Documentation messages: 390281 nosy: docs at python, shreyanavigyan priority: normal severity: normal status: open title: Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. type: compile error versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 02:46:09 2021 From: report at bugs.python.org (Roundup Robot) Date: Tue, 06 Apr 2021 06:46:09 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1617691569.77.0.9557960075.issue43739@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +23946 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25207 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 02:51:18 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 06 Apr 2021 06:51:18 +0000 Subject: [issue43599] Setting long domain of locale.dgettext() crashes Python interpreter In-Reply-To: <1616464498.74.0.582898049043.issue43599@roundup.psfhosted.org> Message-ID: <1617691878.57.0.527403864537.issue43599@roundup.psfhosted.org> Christian Heimes added the comment: The crash occurs inside glibc's dgettext() implementation. Its man page does not list any limitation for domain or msgid length. This looks like a bug in glibc. #0 0x00007ffff7c57a8f in __dcigettext () from /lib64/libc.so.6 #1 0x000000000058a235 in _locale_dgettext_impl (in=0x7fffea64d8e0 "", domain=0x7fffe874e040 "absabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsab"..., module=) at ./Modules/_localemodule.c:662 ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 02:54:38 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Tue, 06 Apr 2021 06:54:38 +0000 Subject: [issue43664] Long computations in pdb.run() lead to segfault In-Reply-To: <1617078944.41.0.741182615703.issue43664@roundup.psfhosted.org> Message-ID: <1617692078.03.0.466048707597.issue43664@roundup.psfhosted.org> Xinmeng Xia added the comment: pdb.run() seems crashing different positions of Python (Python/ast_opt.c:488 for pdb.run, Python/ast_opt.c:494 for compile()). But the commit 364d0d20f924071b749e5a889eca22628f4892a3, PR 23744, bpo-42609 for compile() also fix this bug in pdb.run(). Should we close this issue and mark it as fixed? $ gdb ./python (gdb) run Python 3.10.0a6 (default, Mar 19 2021, 11:45:56) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> compile("1+2" * 1000000, "-", "exec") Program received signal SIGSEGV, Segmentation fault. 0x000000000063aedc in astfold_expr (node_=0xf5707d0, ctx_=0x7ffff6282450, state=0x7fffffffd608) at Python/ast_opt.c:494 494 CALL(astfold_expr, expr_ty, node_->v.BinOp.left); (gdb) run Python 3.10.0a6 (default, Mar 19 2021, 11:45:56) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pdb >>> pdb.run("1+2"*1000000) Program received signal SIGSEGV, Segmentation fault. 0x000000000063ac8f in astfold_expr (node_=0xf59b810, ctx_=0x7ffff61f7c30, state=0x7fffffffd1c8) at Python/ast_opt.c:488 488 { (gdb) $gdb '/home/xxm/Downloads/cpython-364d0d20f924071b749e5a889eca22628f4892a3/python' (gdb) run Python 3.10.0a3+ (default, Apr 6 2021, 11:24:27) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> compile("1+2" * 1000000, "-", "exec") Traceback (most recent call last): File "", line 1, in RecursionError: maximum recursion depth exceeded during compilation >>> import pdb >>> pdb.run("1+2"*1000000) Traceback (most recent call last): File "", line 1, in File "/home/xxm/Downloads/cpython-364d0d20f924071b749e5a889eca22628f4892a3/Lib/pdb.py", line 1597, in run Pdb().run(statement, globals, locals) File "/home/xxm/Downloads/cpython-364d0d20f924071b749e5a889eca22628f4892a3/Lib/bdb.py", line 577, in run cmd = compile(cmd, "", "exec") RecursionError: maximum recursion depth exceeded during compilation ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 03:11:07 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Tue, 06 Apr 2021 07:11:07 +0000 Subject: [issue43740] Long paths in imp.load_dynamic() lead to segfault Message-ID: <1617693067.85.0.367644803477.issue43740@roundup.psfhosted.org> New submission from Xinmeng Xia : Long paths as arguments of imp.load_dynamic() lead to interpreter crashes. Crash example ===================================================== Python 3.10.0a2 (default, Nov 24 2020, 14:18:46) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import imp >>> imp.load_dynamic('',"abs/"*10000000) Segmentation fault (core dumped) ====================================================== Environment: Ubuntu 16.04, Python 3.92, Python 3.10.0a2 Mac OS Big Sur 11.2.3, Python 3.91, Python 3.10.0a2 Testing with gdb ------------------------------------------------------------------------------------- $gdb ./python (gdb) run Python 3.10.0a6 (default, Mar 19 2021, 11:45:56) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import imp >>> imp.load_dynamic('','abs/'*100000000) Program received signal SIGSEGV, Segmentation fault. memcpy () at ../sysdeps/x86_64/multiarch/../memcpy.S:272 272 ../sysdeps/x86_64/multiarch/../memcpy.S: No such file or directory. Testing with valgrind ------------------------------------------------------------------------------------- xxm at xxm-System-Product-Name:~$ PYTHONMALLOC=malloc_debug valgrind '/home/xxm/Desktop/apifuzz/Python-3.10.0a6/python' ==4923== Memcheck, a memory error detector ==4923== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==4923== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info ==4923== Command: /home/xxm/Desktop/apifuzz/Python-3.10.0a6/python ==4923== Python 3.10.0a6 (default, Mar 19 2021, 11:45:56) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.dgettext('abs'*10,'') '' >>> import imp :1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses >>> imp.load_dynamic('','abs/'*100000000) ==4923== Warning: set address range perms: large range [0x8037040, 0x1fdaf489) (undefined) ==4923== Warning: set address range perms: large range [0x1fdb0040, 0x37b28479) (undefined) ==4923== Warning: set address range perms: large range [0x37b29040, 0x4f8a1441) (undefined) ==4923== Warning: set address range perms: large range [0x37b29028, 0x4f8a1459) (noaccess) ==4923== Warning: set address range perms: large range [0x59eb3040, 0x71c2b460) (undefined) ==4923== Warning: client switching stacks? SP change: 0x1ffeffe460 --> 0x1fe7286028 ==4923== to suppress, use: --max-stackframe=400000056 or greater ==4923== Invalid write of size 8 ==4923== at 0x401513F: _dl_open (dl-open.c:701) ==4923== Address 0x1fe7286028 is on thread 1's stack ==4923== ==4923== ==4923== Process terminating with default action of signal 11 (SIGSEGV) ==4923== Access not within mapped region at address 0x1FE7286028 ==4923== at 0x401513F: _dl_open (dl-open.c:701) ==4923== If you believe this happened as a result of a stack ==4923== overflow in your program's main thread (unlikely but ==4923== possible), you can try to increase the size of the ==4923== main thread stack using the --main-stacksize= flag. ==4923== The main thread stack size used in this run was 8388608. ==4923== Invalid write of size 8 ==4923== at 0x4A2867A: _vgnU_freeres (vg_preloaded.c:57) ==4923== Address 0x1fe7286020 is on thread 1's stack ==4923== ==4923== ==4923== Process terminating with default action of signal 11 (SIGSEGV) ==4923== Access not within mapped region at address 0x1FE7286020 ==4923== at 0x4A2867A: _vgnU_freeres (vg_preloaded.c:57) ==4923== If you believe this happened as a result of a stack ==4923== overflow in your program's main thread (unlikely but ==4923== possible), you can try to increase the size of the ==4923== main thread stack using the --main-stacksize= flag. ==4923== The main thread stack size used in this run was 8388608. ==4923== ==4923== HEAP SUMMARY: ==4923== in use at exit: 1,205,374,369 bytes in 36,250 blocks ==4923== total heap usage: 96,421 allocs, 60,171 frees, 1,616,393,081 bytes allocated ==4923== ==4923== LEAK SUMMARY: ==4923== definitely lost: 0 bytes in 0 blocks ==4923== indirectly lost: 0 bytes in 0 blocks ==4923== possibly lost: 805,237,234 bytes in 35,439 blocks ==4923== still reachable: 400,137,135 bytes in 811 blocks ==4923== suppressed: 0 bytes in 0 blocks ==4923== Rerun with --leak-check=full to see details of leaked memory ==4923== ==4923== For lists of detected and suppressed errors, rerun with: -s ==4923== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0) Segmentation fault (core dumped) ---------- components: Library (Lib) messages: 390284 nosy: xxm priority: normal severity: normal status: open title: Long paths in imp.load_dynamic() lead to segfault type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 03:25:32 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 06 Apr 2021 07:25:32 +0000 Subject: [issue43599] Setting long domain of locale.dgettext() crashes Python interpreter In-Reply-To: <1616464498.74.0.582898049043.issue43599@roundup.psfhosted.org> Message-ID: <1617693932.47.0.94993787238.issue43599@roundup.psfhosted.org> Serhiy Storchaka added the comment: __dcigettext() contains: domainname_len = strlen (domainname); xdomainname = (char *) alloca (strlen (categoryname) + domainname_len + 5); It tries to allocate a buffer on stack, and for domain name causes stack overflow. There is no portable way to restore after stack overflow or to check it ahead. We can add arbitrary limit for the length of domain name, but it does not guarantee anything. It is just yet one way to crash Python from Python code. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 03:35:32 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 06 Apr 2021 07:35:32 +0000 Subject: [issue43664] Long computations in pdb.run() lead to segfault In-Reply-To: <1617078944.41.0.741182615703.issue43664@roundup.psfhosted.org> Message-ID: <1617694532.33.0.968287175881.issue43664@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is an old known issue, it is not specific to pdb, but happens with compile(), and it is not fixed yet. >>> compile("+0"*1000000, '?', 'eval') Segmentation fault (core dumped) Stack overflow in recursive call of validate_expr() in at Python/ast.c:223. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 03:36:12 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 06 Apr 2021 07:36:12 +0000 Subject: [issue17305] IDNA2008 encoding is missing In-Reply-To: <1361928766.42.0.728949411958.issue17305@psf.upfronthosting.co.za> Message-ID: <1617694572.72.0.574938161667.issue17305@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +patch nosy: +gregory.p.smith nosy_count: 15.0 -> 16.0 pull_requests: +23948 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25208 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 03:37:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 06 Apr 2021 07:37:22 +0000 Subject: [issue43664] Compiling long expression leads to segfault (again) In-Reply-To: <1617078944.41.0.741182615703.issue43664@roundup.psfhosted.org> Message-ID: <1617694642.34.0.531083893143.issue43664@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- title: Long computations in pdb.run() lead to segfault -> Compiling long expression leads to segfault (again) versions: +Python 3.10, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 03:39:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 06 Apr 2021 07:39:10 +0000 Subject: [issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative In-Reply-To: <1617659396.43.0.525762996462.issue43737@roundup.psfhosted.org> Message-ID: <1617694750.06.0.449359851472.issue43737@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +lemburg, mark.dickinson, rhettinger, stutzbach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 03:43:38 2021 From: report at bugs.python.org (Hynek Petrak) Date: Tue, 06 Apr 2021 07:43:38 +0000 Subject: [issue43741] http.client leaks from self.fp.read() Message-ID: <1617695018.24.0.921353674575.issue43741@roundup.psfhosted.org> New submission from Hynek Petrak : Hi, I wrote an webcrawler, which is using ThreadPoolExecutor to span multiple thread workers, retrieve content of a web using via http.client and saves it to a file. After a couple of thousands requests have been processes, the crawler starts to consume memory rapidly, resulting in consumption of all available memory. tracemalloc shows the memory is not collected from: /usr/lib/python3.9/http/client.py:468: size=47.6 MiB, count=6078, average=8221 B File "/usr/lib/python3.9/http/client.py", line 468 s = self.fp.read() I have tested as well with requests and urllib3 and as they use http.client underneath, the result is always the same. My code around that: def get_html3(session, url, timeout=10): o = urlparse(url) if o.scheme == 'http': cn = http.client.HTTPConnection(o.netloc, timeout=timeout) else: cn = http.client.HTTPSConnection(o.netloc, context=ctx, timeout=timeout) cn.request('GET', o.path, headers=headers) r = cn.getresponse() log.debug(f'[*] [{url}] Status: {r.status} {r.reason}') if r.status not in [400, 403, 404]: ret = r.read().decode('utf-8') else: ret = "" r.close() del r cn.close() del cn return ret ---------- messages: 390287 nosy: HynekPetrak priority: normal severity: normal status: open title: http.client leaks from self.fp.read() type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 03:43:59 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 06 Apr 2021 07:43:59 +0000 Subject: [issue17305] IDNA2008 encoding is missing In-Reply-To: <1361928766.42.0.728949411958.issue17305@psf.upfronthosting.co.za> Message-ID: <1617695039.76.0.137279190018.issue17305@roundup.psfhosted.org> Gregory P. Smith added the comment: My PR merely adds a note to the docs linking to idna on pypi. Don't get excited, it doesn't implement anything. :P re "Once Python has a working idna2008 encoder, we need to address integration into socket, ssl, http, and asyncio module." ... doing that _could_ be the same can of worms the browsers all had to go through? We'd need to decide which behavior we wanted; pure? or matching what browsers do? I suspect that is equivalent to the pypi idna https://github.com/kjd/idna 's uts46=True + transitional=True mode [*] but anyone doing this work would need to figure that out for sure if we wanted to default to behaving like browsers with the transitional compatibility mode. That there is a need for a couple options on top of idna2008 as an encoding suggests it may not be a great fit for the Python codecs encodings system as those use a single string name. We'd need to permute the useful possible combos of flag behavior in the names. idna2003, idna2008, idna2008uts46, idna2008uts46transitional, and other combos of those if alternate combinations are deemed relevant. I worry that a browser-transitional-behavior-matching situation may change over time as TLDs decide when to change their policies. Is that an irrational fear? Browsers are well equipped to deal with this as they've got frequent updates. A PyPI package could as well. [*] Browser history: fwiw people wondering _why_ browsers like Chrome and Firefox don't "just blindly use idna2008 for everything" should go read the backwards compatibility transitional rationale and security concerns in https://bugs.chromium.org/p/chromium/issues/detail?id=61328 and https://bugzilla.mozilla.org/show_bug.cgi?id=479520 (caution: be ready to filter out the random internet whiners from those threads) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 03:44:00 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 06 Apr 2021 07:44:00 +0000 Subject: [issue43738] Clarify public name of curses.window In-Reply-To: <1617665861.34.0.620299558452.issue43738@roundup.psfhosted.org> Message-ID: <1617695040.3.0.992701315073.issue43738@roundup.psfhosted.org> Serhiy Storchaka added the comment: It could help also in help(). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 03:44:34 2021 From: report at bugs.python.org (Hynek Petrak) Date: Tue, 06 Apr 2021 07:44:34 +0000 Subject: [issue43741] http.client leaks from self.fp.read() In-Reply-To: <1617695018.24.0.921353674575.issue43741@roundup.psfhosted.org> Message-ID: <1617695074.26.0.498039808813.issue43741@roundup.psfhosted.org> Hynek Petrak added the comment: Python 3.9.2 on Kali Linux. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 03:46:44 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 06 Apr 2021 07:46:44 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1617695204.83.0.161629552406.issue41486@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 03:55:19 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 06 Apr 2021 07:55:19 +0000 Subject: [issue43684] Add combined opcodes In-Reply-To: <1617230432.54.0.49540913796.issue43684@roundup.psfhosted.org> Message-ID: <1617695719.58.0.173883813552.issue43684@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 03:56:10 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Apr 2021 07:56:10 +0000 Subject: [issue17305] IDNA2008 encoding is missing In-Reply-To: <1361928766.42.0.728949411958.issue17305@psf.upfronthosting.co.za> Message-ID: <1617695770.63.0.996093063011.issue17305@roundup.psfhosted.org> miss-islington added the comment: New changeset 1d023e374cf96d143b065242131ddc9b889f9a1e by Gregory P. Smith in branch 'master': bpo-17305: Link to the third-party idna package. (GH-25208) https://github.com/python/cpython/commit/1d023e374cf96d143b065242131ddc9b889f9a1e ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 03:56:17 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Apr 2021 07:56:17 +0000 Subject: [issue17305] IDNA2008 encoding is missing In-Reply-To: <1361928766.42.0.728949411958.issue17305@psf.upfronthosting.co.za> Message-ID: <1617695777.56.0.640004927652.issue17305@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +23949 pull_request: https://github.com/python/cpython/pull/25210 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 03:56:27 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Apr 2021 07:56:27 +0000 Subject: [issue17305] IDNA2008 encoding is missing In-Reply-To: <1361928766.42.0.728949411958.issue17305@psf.upfronthosting.co.za> Message-ID: <1617695787.59.0.62567458227.issue17305@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +23950 pull_request: https://github.com/python/cpython/pull/25211 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 04:01:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 06 Apr 2021 08:01:22 +0000 Subject: [issue43684] Add combined opcodes In-Reply-To: <1617230432.54.0.49540913796.issue43684@roundup.psfhosted.org> Message-ID: <1617696082.74.0.662187821718.issue43684@roundup.psfhosted.org> Serhiy Storchaka added the comment: Interesting. What code did you use to collect statistics? I used patches in issue27255. Perhaps it is worth to add an optionally compiled code for collecting dynamic opcode statistics permanently. We have around 125 opcodes, so 0.5% looks too small. But what is the range of that opcode? How many opcodes are more frequent? And what is the range of BINARY_ADD for comparison. RETURN_CONST or RETURN_NONE was already discussed before. They can save few bytes in bytecode, but they are never used in tight loops and the time difference is dwarfed by the frame creation overhead in any case. For frequently used pairs of opcodes we have the PREDICT() macros which reduces overhead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 04:03:02 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 06 Apr 2021 08:03:02 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1617696182.14.0.648655974149.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 489c36920e94bfb4988b6f965bd0aafdfaff0d4f by Inada Naoki in branch 'master': bpo-43651: PEP 597: Fix pdeps used locale encoding (GH-25204) https://github.com/python/cpython/commit/489c36920e94bfb4988b6f965bd0aafdfaff0d4f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 04:05:49 2021 From: report at bugs.python.org (Yanghao Hua) Date: Tue, 06 Apr 2021 08:05:49 +0000 Subject: [issue43736] asyncio create_task() odd behavior In-Reply-To: <1617657825.63.0.218954805022.issue43736@roundup.psfhosted.org> Message-ID: Yanghao Hua added the comment: This unfortunately contradicts to all the other concurrency semantics I know, I have myself implemented various event-driven schedulers and none of them would behave like this. Consider an OS as the simplest example, you have a main thread that starts many child threads, there shouldn't be a single case (not even a possibility) that starting a child thread would block the main thread. And coming back to this particular example, semantically equivalent code, producing completely different behavior for me is a major bug. The correct way to implement "await a_task" should be like "process().run()", rather than waiting for completion. After all, "await t0" did *NOT* wait until t0's completion! but if you wrote "await create_task()" it does wait ...! seems not right to me. I strongly ask for a second opinion before we close this bug ... On Mon, Apr 5, 2021 at 11:23 PM Zachary Ware wrote: > > > Zachary Ware added the comment: > > You missed something :) > > By immediately awaiting the result of `create_task`, you're synchronizing thing. It's the same as just rearranging the lines of the first example to: > > t0 = create_task(task("T0", 10)) > print("starting tasks ...") > await t0 > t1 = create_task(task("T1", 10)) > await t1 > > Basically, `t1` simply doesn't exist yet when you ask `t0` to run to completion. > > ---------- > nosy: +zach.ware > resolution: -> not a bug > status: open -> pending > > _______________________________________ > Python tracker > > _______________________________________ ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 04:07:33 2021 From: report at bugs.python.org (julian colomina) Date: Tue, 06 Apr 2021 08:07:33 +0000 Subject: [issue43742] tcp_echo_client in asyncio streams example does not work. Hangs for ever at reaser.read() Message-ID: <1617696453.27.0.575129983051.issue43742@roundup.psfhosted.org> New submission from julian colomina : taking the example verbatim into an ubuntu 20.04 with Python 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0] on linux will hand indefinitely at data = await reader.read(100) changing for data = await asyncio.wait_for(reader.read(100),5) will always leave on timeout. ---------- components: asyncio messages: 390295 nosy: asvetlov, jcolo, yselivanov priority: normal severity: normal status: open title: tcp_echo_client in asyncio streams example does not work. Hangs for ever at reaser.read() type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 04:19:25 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Apr 2021 08:19:25 +0000 Subject: [issue17305] IDNA2008 encoding is missing In-Reply-To: <1361928766.42.0.728949411958.issue17305@psf.upfronthosting.co.za> Message-ID: <1617697165.66.0.0771977736657.issue17305@roundup.psfhosted.org> miss-islington added the comment: New changeset c7ccb0ff61e443633d0c54cb18b5633a8e95b30c by Miss Islington (bot) in branch '3.9': bpo-17305: Link to the third-party idna package. (GH-25208) https://github.com/python/cpython/commit/c7ccb0ff61e443633d0c54cb18b5633a8e95b30c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 04:21:31 2021 From: report at bugs.python.org (Pablo Conesa) Date: Tue, 06 Apr 2021 08:21:31 +0000 Subject: [issue43743] BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS. Message-ID: <1617697291.82.0.0904085621091.issue43743@roundup.psfhosted.org> New submission from Pablo Conesa : Hi, one of our users is reporting this starting to happen in a GPFS. All has been working fine for NTFS so far for many years. I had a look at my shutil code, and I can see the try/except code trying to fall back to the "slower" copyfileobj(fsrc, fdst). But it seems, by the stacktrace bellow that the "catch" is not happening. Any idea how to fix this? I guess something like: import shutil shutil._USE_CP_SENDFILE = False should avoid the fast_copy attempt. > Traceback (most recent call last): > File "/opt/pxsoft/scipion/v3/ubuntu20.04/scipion-em-esrf/esrf/workflow/esrf_launch_workflow.py", line 432, in > project.scheduleProtocol(prot) > File "/opt/pxsoft/scipion/v3/ubuntu20.04/anaconda3/envs/.scipion3env/lib/python3.8/site-packages/pyworkflow/project/project.py", line 633, in scheduleProtocol > pwutils.path.copyFile(self.dbPath, protocol.getDbPath()) > File "/opt/px/scipion/v3/ubuntu20.04/anaconda3/envs/.scipion3env/lib/python3.8/site-packages/pyworkflow/utils/path.py", line 247, in copyFile > shutil.copy(source, dest) > File "/opt/pxsoft/scipion/v3/ubuntu20.04/anaconda3/envs/.scipion3env/lib/python3.8/shutil.py", line 415, in copy > copyfile(src, dst, follow_symlinks=follow_symlinks) > File "/opt/pxsoft/scipion/v3/ubuntu20.04/anaconda3/envs/.scipion3env/lib/python3.8/shutil.py", line 272, in copyfile > _fastcopy_sendfile(fsrc, fdst) > File "/opt/pxsoft/scipion/v3/ubuntu20.04/anaconda3/envs/.scipion3env/lib/python3.8/shutil.py", line 169, in _fastcopy_sendfile > raise err > File "/opt/pxsoft/scipion/v3/ubuntu20.04/anaconda3/envs/.scipion3env/lib/python3.8/shutil.py", line 149, in _fastcopy_sendfile > sent = os.sendfile(outfd, infd, offset, blocksize) > BlockingIOError: [Errno 11] Resource temporarily unavailable: 'project.sqlite' -> 'Runs/000002_ProtImportMovies/logs/run.db' ---------- components: IO messages: 390297 nosy: p.conesa.mingo priority: normal severity: normal status: open title: BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS. type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 04:31:33 2021 From: report at bugs.python.org (Yanghao Hua) Date: Tue, 06 Apr 2021 08:31:33 +0000 Subject: [issue43736] asyncio create_task() odd behavior In-Reply-To: <1617656580.62.0.948466534657.issue43736@roundup.psfhosted.org> Message-ID: <1617697893.88.0.194846989424.issue43736@roundup.psfhosted.org> Yanghao Hua added the comment: Poking around a bit more revealed another interesting behavior and now I understand what went wrong with asyncio.create_task() :-) In the example I show, you don't have to "await t1", you only have to "await t0/t1", e.g. await on one of them, and both starts executing. And it seems the synchronized call to "create_task()" alone, already created the task and placed it in a runnable queue. This is wrong!!! Consider in multiprocessing.Process(), do you place the new process in a runnable queue with a call to Process()? NO, you don't. You merely create a process object out of it. And it is Process().run() that actually flags the process is ready to run and let the OS kernel actually create that process. By analogy, calling synchronized "create_task()" shouldn't do more than create a coroutine task object. And "await task" should not simply blocking and waiting for completion of the task, but rather it place task in the runnable queue. Also, the current behavior not only awaits on t0 to complete, it also awaits t1 to complete! completely contradictrary when you look at the code and it is simply "await t0" and t1 was not even in the picture! The example works at all because if both t0 and t1 are created with create_task(), it already creating side-effects and are placed in the running queue. That is like a user-mode code is causing a side-effect in the OS kernel. "await task" is the equivalent of making the actual OS kernel syscall to get things REALLY started ... ---------- resolution: not a bug -> remind _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 04:45:51 2021 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 06 Apr 2021 08:45:51 +0000 Subject: [issue43736] asyncio create_task() odd behavior In-Reply-To: <1617656580.62.0.948466534657.issue43736@roundup.psfhosted.org> Message-ID: <1617698751.56.0.363462259045.issue43736@roundup.psfhosted.org> Andrew Svetlov added the comment: 1. Please consider `await` as a 'yield point': the point where the current task may be suspended to get other tasks a chance to be executed. It can be any `await`, not necessarily waiting for a task. Just a point where asyncio event loop gives a chance to roll an iteration. Note: no suspension happens if the argument is 'ready' already. 2. If we design asyncio from scratch we can consider the separation of task creation and start. Unfortunately, the ship has sailed many years ago. The behavior cannot be changed without breaking virtually every asyncio program, sorry. ---------- resolution: remind -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 05:04:16 2021 From: report at bugs.python.org (Yanghao Hua) Date: Tue, 06 Apr 2021 09:04:16 +0000 Subject: [issue43736] asyncio create_task() odd behavior In-Reply-To: <1617698751.56.0.363462259045.issue43736@roundup.psfhosted.org> Message-ID: Yanghao Hua added the comment: by the way, another feedback, of course, curio works the way it should, no matter where do you await ;-) Now I start to understand why David Beazley has to create curio. Python asyncio team should really really think about it carefully, please. You don't have to modify create_task(), at least a sane version (maybe create_task_sane()) could be provided. On Tue, Apr 6, 2021 at 10:46 AM Andrew Svetlov wrote: > > > Andrew Svetlov added the comment: > > 1. Please consider `await` as a 'yield point': the point where the current task may be suspended to get other tasks a chance to be executed. > It can be any `await`, not necessarily waiting for a task. Just a point where asyncio event loop gives a chance to roll an iteration. > > Note: no suspension happens if the argument is 'ready' already. > > 2. If we design asyncio from scratch we can consider the separation of task creation and start. Unfortunately, the ship has sailed many years ago. The behavior cannot be changed without breaking virtually every asyncio program, sorry. > > ---------- > resolution: remind -> not a bug > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 05:16:25 2021 From: report at bugs.python.org (Matthias Urlichs) Date: Tue, 06 Apr 2021 09:16:25 +0000 Subject: [issue43744] enum: Adding a var named _anything__ raises IndexError Message-ID: <1617700585.14.0.506924714072.issue43744@roundup.psfhosted.org> New submission from Matthias Urlichs : While checking out the Enum implementation I noticed that this code snippet results in an IndexError. I have no idea which error or warning (if any) this should generate instead. Opinions? import enum class duh(enum.Enum): _duh__ = "moo" ---------- components: Library (Lib) messages: 390301 nosy: smurfix priority: normal severity: normal status: open title: enum: Adding a var named _anything__ raises IndexError type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 05:19:16 2021 From: report at bugs.python.org (Matthias Urlichs) Date: Tue, 06 Apr 2021 09:19:16 +0000 Subject: [issue43744] enum: Adding a member named _anything__ raises IndexError In-Reply-To: <1617700585.14.0.506924714072.issue43744@roundup.psfhosted.org> Message-ID: <1617700756.86.0.122537915155.issue43744@roundup.psfhosted.org> Change by Matthias Urlichs : ---------- title: enum: Adding a var named _anything__ raises IndexError -> enum: Adding a member named _anything__ raises IndexError _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 05:19:52 2021 From: report at bugs.python.org (Matthias Urlichs) Date: Tue, 06 Apr 2021 09:19:52 +0000 Subject: [issue43744] enum: Adding a member named _classname__ raises IndexError In-Reply-To: <1617700585.14.0.506924714072.issue43744@roundup.psfhosted.org> Message-ID: <1617700792.67.0.0808563502381.issue43744@roundup.psfhosted.org> Change by Matthias Urlichs : ---------- title: enum: Adding a member named _anything__ raises IndexError -> enum: Adding a member named _classname__ raises IndexError _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 06:14:41 2021 From: report at bugs.python.org (Anthony Flury) Date: Tue, 06 Apr 2021 10:14:41 +0000 Subject: [issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative In-Reply-To: <1617659396.43.0.525762996462.issue43737@roundup.psfhosted.org> Message-ID: <1617704081.08.0.95609887893.issue43737@roundup.psfhosted.org> Anthony Flury added the comment: I take your point about warnings etc - but when you come from other languages the Python behavior can initially be very surprising. The reference section has always seemed to be a very technical document, certainly not targeted at the usual audience of people using Python. Most Python users don't consider that int/float etc would be in the standard library either - for most users the built-ins are not the same. Can I suggest: 1) The identity that is mentioned on https://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations should be made more clear - at the moment it is buried in a paragraph and easily missed. 2) The document https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex should also mention the identity and the need to preserve it. 3) A link fromhttps://docs.python.org/3/tutorial/introduction.html#numbers to the document https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex - the introductory tutorial should link to further detail where neccessary. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 06:23:58 2021 From: report at bugs.python.org (Bill Collins) Date: Tue, 06 Apr 2021 10:23:58 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 Message-ID: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> New submission from Bill Collins : >>> import sys,ssl >>> sys.version '3.9.4 (tags/v3.9.4:1f2e308, Apr 4 2021, 13:27:16) [MSC v.1928 64 bit (AMD64)]' >>> ssl.OPENSSL_VERSION 'OpenSSL 1.1.1i 8 Dec 2020' I may well be holding it wrong, but something seems off. ---------- components: Windows messages: 390303 nosy: Bill Collins, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 type: security versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 06:37:43 2021 From: report at bugs.python.org (conchylicultor) Date: Tue, 06 Apr 2021 10:37:43 +0000 Subject: [issue43746] Weird typing annotation closure behavior Message-ID: <1617705463.18.0.247710543326.issue43746@roundup.psfhosted.org> New submission from conchylicultor : I observe some strange closure behavior for typing annotations when the name is defined ``` x: x = 1 # Works, __annotation__ == {'x': 1} ``` This creates issue, for example: ``` from ... import losses class A: # AttributeError: 'Losses' object has no attribute 'Losses' losses: losses.Losses = losses.Losses() ``` ---------- messages: 390304 nosy: conchylicultor priority: normal severity: normal status: open title: Weird typing annotation closure behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 06:38:48 2021 From: report at bugs.python.org (conchylicultor) Date: Tue, 06 Apr 2021 10:38:48 +0000 Subject: [issue43746] Weird typing annotation closure behavior In-Reply-To: <1617705463.18.0.247710543326.issue43746@roundup.psfhosted.org> Message-ID: <1617705528.77.0.41217480641.issue43746@roundup.psfhosted.org> Change by conchylicultor : ---------- components: +Interpreter Core type: -> behavior versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 06:42:18 2021 From: report at bugs.python.org (conchylicultor) Date: Tue, 06 Apr 2021 10:42:18 +0000 Subject: [issue43746] Weird typing annotation closure behavior In-Reply-To: <1617705463.18.0.247710543326.issue43746@roundup.psfhosted.org> Message-ID: <1617705738.96.0.0905256827622.issue43746@roundup.psfhosted.org> Change by conchylicultor : ---------- components: +Library (Lib) -Interpreter Core _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 06:49:03 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 06 Apr 2021 10:49:03 +0000 Subject: [issue43683] Handle generator (and coroutine) state in the bytecode. In-Reply-To: <1617209103.34.0.926095267338.issue43683@roundup.psfhosted.org> Message-ID: <1617706143.12.0.761941734249.issue43683@roundup.psfhosted.org> Mark Shannon added the comment: New changeset b37181e69209746adc2119c471599a1ea5faa6c8 by Mark Shannon in branch 'master': bpo-43683: Handle generator entry in bytecode (GH-25138) https://github.com/python/cpython/commit/b37181e69209746adc2119c471599a1ea5faa6c8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 06:51:11 2021 From: report at bugs.python.org (Anthony Flury) Date: Tue, 06 Apr 2021 10:51:11 +0000 Subject: [issue43325] Documentation should warn that 'is' is not a safe comparison operator for most values. In-Reply-To: <1614294680.42.0.115546489096.issue43325@roundup.psfhosted.org> Message-ID: <1617706271.51.0.553203004272.issue43325@roundup.psfhosted.org> Anthony Flury added the comment: Should the data structures page also link to the FAQ. The problem with the FAQ is that most beginners don't even know that == vs 'is' is actually a question they need to ask, and therefore they aren't likely to look at the FAQ in the first place. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 07:01:04 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 11:01:04 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617706864.23.0.44516328743.issue43745@roundup.psfhosted.org> Steve Dower added the comment: No, I think I was holding git wrong (and built 1.1.1i again instead of 1.1.1k). Guess we get to do more releases... ---------- nosy: +lukasz.langa priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 07:05:18 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 06 Apr 2021 11:05:18 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617707118.65.0.360244085858.issue43745@roundup.psfhosted.org> Christian Heimes added the comment: Uh :( No more holiday releases, please. The RMs and release team need their vacation. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 07:07:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Apr 2021 11:07:12 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617707232.55.0.981084183516.issue43745@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 07:09:56 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 11:09:56 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617707396.84.0.334040804571.issue43745@roundup.psfhosted.org> Steve Dower added the comment: > No more holiday releases, please. The RMs and release team need their vacation. I agree, can you ask OpenSSL to stop releasing fixes? (or alternatively, can you convince everyone to let us switch to the native TLS stack on Windows where the upstream fixes are released before they are announced to the world ;) ) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 07:13:02 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 06 Apr 2021 11:13:02 +0000 Subject: [issue43744] enum: Adding a member named _classname__ raises IndexError In-Reply-To: <1617700585.14.0.506924714072.issue43744@roundup.psfhosted.org> Message-ID: <1617707582.83.0.0918824120581.issue43744@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +barry, eli.bendersky, ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 07:14:23 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 11:14:23 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617707663.8.0.611061108443.issue43725@roundup.psfhosted.org> Steve Dower added the comment: Anything is better than nothing, from my POV. Let's get it running, tweak it, and if it doesn't work for us then take it down. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 07:15:23 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 06 Apr 2021 11:15:23 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617707723.25.0.298359710671.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ok, will create PRs for the release branches that are receiving fixes ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 07:17:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Apr 2021 11:17:05 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617707825.05.0.668077018969.issue43725@roundup.psfhosted.org> STINNER Victor added the comment: > Also, we can use libabigail. RHEL uses that to provide ABI guarantees on the kernel and the glibc. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 07:20:52 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 06 Apr 2021 11:20:52 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617708052.65.0.269040779383.issue43725@roundup.psfhosted.org> Christian Heimes added the comment: Do we need separate jobs and ABI dumps for each platform and arch? I guess we need at least separate dumps for 32 and 64bit. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 07:35:40 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 11:35:40 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617708940.52.0.369730001454.issue43745@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +23951 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25213 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 07:45:28 2021 From: report at bugs.python.org (conchylicultor) Date: Tue, 06 Apr 2021 11:45:28 +0000 Subject: [issue43746] Weird typing annotation closure behavior In-Reply-To: <1617705463.18.0.247710543326.issue43746@roundup.psfhosted.org> Message-ID: <1617709528.18.0.325343236001.issue43746@roundup.psfhosted.org> conchylicultor added the comment: Interestingly mypy, pylint correctly resolve the closure. ``` class A: dataclasses: dataclasses.Field = dataclasses.field() A.dataclasses.other # mypy error: "Field[Any]" has no attribute "other" ``` So the current workaround is to use quotes: ``` class A: # Type correctly inferred and no closure runtime error losses: 'losses.Losses' = losses.Losses() ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 07:57:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 06 Apr 2021 11:57:25 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617710245.37.0.203911784733.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Do we need separate jobs and ABI dumps for each platform and arch? I guess we need at least separate dumps for 32 and 64bit. Not really, check what happened in my 64 build system when I did the changes that broke the ABI in the latest 3.9 release: 7a3947dec3d8">root at 7a3947dec3d8:/pytho# abidiff Python-3.9.2/python Python-3.9.3/python Functions changes summary: 0 Removed, 3 Changed (53 filtered out), 0 Added functions Variables changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added variable 3 functions with some indirect sub-type change: [C]'function void PyEval_AcquireThread(PyThreadState*)' at ceval.c:381:1 has some indirect sub-type changes: parameter 1 of type 'PyThreadState*' has sub-type changes: in pointed to type 'typedef PyThreadState' at pystate.h:20:1: underlying type 'struct _ts' at pystate.h:51:1 changed: type size hasn't changed 4 data member changes (2 filtered): 'char _ts::recursion_critical' offset changed from 296 to 320 (in bits) (by +24 bits) 'int _ts::stackcheck_counter' offset changed from 320 to 352 (in bits) (by +32 bits) 'int _ts::tracing' offset changed from 352 to 384 (in bits) (by +32 bits) 'int _ts::use_tracing' offset changed from 384 to 416 (in bits) (by +32 bits) 1 data member change: type of 'char _ts::overflowed' changed: type name changed from 'char' to 'int' type size changed from 8 to 32 (in bits) and name of '_ts::overflowed' changed to '_ts::recursion_headroom' at pystate.h:61:1 [C]'function int _PyErr_CheckSignalsTstate(PyThreadState*)' at signalmodule.c:1684:1 has some indirect sub-type changes: parameter 1 of type 'PyThreadState*' has sub-type changes: in pointed to type 'typedef PyThreadState' at pystate.h:20:1: underlying type 'struct _ts' at pystate.h:51:1 changed: type size hasn't changed no data member changes (6 filtered); no data member change (1 filtered); [C]'function void _PyErr_Clear(PyThreadState*)' at errors.c:426:1 has some indirect sub-type changes: parameter 1 of type 'PyThreadState*' has sub-type changes: in pointed to type 'typedef PyThreadState' at pystate.h:20:1: underlying type 'struct _ts' at pystate.h:51:1 changed: type size hasn't changed no data member changes (6 filtered); no data member change (1 filtered); ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 08:00:37 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 06 Apr 2021 12:00:37 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617710437.27.0.873680853656.issue43725@roundup.psfhosted.org> Petr Viktorin added the comment: Not sure what platforms libabigail works on, but the set of stable ABI symbols is platform-specific. Currently it's affected by the MS_WINDOWS and HAVE_FORK defines. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 08:02:22 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 06 Apr 2021 12:02:22 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617710542.56.0.361276870748.issue43745@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Given that the PR is against master is this issue present in Python 3.10 alphas too since last alpha was released today. ---------- nosy: +pablogsal, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 08:05:01 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 12:05:01 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617710701.86.0.704512841843.issue43745@roundup.psfhosted.org> Steve Dower added the comment: It is, but I wouldn't hold up an alpha or beta release because of this. ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 08:08:01 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 12:08:01 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617710881.85.0.528538818757.issue43725@roundup.psfhosted.org> Steve Dower added the comment: I assume it's only doing source analysis, so we can probably force those flags on for the check? Or run multiple checks with the options, but without having to switch platform. Even under MS_WINDOWS, I hope we're not using declarations from the Windows header files in our own public API. If so, those are worth replacing (safely, over time). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 08:08:38 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 12:08:38 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617710918.87.0.529246618928.issue43745@roundup.psfhosted.org> Steve Dower added the comment: New changeset 354b015c176b10ee7e2218ba4f3bbc9455cb893f by Steve Dower in branch 'master': bpo-43745: Actually updates Windows release to OpenSSL 1.1.1k. (GH-25213) https://github.com/python/cpython/commit/354b015c176b10ee7e2218ba4f3bbc9455cb893f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 08:18:11 2021 From: report at bugs.python.org (Anthony Flury) Date: Tue, 06 Apr 2021 12:18:11 +0000 Subject: [issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative In-Reply-To: <1617659396.43.0.525762996462.issue43737@roundup.psfhosted.org> Message-ID: <1617711491.49.0.473428843516.issue43737@roundup.psfhosted.org> Anthony Flury added the comment: I am working on a pull request for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 08:22:14 2021 From: report at bugs.python.org (Kun He) Date: Tue, 06 Apr 2021 12:22:14 +0000 Subject: [issue43747] Can't create new interpreter in multi thread Message-ID: <1617711734.82.0.851064276146.issue43747@roundup.psfhosted.org> New submission from Kun He : Hello, I'm working a C extension interface of Python. I want to create a new interpreter by using the function Py_NewInterpreter() in a new thread, which is created by pthread_create (my test files are in attachment), but there are always errors when calling Py_NewInterpreter() such as "failed: object already tracked by the garbage collector". I suppose that it may be a bug of Python source code? I would like to ask how to solve the problem and create a new interpreter in multi thread in Python C extension? Sincerely, Kun ---------- components: C API files: newinter.tar.xz messages: 390322 nosy: hekun19890913 priority: normal severity: normal status: open title: Can't create new interpreter in multi thread type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file49936/newinter.tar.xz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 08:24:08 2021 From: report at bugs.python.org (Andre Roberge) Date: Tue, 06 Apr 2021 12:24:08 +0000 Subject: [issue43748] Inconsistent grammar in new error message (introduced in 3.10.0a7) Message-ID: <1617711848.38.0.240112674154.issue43748@roundup.psfhosted.org> New submission from Andre Roberge : Python version 3.10.0a7 added a more informative error message for: >>> f"{**k}" File "", line 1 (**k) ^ SyntaxError: f-string: can't use double starred expression here Previously, the message was simply "SyntaxError: invalid syntax". So, this change is certainly a welcome addition. However, as far as I can tell, starting with Python 3.8, all previous uses of "can't" in error messages were replaced by "cannot". Although it is an extremely minor point, it might be preferable for consistency to replace "can't" by "cannot" in this new error message. ---------- components: Interpreter Core messages: 390323 nosy: aroberge priority: normal severity: normal status: open title: Inconsistent grammar in new error message (introduced in 3.10.0a7) versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 08:30:38 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 06 Apr 2021 12:30:38 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617712238.76.0.903812045738.issue43745@roundup.psfhosted.org> ?ukasz Langa added the comment: I elect to replace 3.9.4 Windows installers. 1. It's a Windows installer specific problem, no other users are affected. 2. You can always reinstall. You can tell by the dates reported by the REPL or in fact by checking ssl.OPENSSL_VERSION. 3. There will be 3.9.5 on May 3 anyway soon enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 08:40:04 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 06 Apr 2021 12:40:04 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617712804.34.0.75368297198.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: If I understand correctly, this is analyzing the DWARF information on the binaries, so is quite coupled to the platform you compile to, but you can detect violations that affect other platforms if they share the same code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 08:55:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Apr 2021 12:55:31 +0000 Subject: [issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384) In-Reply-To: <1593075260.88.0.835474638855.issue41111@roundup.psfhosted.org> Message-ID: <1617713731.72.0.514692495807.issue41111@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5787ba4a45492e232f5470c7d2e93763198e4b22 by Hai Shi in branch 'master': bpo-41111: Don't build xxlimited with Py_TRACE_REFS macro (GH-25180) https://github.com/python/cpython/commit/5787ba4a45492e232f5470c7d2e93763198e4b22 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 08:57:38 2021 From: report at bugs.python.org (Athanasius) Date: Tue, 06 Apr 2021 12:57:38 +0000 Subject: [issue41969] ttk.RadioButtons mis-sized under Windows 10 UI Scaling, with dpiAware set true In-Reply-To: <1602090157.47.0.836989772149.issue41969@roundup.psfhosted.org> Message-ID: <1617713858.82.0.164625824184.issue41969@roundup.psfhosted.org> Athanasius added the comment: I excitedy thought that you closing this issue meant that Python 3.9.3 or 3.9.4 had the newer TCL and this fixed. Sadly not. I've just had GitHub build a fresh executable using Python 3.9.4 (as evidenced by `Running on Python v3.9.4 (tags/v3.9.4:1f2e308, Apr 4 2021, 13:14:17) [MSC v.1928 32 bit (Intel)]` in our logging) and this is still broken. Out of a set of three radio buttons only the last is correctly scaled up when first viewed, the other two not being scaled up. When I changed tab (a notebook) and back, even that third one is now not scaled up. Any idea when Python will include a fixed TCL ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 09:00:53 2021 From: report at bugs.python.org (Samuel Thibault) Date: Tue, 06 Apr 2021 13:00:53 +0000 Subject: [issue43747] Can't create new interpreter in multi thread In-Reply-To: <1617711734.82.0.851064276146.issue43747@roundup.psfhosted.org> Message-ID: <1617714053.83.0.79678706211.issue43747@roundup.psfhosted.org> Change by Samuel Thibault : ---------- nosy: +samuel-thibault _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 09:19:25 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 13:19:25 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617715165.26.0.850557245317.issue43745@roundup.psfhosted.org> Steve Dower added the comment: Yeeeessss.... we caaaann.... I think we may regret it, but happy to go with it if you'd prefer. FWIW, the code change isn't necessary if you do a totally clean rebuild. However, most builders do not do totally clean rebuilds, so the code change ensures that they are not caught out. (Confirmation just came through another channel, so I'm doing a rebuild of the v3.9.4 and v3.8.9 tags now.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 09:21:23 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 06 Apr 2021 13:21:23 +0000 Subject: [issue43447] Generate vectorcall code to parse arguments using Argument Clinic In-Reply-To: <1615289664.02.0.198288195908.issue43447@roundup.psfhosted.org> Message-ID: <1617715283.15.0.308447610414.issue43447@roundup.psfhosted.org> Change by Dong-hee Na : ---------- assignee: -> corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 09:26:11 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 13:26:11 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617715571.32.0.679155929331.issue43745@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +23952 pull_request: https://github.com/python/cpython/pull/25214 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 09:27:05 2021 From: report at bugs.python.org (Ian Norton) Date: Tue, 06 Apr 2021 13:27:05 +0000 Subject: [issue43749] venv module does not copy the correct python exe Message-ID: <1617715625.46.0.74507922397.issue43749@roundup.psfhosted.org> New submission from Ian Norton : On windows, the venv module does not copy the correct python exe if the current running exe (eg sys.executable) has been renamed (eg, named python3.exe) venv will only make copies of python.exe, pythonw.exe, python_d.exe or pythonw_d.exe. If for example the python executable has been renamed from python.exe to python3.exe (eg, to co-exist in a system where multiple pythons are on PATH) then this can fail with errors like: Error: [WinError 2] The system cannot find the file specified When venv tries to run pip in the new environment. If the running python executable is a differently named copy then errors like the one described in https://bugs.python.org/issue40588 are seen. ---------- components: Library (Lib) messages: 390329 nosy: Ian Norton priority: normal severity: normal status: open title: venv module does not copy the correct python exe versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 09:30:31 2021 From: report at bugs.python.org (Ian Norton) Date: Tue, 06 Apr 2021 13:30:31 +0000 Subject: [issue43749] venv module does not copy the correct python exe In-Reply-To: <1617715625.46.0.74507922397.issue43749@roundup.psfhosted.org> Message-ID: <1617715831.55.0.93376737744.issue43749@roundup.psfhosted.org> Ian Norton added the comment: This may also cause https://bugs.python.org/issue35644 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 09:41:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Apr 2021 13:41:59 +0000 Subject: [issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1617716519.89.0.453488013805.issue36384@roundup.psfhosted.org> STINNER Victor added the comment: > Withdrawing the readiness - @ambv and I would prefer to see this behind a flag (probably "strict" parsing), on by default for 3.10, and maybe on by default for 3.9/earlier. Last time we added a new parameter in a stable branch, it didn't go well: https://bugs.python.org/issue42967#msg387638 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 09:42:23 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 06 Apr 2021 13:42:23 +0000 Subject: [issue43748] Inconsistent grammar in new error message (introduced in 3.10.0a7) In-Reply-To: <1617711848.38.0.240112674154.issue43748@roundup.psfhosted.org> Message-ID: <1617716543.71.0.149271283503.issue43748@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +gvanrossum, lys.nikolaou, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 09:46:37 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 06 Apr 2021 13:46:37 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1617716797.88.0.157503938365.issue43176@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 8a34a0793bcb830350dac675524310bb285e5e4f by Miss Islington (bot) in branch '3.9': bpo-43176: Fix processing of empty dataclasses (GH-24484) (GH-25205) https://github.com/python/cpython/commit/8a34a0793bcb830350dac675524310bb285e5e4f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 09:52:16 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 06 Apr 2021 13:52:16 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1617717136.05.0.122986024768.issue43176@roundup.psfhosted.org> Change by Eric V. Smith : ---------- pull_requests: +23953 pull_request: https://github.com/python/cpython/pull/25215 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 09:55:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Apr 2021 13:55:10 +0000 Subject: [issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384) In-Reply-To: <1593075260.88.0.835474638855.issue41111@roundup.psfhosted.org> Message-ID: <1617717310.23.0.781870959378.issue41111@roundup.psfhosted.org> STINNER Victor added the comment: Skip Montanaro: "The latest commit seems to break the build if configured --with-trace-refs." Oops, I forgot about this special build mode. Thanks for the reminder Skip, and thanks for the fix Hai ;-) Skip: By the way, I'm curious, why do you use --with-trace-refs? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 09:56:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Apr 2021 13:56:14 +0000 Subject: [issue43574] Regression in overallocation for literal list initialization in v3.9+ In-Reply-To: <1616293914.75.0.599644741052.issue43574@roundup.psfhosted.org> Message-ID: <1617717374.31.0.478689798002.issue43574@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 10:02:50 2021 From: report at bugs.python.org (Ian Norton) Date: Tue, 06 Apr 2021 14:02:50 +0000 Subject: [issue43749] venv module does not copy the correct python exe In-Reply-To: <1617715625.46.0.74507922397.issue43749@roundup.psfhosted.org> Message-ID: <1617717770.05.0.674588726276.issue43749@roundup.psfhosted.org> Change by Ian Norton : ---------- keywords: +patch pull_requests: +23954 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25216 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 10:02:56 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Tue, 06 Apr 2021 14:02:56 +0000 Subject: [issue43748] Inconsistent grammar in new error message (introduced in 3.10.0a7) In-Reply-To: <1617711848.38.0.240112674154.issue43748@roundup.psfhosted.org> Message-ID: <1617717776.19.0.140634293003.issue43748@roundup.psfhosted.org> Lysandros Nikolaou added the comment: We can change the wording to `cannot` in order for all of the error messages to be consistent. Would you like to propose a PR, Andre? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 10:04:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 06 Apr 2021 14:04:26 +0000 Subject: [issue43748] Inconsistent grammar in new error message (introduced in 3.10.0a7) In-Reply-To: <1617711848.38.0.240112674154.issue43748@roundup.psfhosted.org> Message-ID: <1617717866.36.0.16741720319.issue43748@roundup.psfhosted.org> Serhiy Storchaka added the comment: Not all "can't" in error messages were replaced by "cannot". $ find Parser Python Objects Modules -name '*.[ch]' | xargs egrep '".*[Cc]an'\''t.*"' | wc -l 181 $ find Parser Python Objects Modules -name '*.[ch]' | xargs egrep '".*[Cc]annot.*"' | wc -l 247 $ find Lib -name '*.py' | xargs egrep '(["'\'']).*[Cc]an'\''t.*\1' | wc -l 239 $ find Lib -name '*.py' | xargs egrep '(["'\'']).*[Cc]annot.*\1' | wc -l 602 $ find Doc -name '*.rst' | xargs egrep '[Cc]an'\''t' | wc -l 180 $ find Doc -name '*.rst' | xargs egrep '[Cc]annot' | wc -l 482 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 10:08:34 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Apr 2021 14:08:34 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1617718114.52.0.11349277941.issue43176@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +23955 pull_request: https://github.com/python/cpython/pull/25217 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 10:08:47 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 06 Apr 2021 14:08:47 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1617718127.37.0.764588250501.issue43176@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 1744c96ebc98b240f2564f75191097704b37244f by Eric V. Smith in branch 'master': Fix blurb for bpo-43176. (GH-25215) https://github.com/python/cpython/commit/1744c96ebc98b240f2564f75191097704b37244f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 10:08:45 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Apr 2021 14:08:45 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1617718125.5.0.827301307979.issue43176@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +23956 pull_request: https://github.com/python/cpython/pull/25218 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 10:10:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Apr 2021 14:10:00 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1617718200.5.0.234714887271.issue43723@roundup.psfhosted.org> STINNER Victor added the comment: Raymond Hettinger: > I don't think there is any advantage in doing this. It will just break code that has worked for a very long time. Do you mean code written for Python 2? Right, it's unfortunate that it became harder to write a single code base working on Python 2 and Python 2. But Python 2 had officially reached end of life in January 2020, and Python 3.0 changed threading method names 13 years ago (2008). Deprecating and removing aliases are two different things. IMO deprecating is non-controversial, especially because DeprecationWarning is hidden by default. Removing requires to estimate how many projects are impacted. On the top 4000 PyPI projects, I count 80 projects which still call currentThread() for example: that's significant. Example of projects: Twisted, pyuwsgi, PyQt5_sip, mod_wsgi, mercurial, lockfile, jupyterlab, gevent, etc. I didn't check if these projects call current_thread() on Python 3. I would suggest to wait until the most popular PyPI projects no longer call deprecated methods before removing them. I suggest to restrict the PR to deprecatation, and not plan removal yet. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 10:17:41 2021 From: report at bugs.python.org (Andre Roberge) Date: Tue, 06 Apr 2021 14:17:41 +0000 Subject: [issue43748] Inconsistent grammar in new error message (introduced in 3.10.0a7) In-Reply-To: <1617711848.38.0.240112674154.issue43748@roundup.psfhosted.org> Message-ID: <1617718661.36.0.961563535446.issue43748@roundup.psfhosted.org> Andre Roberge added the comment: Since all the messages I track so far (https://github.com/aroberge/friendly/blob/master/friendly/syntax_errors/message_analyzer.py) had been changed when going from 6.7 to 3.8, I had (incorrectly) assumed that all such error messages been changed to use cannot instead of can't. However, based on Serhyi's search, I gather that this is not the case and this specific issue can probably be closed as being irrelevant. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 10:19:05 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Apr 2021 14:19:05 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1617718745.56.0.42133267244.issue43176@roundup.psfhosted.org> miss-islington added the comment: New changeset 76c4a9fb8ae370901b387a4edb609295bcc159e7 by Miss Islington (bot) in branch '3.8': [3.8] Fix blurb for bpo-43176. (GH-25215) (GH-25218) https://github.com/python/cpython/commit/76c4a9fb8ae370901b387a4edb609295bcc159e7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 10:25:53 2021 From: report at bugs.python.org (Anthony Flury) Date: Tue, 06 Apr 2021 14:25:53 +0000 Subject: [issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative In-Reply-To: <1617659396.43.0.525762996462.issue43737@roundup.psfhosted.org> Message-ID: <1617719153.86.0.131514723329.issue43737@roundup.psfhosted.org> Change by Anthony Flury : ---------- keywords: +patch pull_requests: +23957 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25220 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 10:29:48 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 14:29:48 +0000 Subject: [issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1617719388.48.0.574295615985.issue36384@roundup.psfhosted.org> Steve Dower added the comment: The important quote from the linked issue seems to be: > Our new separator= parameter does not allow one to achieve the previous behavior if mixing and matching & And ; was intended to be allowed, as it is a single separator rather than a set of separators. So arguably, we added _the wrong_ parameter in that case, because it only allowed choosing between behaviours not including the "bad" behaviour. We should've added one that was "give me back the previous behaviour". In this case, having it off by default goes further to prevent breakage, and I wouldn't be opposed to a process level opt-in (e.g. a module-level flag), so that _applications_ have a way to force their dependencies to use the safer behaviour without needing to patch them. Similarly, a process level opt-out also seems good enough if we were to have it on by default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 10:30:16 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 06 Apr 2021 14:30:16 +0000 Subject: [issue41870] Use PEP 590 vectorcall to speed up calls to bool() In-Reply-To: <1601212858.37.0.301484827373.issue41870@roundup.psfhosted.org> Message-ID: <1617719416.47.0.274652089494.issue41870@roundup.psfhosted.org> Dong-hee Na added the comment: For the record, following built-in functions now support vectorcall calling convention from Python 3.10!! Thank you to everyone who works with this :) - map: bpo-43575 - filter: bpo-43287 - reversed: bpo-41922 - bool: bpo-41870 - float: bpo-41873 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 10:32:25 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 06 Apr 2021 14:32:25 +0000 Subject: [issue41870] Use PEP 590 vectorcall to speed up calls to bool() In-Reply-To: <1601212858.37.0.301484827373.issue41870@roundup.psfhosted.org> Message-ID: <1617719545.44.0.571173037381.issue41870@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +23958 pull_request: https://github.com/python/cpython/pull/25219 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 10:41:43 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 06 Apr 2021 14:41:43 +0000 Subject: [issue41873] Add vectorcall for float() In-Reply-To: <1601283308.14.0.0300181585929.issue41873@roundup.psfhosted.org> Message-ID: <1617720103.67.0.596561014806.issue41873@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +23959 pull_request: https://github.com/python/cpython/pull/25219 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 10:49:25 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 06 Apr 2021 14:49:25 +0000 Subject: [issue41873] Add vectorcall for float() In-Reply-To: <1601283308.14.0.0300181585929.issue41873@roundup.psfhosted.org> Message-ID: <1617720565.54.0.399182008009.issue41873@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: -23959 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 11:03:59 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 15:03:59 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617721439.61.0.53889687774.issue43745@roundup.psfhosted.org> Steve Dower added the comment: New changeset 611aa39142f156508945ac312724474c493a6691 by Steve Dower in branch '3.9': bpo-43745: Actually updates Windows release to OpenSSL 1.1.1k. (GH-25213) https://github.com/python/cpython/commit/611aa39142f156508945ac312724474c493a6691 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 11:04:07 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Apr 2021 15:04:07 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617721447.63.0.898215652888.issue43745@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 10.0 -> 11.0 pull_requests: +23960 pull_request: https://github.com/python/cpython/pull/25223 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 11:05:38 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 15:05:38 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617721538.56.0.292145081241.issue43745@roundup.psfhosted.org> Steve Dower added the comment: A new 3.9.4 and 3.8.9 release is available for download from python.org. The Nuget and Windows Store packages will have to remain as the original versions, since those do not allow us to overwrite with the same version number. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 11:07:14 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 06 Apr 2021 15:07:14 +0000 Subject: [issue43176] Dataclasses derived from empty frozen bases skip immutability checks In-Reply-To: <1612854759.36.0.400211114548.issue43176@roundup.psfhosted.org> Message-ID: <1617721634.26.0.131285649874.issue43176@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 2df971afd5f29574be3bb44f2d8569cc240b800d by Miss Islington (bot) in branch '3.9': Fix blurb for bpo-43176. (GH-25215) (GH-25217) https://github.com/python/cpython/commit/2df971afd5f29574be3bb44f2d8569cc240b800d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 11:21:46 2021 From: report at bugs.python.org (Tom Cook) Date: Tue, 06 Apr 2021 15:21:46 +0000 Subject: [issue43750] Undefined constant PACKET_MULTIHOST referred to in package socket Message-ID: <1617722506.16.0.590696167901.issue43750@roundup.psfhosted.org> New submission from Tom Cook : The documentation for the `AF_PACKET` address family refers to `PACKET_MULTIHOST`. I believe this should read `PACKET_MULTICAST`, which is defined on Linux systems (`PACKET_MULTIHOST` is not). ---------- assignee: docs at python components: Documentation messages: 390345 nosy: Tom Cook, docs at python priority: normal severity: normal status: open title: Undefined constant PACKET_MULTIHOST referred to in package socket type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 11:22:57 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Apr 2021 15:22:57 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617722577.91.0.939145289991.issue43745@roundup.psfhosted.org> miss-islington added the comment: New changeset 9a988b8cd8344808a03c9a2ba0c9ba2188240eae by Miss Islington (bot) in branch '3.8': bpo-43745: Actually updates Windows release to OpenSSL 1.1.1k. (GH-25213) https://github.com/python/cpython/commit/9a988b8cd8344808a03c9a2ba0c9ba2188240eae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 11:44:07 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 06 Apr 2021 15:44:07 +0000 Subject: [issue41870] Use PEP 590 vectorcall to speed up calls to bool() In-Reply-To: <1601212858.37.0.301484827373.issue41870@roundup.psfhosted.org> Message-ID: <1617723847.02.0.604571734596.issue41870@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset efccff9ac84009ef48e8cb22548ce80940f76533 by Dong-hee Na in branch 'master': bpo-41870: Update What's News 3.10 about vectorcall (#25219) https://github.com/python/cpython/commit/efccff9ac84009ef48e8cb22548ce80940f76533 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 11:57:04 2021 From: report at bugs.python.org (Brett Cannon) Date: Tue, 06 Apr 2021 15:57:04 +0000 Subject: [issue42135] [importlib] Deprecate find_module() & find_loader() mplementations In-Reply-To: <1603494695.54.0.8376376438.issue42135@roundup.psfhosted.org> Message-ID: <1617724624.52.0.0219051255568.issue42135@roundup.psfhosted.org> Brett Cannon added the comment: New changeset 57c6cb5100d19a0e0218c77d887c3c239c9ce435 by Brett Cannon in branch 'master': bpo-42135: Deprecate implementations of find_module() and find_loader() (GH-25169) https://github.com/python/cpython/commit/57c6cb5100d19a0e0218c77d887c3c239c9ce435 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 11:57:17 2021 From: report at bugs.python.org (Brett Cannon) Date: Tue, 06 Apr 2021 15:57:17 +0000 Subject: [issue42135] [importlib] Deprecate find_module() & find_loader() mplementations In-Reply-To: <1603494695.54.0.8376376438.issue42135@roundup.psfhosted.org> Message-ID: <1617724637.08.0.97684351543.issue42135@roundup.psfhosted.org> Change by Brett Cannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 12:00:14 2021 From: report at bugs.python.org (PEW's Corner) Date: Tue, 06 Apr 2021 16:00:14 +0000 Subject: [issue43751] await anext() returns None when default is given Message-ID: <1617724814.14.0.517501509303.issue43751@roundup.psfhosted.org> New submission from PEW's Corner : The new anext() builtin in Python 3.10.0a7 doesn't seem to work properly when a default value is provided as the second argument. Here's an example: import asyncio async def f(): yield 'A' yield 'B' async def main(): g = f() print(await anext(g, 'Z')) # Prints 'None' instead of 'A'!!! print(await anext(g, 'Z')) # Prints 'None' instead of 'B'!!! print(await anext(g, 'Z')) # Prints 'Z' g = f() print(await anext(g)) # Prints 'A' print(await anext(g)) # Prints 'B' print(await anext(g)) # Raises StopAsyncIteration asyncio.run(main()) As indicated above, anext() works fine when no default is given (in the second half of main()), but produces None in every iteration when a default is given (in the first half of main()) except when the iterator is exhausted. ---------- components: Interpreter Core, asyncio messages: 390349 nosy: asvetlov, pewscorner, yselivanov priority: normal severity: normal status: open title: await anext() returns None when default is given type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 12:00:14 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 06 Apr 2021 16:00:14 +0000 Subject: [issue43684] Add combined opcodes In-Reply-To: <1617230432.54.0.49540913796.issue43684@roundup.psfhosted.org> Message-ID: <1617724814.57.0.198295281984.issue43684@roundup.psfhosted.org> Guido van Rossum added the comment: > Interesting. What code did you use to collect statistics? For static statistics I wrote my own script: https://github.com/python/cpython/pull/25090/files#diff-994d3592c951c78cbe71084d562590d1507ddfed767e2ec040f5e2610845a11c. I can add that to Tools permanently (I have a slightly improved version that can look for different things). > I used patches in issue27255. Perhaps it is worth to add an optionally compiled code for collecting dynamic opcode statistics permanently. We have that already: compile with -DDYNAMIC_EXECUTION_PROFILE -DDXPAIRS. There's a script (Tools/scripts/analyze_dxp.py) that works with such data, but it's primitive. Eric is working on improvements; I added my own hacky script to run an app and collect the data. I collected a few different sets of statistics: static stats for the stdlib and for mypy, dynamic stats for running mypy and a few of the benchmarks in pyperformance. Eric and I have plans to do this more systematically; we'll then publish our tools and results. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 12:20:26 2021 From: report at bugs.python.org (Bill Collins) Date: Tue, 06 Apr 2021 16:20:26 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617726026.9.0.160823718688.issue43745@roundup.psfhosted.org> Bill Collins added the comment: Thanks for the quick action on this! I've downloaded the new 3.8.9/3.9.4 installers, but they are unable to run over my existing 3.8.9/3.9.4 installs; "Unable to install python 3.9.4 (64-bit) due to an existing install." This is probably fine as I can just uninstall/reinstall (I hope), so just FYI. I've upgraded my 32-bit install from 3.9.2 to the new 3.9.4 installer without issue. Are you able to also update the embeddable packages please? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 12:38:14 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 06 Apr 2021 16:38:14 +0000 Subject: [issue43748] Inconsistent grammar in new error message (introduced in 3.10.0a7) In-Reply-To: <1617711848.38.0.240112674154.issue43748@roundup.psfhosted.org> Message-ID: <1617727094.59.0.0870682332409.issue43748@roundup.psfhosted.org> Guido van Rossum added the comment: Yeah, I do not think anyone cares. :-) ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 13:19:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Apr 2021 17:19:01 +0000 Subject: [issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1617729541.65.0.12208326274.issue36384@roundup.psfhosted.org> STINNER Victor added the comment: > In this case, having it off by default goes further to prevent breakage PyYAML was unsafe by default: it allowed to execute arbitary Python code by default. It took years to change the default to "safe". I don't think that adding a parameter for opt-in for security is a good approach. An application can use ipaddress internally without being aware of using it, if it's done by a third party module. It's hard to prevent security vulnerabilities if people have to "opt-in" for security. I prefer to break code and force people to manually get back the old behavior. It's better to make 90% safe by default but make 10% of people unhappy. It's uncommon to pass IPv4 addresses with leading zeros. If you want to tolerate leading zeros, you don't have to modify the ipaddress for that, you can pre-process your inputs: it works on any Python version with or without the fix. >>> def reformat_ip(address): return '.'.join(part.lstrip('0') if part != '0' else part for part in address.split('.')) ... >>> reformat_ip('0127.0.0.1') '127.0.0.1' Or with an explicit loop for readability: def reformat_ip(address): parts = [] for part in address.split('.'): if part != "0": part = part.lstrip('0') parts.append(part) return '.'.join(parts) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 13:21:09 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 06 Apr 2021 17:21:09 +0000 Subject: [issue43683] Handle generator (and coroutine) state in the bytecode. In-Reply-To: <1617209103.34.0.926095267338.issue43683@roundup.psfhosted.org> Message-ID: <1617729669.13.0.904009438704.issue43683@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +23961 pull_request: https://github.com/python/cpython/pull/25224 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 13:22:50 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 06 Apr 2021 17:22:50 +0000 Subject: [issue43683] Handle generator (and coroutine) state in the bytecode. In-Reply-To: <1617209103.34.0.926095267338.issue43683@roundup.psfhosted.org> Message-ID: <1617729770.13.0.0430788926738.issue43683@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- nosy: +Dennis Sweeney nosy_count: 1.0 -> 2.0 pull_requests: +23962 pull_request: https://github.com/python/cpython/pull/25225 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 13:27:03 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 06 Apr 2021 17:27:03 +0000 Subject: [issue43683] Handle generator (and coroutine) state in the bytecode. In-Reply-To: <1617209103.34.0.926095267338.issue43683@roundup.psfhosted.org> Message-ID: <1617730023.97.0.706290636608.issue43683@roundup.psfhosted.org> Dennis Sweeney added the comment: Looks like we both opened PRs in the same minute. The MAGIC constant didn't get updated, but perhaps that can just be included in the Minor Corrections PR. I'd bet a CI check could be added to check that if the opcodes change then Python/importlib_external.h changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 13:38:25 2021 From: report at bugs.python.org (Larry Hastings) Date: Tue, 06 Apr 2021 17:38:25 +0000 Subject: [issue43746] Weird typing annotation closure behavior In-Reply-To: <1617705463.18.0.247710543326.issue43746@roundup.psfhosted.org> Message-ID: <1617730705.59.0.675329971228.issue43746@roundup.psfhosted.org> Larry Hastings added the comment: Do you have an actual use case for self-referential annotations? ---------- nosy: +larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 13:38:50 2021 From: report at bugs.python.org (hai shi) Date: Tue, 06 Apr 2021 17:38:50 +0000 Subject: [issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak In-Reply-To: <1565194972.64.0.065323919799.issue37788@roundup.psfhosted.org> Message-ID: <1617730730.11.0.335991922129.issue37788@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 nosy_count: 12.0 -> 13.0 pull_requests: +23963 pull_request: https://github.com/python/cpython/pull/25226 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 14:04:02 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 06 Apr 2021 18:04:02 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1617732242.46.0.238780200768.issue43739@roundup.psfhosted.org> Shreyan Avigyan added the comment: Please have a review of my change in the documentation. (Note: I have not signed the Python CLA because I think a simple fix in the documentation doesn't require it.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 14:20:59 2021 From: report at bugs.python.org (Stefano Rivera) Date: Tue, 06 Apr 2021 18:20:59 +0000 Subject: [issue43312] Interface to select preferred "user" or "home" sysconfig scheme for an environment In-Reply-To: <1614158800.84.0.101101658017.issue43312@roundup.psfhosted.org> Message-ID: <1617733259.29.0.623770921709.issue43312@roundup.psfhosted.org> Change by Stefano Rivera : ---------- nosy: +stefanor _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 14:29:34 2021 From: report at bugs.python.org (Mariusz Felisiak) Date: Tue, 06 Apr 2021 18:29:34 +0000 Subject: [issue43752] Fetching an empty value from date column crashes on SQLite. Message-ID: <1617733774.24.0.888180861121.issue43752@roundup.psfhosted.org> New submission from Mariusz Felisiak : We noticed a regression in Python3.10.0a7 (it works properly in Python3.10.0a6) when running Django's test suite. `convert_date()`[1] is called and crashes when fetching an empty value from `date` column on SQLite: File "python3.10/lib/sqlite3/dbapi2.py", line 64, in convert_date return datetime.date(*map(int, val.split(b"-"))) ValueError: invalid literal for int() with base 10: b'' I will bisect a regression and submit PR. [1] https://github.com/python/cpython/blob/50616223d1043f0f83534ffec38709439b8a49ab/Lib/sqlite3/dbapi2.py#L63-L64 ---------- components: Library (Lib) messages: 390357 nosy: berker.peksag, erlendaasland, felixxm priority: normal severity: normal status: open title: Fetching an empty value from date column crashes on SQLite. type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 14:30:46 2021 From: report at bugs.python.org (Stefano Rivera) Date: Tue, 06 Apr 2021 18:30:46 +0000 Subject: [issue43307] Sync site.py and sysconfig.py with PyPy In-Reply-To: <1614099697.74.0.00793474139311.issue43307@roundup.psfhosted.org> Message-ID: <1617733846.62.0.77842674443.issue43307@roundup.psfhosted.org> Change by Stefano Rivera : ---------- nosy: +stefanor _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 14:33:51 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 06 Apr 2021 18:33:51 +0000 Subject: [issue43307] Sync site.py and sysconfig.py with PyPy In-Reply-To: <1614099697.74.0.00793474139311.issue43307@roundup.psfhosted.org> Message-ID: <1617734031.95.0.696955965316.issue43307@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: -terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 14:38:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Apr 2021 18:38:58 +0000 Subject: [issue43753] [C API] Add Py_IS(x, y) macro Message-ID: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> New submission from STINNER Victor : I propose to add at least Py_Is(x, y) function to the Python C API which would be simply implemented as: static inline int Py_Is(PyObject *x, PyObject *y) { return (x == y); } Right now, there is no benefit for CPython. The idea is to prepare the CPython code base for future optimization, like tagged pointers. It may help PyPy. It can also help to prepare C extensions to migrate to HPy, since HPy requires to use HPy_Is(ctx, x, y): "x == y" (where x and y types is HPy) fails with a compiler error with HPy. -- CPython uses reference counting and singletons like None and False. The "x is y" operator in Python is implemented with the IS_OP opcode implemented in Python/ceval.c as: case TARGET(IS_OP): { PyObject *right = POP(); PyObject *left = TOP(); int res = (left == right)^oparg; PyObject *b = res ? Py_True : Py_False; Py_INCREF(b); SET_TOP(b); Py_DECREF(left); Py_DECREF(right); PREDICT(POP_JUMP_IF_FALSE); PREDICT(POP_JUMP_IF_TRUE); DISPATCH(); } In short, "x is y" in Python simply compares directly PyObject* pointer values in C: "x == y" where x and y are PyObject* pointers. PyPy doesn't use reference counting and so implements "x is y" differently: id(x) == id(y) if I understood correctly. In PyPy, id(obj) is more complex than simply getting the object memory address. For example, id(1) is always 17 in PyPy (on Linux/x86-64 at least). At the C API level, using "x == y" to check if y object "is" x object doesn't work well with PyPy object models. Moreover, "x == Py_None" doesn't work if None is stored as a tagged pointer in CPython. -- Maybe we can also add functions to check if an object is a singleton: * Py_IsNone(x): x == Py_None * Py_IsTrue(x): x == Py_True * Py_IsFalse(x): x == Py_False See also bpo-39511 "[subinterpreters] Per-interpreter singletons (None, True, False, etc.)" which may need to replace Py_None singleton with Py_GetNone(). IMO it makes more sense to call Py_IS_NONE(x) function to express that code is run, rather than writing "x == Py_None" as if Py_None is and will always be a variable directly accesssible. Py_IS_TRUE() name sounds like PyObject_IsTrue(). Can it be an issue? Can someone come with a better name? ---------- components: C API messages: 390358 nosy: vstinner priority: normal severity: normal status: open title: [C API] Add Py_IS(x, y) macro versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 14:40:41 2021 From: report at bugs.python.org (Mariusz Felisiak) Date: Tue, 06 Apr 2021 18:40:41 +0000 Subject: [issue43752] Fetching an empty value from date column crashes on SQLite. In-Reply-To: <1617733774.24.0.888180861121.issue43752@roundup.psfhosted.org> Message-ID: <1617734441.89.0.362920921767.issue43752@roundup.psfhosted.org> Mariusz Felisiak added the comment: A regression test: def test_convert_null_date(self): con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_DECLTYPES) cur = con.cursor() cur.execute("CREATE TABLE t (x DATE NULL)") cur.execute("INSERT INTO t (x) VALUES (NULL)") cur.execute("SELECT * FROM t") values = [x[0] for x in cur.fetchall()] self.assertEqual(values, [None]) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 14:43:11 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 06 Apr 2021 18:43:11 +0000 Subject: [issue43752] [sqlite3] Fetching an empty value from date column raises ValueError In-Reply-To: <1617733774.24.0.888180861121.issue43752@roundup.psfhosted.org> Message-ID: <1617734591.44.0.831425603913.issue43752@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- title: Fetching an empty value from date column crashes on SQLite. -> [sqlite3] Fetching an empty value from date column raises ValueError _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 14:56:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Apr 2021 18:56:53 +0000 Subject: [issue43753] [C API] Add Py_IS(x, y) macro In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617735413.96.0.84362935801.issue43753@roundup.psfhosted.org> STINNER Victor added the comment: Python has more singletons. In C: * Py_NotImplemented: NotImplemented * Py_Ellipsis: Ellipsis But I don't think that "x == NotImplemented" is common enough to justify a new function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 15:02:02 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Apr 2021 19:02:02 +0000 Subject: [issue43753] [C API] Add Py_IS(x, y) macro In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617735722.96.0.667990158392.issue43753@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +23964 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25227 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 15:02:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Apr 2021 19:02:28 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617735748.98.0.170180389747.issue43753@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: [C API] Add Py_IS(x, y) and Py_IsNone(x) functions -> [C API] Add Py_Is(x, y) and Py_IsNone(x) functions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 15:02:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Apr 2021 19:02:24 +0000 Subject: [issue43753] [C API] Add Py_IS(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617735744.59.0.349744501637.issue43753@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: [C API] Add Py_IS(x, y) macro -> [C API] Add Py_IS(x, y) and Py_IsNone(x) functions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 15:03:09 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 19:03:09 +0000 Subject: [issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1617729541.65.0.12208326274.issue36384@roundup.psfhosted.org> Message-ID: <776b7706-a414-fcc7-24e5-1d35da9afe98@python.org> Steve Dower added the comment: > I don't think that adding a parameter for opt-in for security is a good approach. I meant to have it set by default on 3.10, when we do not have to worry about breaking users. If it takes years for users to get to 3.10, we should reevaluate our release cycle, not whether we aggressively break maintenance releases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 15:03:26 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 06 Apr 2021 19:03:26 +0000 Subject: [issue43751] await anext() returns None when default is given In-Reply-To: <1617724814.14.0.517501509303.issue43751@roundup.psfhosted.org> Message-ID: <1617735806.04.0.0273592746238.issue43751@roundup.psfhosted.org> Dennis Sweeney added the comment: I can open a PR this evening, but I think this is close to the issue: PyIter_Next() already silences StopIteration, so checking for it afterward fails. diff --git a/Objects/iterobject.c b/Objects/iterobject.c index f0c6b79917..95f4659dc9 100644 --- a/Objects/iterobject.c +++ b/Objects/iterobject.c @@ -316,7 +316,7 @@ anextawaitable_traverse(anextawaitableobject *obj, visitproc visit, void *arg) static PyObject * anextawaitable_iternext(anextawaitableobject *obj) { - PyObject *result = PyIter_Next(obj->wrapped); + PyObject *result = (*Py_TYPE(obj->wrapped)->tp_iternext)(obj->wrapped); if (result != NULL) { return result; } ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 15:05:19 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 19:05:19 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617726026.9.0.160823718688.issue43745@roundup.psfhosted.org> Message-ID: Steve Dower added the comment: > Are you able to also update the embeddable packages please? They've been updated, it's just the CDN hasn't purged those files. I need to add those files to the script. It should show up within 24 hours, if I don't start doing the script tonight. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 15:07:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Apr 2021 19:07:08 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617736028.57.0.404009755359.issue43753@roundup.psfhosted.org> STINNER Victor added the comment: Py_IS_TYPE(obj, type) was added to Python 3.9 by bpo-39573: https://docs.python.org/dev/c-api/structures.html#c.Py_IS_TYPE commit d905df766c367c350f20c46ccd99d4da19ed57d8 Author: Dong-hee Na Date: Fri Feb 14 02:37:17 2020 +0900 bpo-39573: Add Py_IS_TYPE() function (GH-18488) Co-Author: Neil Schemenauer It's currently implemented as: static inline int _Py_IS_TYPE(const PyObject *ob, const PyTypeObject *type) { return Py_TYPE(ob) == type; } #define Py_IS_TYPE(ob, type) _Py_IS_TYPE(_PyObject_CAST_CONST(ob), type) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 15:12:33 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 06 Apr 2021 19:12:33 +0000 Subject: [issue43752] [sqlite3] Fetching an empty value from date column raises ValueError In-Reply-To: <1617733774.24.0.888180861121.issue43752@roundup.psfhosted.org> Message-ID: <1617736353.75.0.193308692373.issue43752@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch pull_requests: +23965 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25228 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 15:23:43 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 06 Apr 2021 19:23:43 +0000 Subject: [issue43752] [sqlite3] Fetching an empty value from date column raises ValueError In-Reply-To: <1617733774.24.0.888180861121.issue43752@roundup.psfhosted.org> Message-ID: <1617737023.82.0.0691531797686.issue43752@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Thanks for the report and the test case! :) Regression was introduced by e161ec5dd7ba9355eb06757b9304019ac53cdf69, where it was assumed that the handling of zero-sized blobs should be consistent. Unfortunately, the handling of zero-sized blobs is not consistent. Zero-sized blobs _with_ converters must return None; zero-sized blobs _without_ converters must return b"". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 15:27:53 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 06 Apr 2021 19:27:53 +0000 Subject: [issue43752] [sqlite3] Fetching an empty value from date column raises ValueError In-Reply-To: <1617733774.24.0.888180861121.issue43752@roundup.psfhosted.org> Message-ID: <1617737273.97.0.213190877259.issue43752@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: BTW, you might be interested in this bpo, Mariusz: bpo-43553 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 15:37:33 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 06 Apr 2021 19:37:33 +0000 Subject: [issue43752] [sqlite3] Fetching an empty value from date column raises ValueError In-Reply-To: <1617733774.24.0.888180861121.issue43752@roundup.psfhosted.org> Message-ID: <1617737853.47.0.0167050058315.issue43752@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > Zero-sized blobs _with_ converters must return None; zero-sized blobs _without_ converters must return b"". Maybe the docs should be updated to reflect this inconsistency. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 16:00:31 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 06 Apr 2021 20:00:31 +0000 Subject: [issue43754] Eliminate bindings for partial pattern matches Message-ID: <1617739231.38.0.2365910918.issue43754@roundup.psfhosted.org> New submission from Brandt Bucher : This draft PR contains a couple of pattern matching improvements I'm experimenting with. Most significantly, it implements behavior that several people requested during the PEP 634 feedback process: no more name bindings for partial matches. (One caveat: all names are bound *before* evaluating the corresponding guard. If the guard fails, these bindings won't be rolled back before matching the next case.) In short, this is accomplished by storing captured objects on the stack underneath the more immediately important stuff, popping them all on failure or storing them all only once the *entire* pattern for that case matches. The control flow needs to be greatly simplified in order to make this work correctly, so the patch replaces the current "push bools and jump if false a bunch of times" flow with something much more efficient: jumping straight into a run of POP_TOPs on failure. We already do something very similar to this in pattern_helper_sequence_unpack (the comments in the current code explain it well). Parts of the new code are a bit more complex than before (especially or-patterns, which need to do a bit of juggling on the stack to reorder captured items and avoid popping important data on failure), and other parts can certainly still be improved... but I personally consider it a win to have more intuitive partial match behavior with no performance penalty. I thought I'd loop a few of you in on it to hear your thoughts before progressing much further. ---------- assignee: brandtbucher components: Interpreter Core messages: 390368 nosy: Mark.Shannon, brandtbucher, gvanrossum, pablogsal priority: normal severity: normal status: open title: Eliminate bindings for partial pattern matches type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 16:00:41 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 06 Apr 2021 20:00:41 +0000 Subject: [issue43754] Eliminate bindings for partial pattern matches In-Reply-To: <1617739231.38.0.2365910918.issue43754@roundup.psfhosted.org> Message-ID: <1617739241.34.0.206596965201.issue43754@roundup.psfhosted.org> Change by Brandt Bucher : ---------- keywords: +patch pull_requests: +23966 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25229 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 16:07:25 2021 From: report at bugs.python.org (Saiyang Gou) Date: Tue, 06 Apr 2021 20:07:25 +0000 Subject: [issue43755] lambda expression no longer valid at comp_if in Python 3.9 Message-ID: <1617739645.22.0.813638332511.issue43755@roundup.psfhosted.org> New submission from Saiyang Gou : According to the documentation, a lambda expression at the `comp_if` position of a comprehension is allowed (can be parsed as `lambda_expr_nocond`). But this seems broken in Python 3.9 PEG parser. Example: user at host:/$ python3.8 Python 3.8.9 (default, Apr 3 2021, 01:00:00) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> [x for x in range(10) if lambda: 1] [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> user at host:/$ python3.9 Python 3.9.3 (default, Apr 3 2021, 00:51:37) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> [x for x in range(10) if lambda: 1] File "", line 1 [x for x in range(10) if lambda: 1] ^ SyntaxError: invalid syntax ---------- messages: 390369 nosy: gousaiyang priority: normal severity: normal status: open title: lambda expression no longer valid at comp_if in Python 3.9 type: behavior versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 16:21:50 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 06 Apr 2021 20:21:50 +0000 Subject: [issue43755] lambda expression no longer valid at comp_if in Python 3.9 In-Reply-To: <1617739645.22.0.813638332511.issue43755@roundup.psfhosted.org> Message-ID: <1617740510.82.0.698334104021.issue43755@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This looks like a duplicate of https://bugs.python.org/issue41848 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 16:31:48 2021 From: report at bugs.python.org (Saiyang Gou) Date: Tue, 06 Apr 2021 20:31:48 +0000 Subject: [issue43755] lambda expression no longer valid at comp_if in Python 3.9 In-Reply-To: <1617739645.22.0.813638332511.issue43755@roundup.psfhosted.org> Message-ID: <1617741108.22.0.176150154292.issue43755@roundup.psfhosted.org> Saiyang Gou added the comment: OK I didn't find this duplicate issue. After reading that, I think we should update the documentation (https://docs.python.org/3/reference/expressions.html). `comp_if ::= "if" expression_nocond [comp_iter]` can become `comp_if ::= "if" or_test [comp_iter]`, and all `nocond` stuffs can be removed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 16:33:44 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 06 Apr 2021 20:33:44 +0000 Subject: [issue43755] lambda expression no longer valid at comp_if in Python 3.9 In-Reply-To: <1617739645.22.0.813638332511.issue43755@roundup.psfhosted.org> Message-ID: <1617741224.76.0.914404168669.issue43755@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +gvanrossum, lys.nikolaou, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 16:42:03 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 06 Apr 2021 20:42:03 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617741723.78.0.145374661231.issue43725@roundup.psfhosted.org> Gregory P. Smith added the comment: Ideally we'd analyze for a representative set of major platforms we ship binaries on. 32-bit and 64-bit Linux are a start, but we should assume that at least windows and linux toolchains may be different and toss in an additional CPU architecture as default alignment constraints could differ. But getting to that level can remain future work... I'm happy libabigail exists! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 16:43:39 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 06 Apr 2021 20:43:39 +0000 Subject: [issue43684] Add combined opcodes In-Reply-To: <1617230432.54.0.49540913796.issue43684@roundup.psfhosted.org> Message-ID: <1617741819.88.0.274343280112.issue43684@roundup.psfhosted.org> Brandt Bucher added the comment: > I collected a few different sets of statistics: static stats for the stdlib and for mypy, dynamic stats for running mypy and a few of the benchmarks in pyperformance. I'm sure you've considered this, but I'd be *very* careful using opcode stats from the official benchmarks to inform work on these improvements. It's probably better to stick to in-sample data from the stdlib / mypy / etc. and use the benchmarks *only* for measuring out-of-sample results. Otherwise we may just end up hacking the benchmark suite. :) ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 16:44:41 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 06 Apr 2021 20:44:41 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617741880.98.0.251864118552.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Yeah, I subscribe what Greg said. Let's start with *something* and let's improve upon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 16:58:54 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 20:58:54 +0000 Subject: [issue37609] support "UNC" device paths in ntpath.splitdrive In-Reply-To: <1563362794.09.0.456380769613.issue37609@roundup.psfhosted.org> Message-ID: <1617742734.02.0.847591708844.issue37609@roundup.psfhosted.org> Steve Dower added the comment: Once issue43105 is merged, I've got a fairly simple implementation for this using the (new) nt._path_splitroot native method, as well as improved tests that cover both the native and emulated calculations. ---------- assignee: -> steve.dower versions: +Python 3.10 -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 17:21:52 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 06 Apr 2021 21:21:52 +0000 Subject: [issue43755] lambda expression no longer valid at comp_if in Python 3.9 In-Reply-To: <1617739645.22.0.813638332511.issue43755@roundup.psfhosted.org> Message-ID: <1617744112.39.0.214435711913.issue43755@roundup.psfhosted.org> Guido van Rossum added the comment: Oh, nice improvement suggestion for the docs! Do you feel comfortable submitting a small PR for that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 17:27:30 2021 From: report at bugs.python.org (Saiyang Gou) Date: Tue, 06 Apr 2021 21:27:30 +0000 Subject: [issue43755] lambda expression no longer valid at comp_if in Python 3.9 In-Reply-To: <1617739645.22.0.813638332511.issue43755@roundup.psfhosted.org> Message-ID: <1617744450.42.0.120128345687.issue43755@roundup.psfhosted.org> Saiyang Gou added the comment: I'll work on it soon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 17:41:49 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 06 Apr 2021 21:41:49 +0000 Subject: [issue43684] Add combined opcodes In-Reply-To: <1617741819.88.0.274343280112.issue43684@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Yeah, I've received many warnings about benchmark hacking already, and we won't fall to that. For static statistics, it's easy enough to either download a thousand of the most popular projects from GitHub or PyPI and just try to compile all the .py files found there. For dynamic statistics, the problem is always to come up with a representative run. I know how to do that for mypy (just running mypy over itself should be pretty good), but we can't do that for random projects from PyPI or GitHub -- not only do I not want to run 3rd party code I haven't eyeballed reviewed carefully first, but usually there's no way to know how to even run it -- configuration, environment, input data all need to be fixed, and dependencies need to be installed. Running test suites (whether it's the stdlib tests or some other set of unit tests for some other code base) is likely to give skewed results, given how people often write tests (trying to hit each line of code at least once but as few times as possible so the tests run quickly). This is where benchmarks provide some limited value, since they come with a standard way to run non-interactively. I wish it was the case that static stats can be a good proxy for dynamic stats, since then we could just compute static stats for a large amount of 3rd party code, but I'm not too sure of that. So I would like to have more examples that we can measure both statically and dynamically -- if the dynamic numbers look sufficiently similar to the static numbers, we can see that as an indication that static numbers are a good indicator, and if they look different, it means that we're going to have to collect more examples in order to make progress. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 17:48:49 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 06 Apr 2021 21:48:49 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617745729.5.0.701474208668.issue43753@roundup.psfhosted.org> Raymond Hettinger added the comment: > Right now, there is no benefit for CPython. Please don't this until we have a clear demonstrable benefit. As it stands now, this is all cost and no benefit. Adding unnecessary abstraction layers just makes it more difficult for people to learn to be core devs. Also, it will likely result in a lot of pointless code churn where each change carries a risk of a new bug being introduced. The notion of pointer comparison is so fundamental to C code that it is counter productive to try to abstract it away. It isn't much different than saying that every instance of "a + b" should be abstracted to "add(a, b)" and every "a[b]" should be abstracted to "index_lookup(a, b)" on the hope that maybe it might someday be helpful for PyPy or HPy even though they have never requested such a change. >From my own point of view, these need abstractions just make it harder to tell what code is actually doing. Further, it will just lead to wasting everyone's time in code reviews where the reviewer insists on the applying the new inline function and there is confusion about whether two pointers are generic pointers or python object pointers, each with their own comparison technique. Also, there is too much faith in functions marked as "inline" always being inlined. Compilers get to make their own choices and under some circumstances will not inline, especially for cross module calls. This risks taking code that is currently obviously fast and occasionally, invisibility slowing it down massively ? from a step that is 1 cycle at most and is sometimes zero cost to a step that involves an actual function call, possibly needing to save and restore registers. Lastly, the API changes aren't just for you or the standard library. In effect, you're telling the entire ecosystem of C extensions that they are doing it wrong. Almost certainly, some will follow this path and some won't, further fracturing the ecosystem. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 17:49:15 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 06 Apr 2021 21:49:15 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617745755.42.0.216781338271.issue43753@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +pablogsal, tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 18:01:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 06 Apr 2021 22:01:10 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617746470.11.0.687044150384.issue43725@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +23967 pull_request: https://github.com/python/cpython/pull/25230 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 18:03:13 2021 From: report at bugs.python.org (Saiyang Gou) Date: Tue, 06 Apr 2021 22:03:13 +0000 Subject: [issue43755] lambda expression no longer valid at comp_if in Python 3.9 In-Reply-To: <1617739645.22.0.813638332511.issue43755@roundup.psfhosted.org> Message-ID: <1617746593.79.0.634241328218.issue43755@roundup.psfhosted.org> Change by Saiyang Gou : ---------- keywords: +patch pull_requests: +23968 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25231 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 18:09:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 06 Apr 2021 22:09:53 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617746993.17.0.701305504084.issue43725@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +23969 pull_request: https://github.com/python/cpython/pull/25232 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 18:15:44 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 06 Apr 2021 22:15:44 +0000 Subject: [issue43755] lambda expression no longer valid at comp_if in Python 3.9 In-Reply-To: <1617739645.22.0.813638332511.issue43755@roundup.psfhosted.org> Message-ID: <1617747344.79.0.945772146897.issue43755@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0fdf11e8e901a5f47149232557a7f9726b8177c9 by Saiyang Gou in branch 'master': bpo-43755: Update docs to reflect that lambda is not allowed in `comp_if` since 3.9 (GH-25231) https://github.com/python/cpython/commit/0fdf11e8e901a5f47149232557a7f9726b8177c9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 18:16:15 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 06 Apr 2021 22:16:15 +0000 Subject: [issue43755] lambda expression no longer valid at comp_if in Python 3.9 In-Reply-To: <1617739645.22.0.813638332511.issue43755@roundup.psfhosted.org> Message-ID: <1617747375.65.0.505528794748.issue43755@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +23970 pull_request: https://github.com/python/cpython/pull/25233 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 18:17:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 06 Apr 2021 22:17:20 +0000 Subject: [issue43755] lambda expression no longer valid at comp_if in Python 3.9 In-Reply-To: <1617739645.22.0.813638332511.issue43755@roundup.psfhosted.org> Message-ID: <1617747440.94.0.171971285116.issue43755@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks for the quick fix, Saiyang Gou ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 18:19:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 06 Apr 2021 22:19:12 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617747552.36.0.0192675108465.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I started with two PRs against the 64 bits versions for 3.9 and 3.8. This *should* cover 32 bits as well (see previous messages), but if we want specific changes for that we need a 32 bit machine or cross-compilation, but I decided to start with something (that something being 64 bits) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 18:32:48 2021 From: report at bugs.python.org (Saiyang Gou) Date: Tue, 06 Apr 2021 22:32:48 +0000 Subject: [issue39702] PEP 614: Relaxing Grammar Restrictions On Decorators In-Reply-To: <1582215145.16.0.34815642768.issue39702@roundup.psfhosted.org> Message-ID: <1617748368.55.0.682575248427.issue39702@roundup.psfhosted.org> Change by Saiyang Gou : ---------- nosy: +gousaiyang nosy_count: 3.0 -> 4.0 pull_requests: +23971 pull_request: https://github.com/python/cpython/pull/25234 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 18:54:52 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 22:54:52 +0000 Subject: [issue43567] regen.vcxproj cannot regenerate some necessary files In-Reply-To: <1616238138.44.0.687655765468.issue43567@roundup.psfhosted.org> Message-ID: <1617749692.7.0.639155703012.issue43567@roundup.psfhosted.org> Steve Dower added the comment: New changeset 748283819043c60b1cb272c2cc9ab5b457afb03a by Steve Dower in branch 'master': bpo-43567: Improved generated code refresh on Windows (GH-25120) https://github.com/python/cpython/commit/748283819043c60b1cb272c2cc9ab5b457afb03a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 18:57:11 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 22:57:11 +0000 Subject: [issue43567] regen.vcxproj cannot regenerate some necessary files In-Reply-To: <1616238138.44.0.687655765468.issue43567@roundup.psfhosted.org> Message-ID: <1617749831.98.0.190292115712.issue43567@roundup.psfhosted.org> Steve Dower added the comment: We're updating all files now, and doing it automatically on build (or manually with --regen). ---------- assignee: -> steve.dower resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 19:01:37 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Apr 2021 23:01:37 +0000 Subject: [issue39924] pathlib handles missing `os.link`, `os.symlink` and `os.readlink` inconsistently In-Reply-To: <1583874767.79.0.0714252611287.issue39924@roundup.psfhosted.org> Message-ID: <1617750097.41.0.250873463445.issue39924@roundup.psfhosted.org> Steve Dower added the comment: New changeset b57e045320d1d2a70eab236b7d31a3ebb75037c3 by Barney Gale in branch 'master': bpo-39924: handle missing os functions more consistently in pathlib (GH-19220) https://github.com/python/cpython/commit/b57e045320d1d2a70eab236b7d31a3ebb75037c3 ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 19:04:31 2021 From: report at bugs.python.org (Saiyang Gou) Date: Tue, 06 Apr 2021 23:04:31 +0000 Subject: [issue43756] About updating audit events when function gains new arguments Message-ID: <1617750271.94.0.577978285316.issue43756@roundup.psfhosted.org> New submission from Saiyang Gou : I'm not sure what to do when a function already being audited gains new arguments which are also worth auditing. For example, issue 38144 brings new `root_dir` and `dir_fd` arguments to `glob.glob`. Currently `glob.glob` is already audited, with `(pathname, recursive)` as the event schema. However, the new `root_dir` and `dir_fd` arguments are important context for the glob operation and is also worth collecting into the event (as a comparison, `os.*` audit events already include `dir_fd`). The problem is how to incorporate the new arguments. - Solution 1: Add new arguments to the existing event schema (on feature releases). In this ways, hooks expecting an arg tuple of the original length will be broken. Hooks taking arguments by subscripts (e.g. `pathname = args[0]`) may still work if we only append new arguments to the end of the event schema and never insert arguments in the middle. - Solution 2: Add a new audit event. In this `glob` case, we add a new event which might be called `glob.glob.v2` or `glob.glob.3_10` or some other way. This will make sure the event schema is always fixed across different feature releases. But hooks may need to correctly handle all "versions" of events (e.g. do some thing like `if event.startswith('glob.glob')` instead of `if event == 'glob.glob'`). I guess more audited functions may gain new arguments in the future so this problem is unavoidable. I would like some suggestions from Steve. Thanks! ---------- messages: 390386 nosy: gousaiyang, steve.dower priority: normal severity: normal status: open title: About updating audit events when function gains new arguments _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 19:18:34 2021 From: report at bugs.python.org (Saiyang Gou) Date: Tue, 06 Apr 2021 23:18:34 +0000 Subject: [issue43472] [security][subinterpreters] Add auditing hooks to subinterpreter module In-Reply-To: <1615455062.58.0.468186541544.issue43472@roundup.psfhosted.org> Message-ID: <1617751114.99.0.571311210048.issue43472@roundup.psfhosted.org> Saiyang Gou added the comment: One problem is the naming of audit events. Actually I didn't even notice that `_xxsubinterpreters` was already there since Python 3.8, because PEP 554 is still in draft status as for now. Looks like `_xxsubinterpreters` is an internal low-level interface to subinterpreters (and probably only meant for testing purposes for now), while PEP 554 will bring a high-level interface `interpreters` for users. Naming the audit events as `interpreters.*` will be more readable, although the `interpreters` module doesn't actually exist today. ---------- nosy: +gousaiyang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 19:52:52 2021 From: report at bugs.python.org (Saiyang Gou) Date: Tue, 06 Apr 2021 23:52:52 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1617753172.12.0.0162836193735.issue36540@roundup.psfhosted.org> Change by Saiyang Gou : ---------- nosy: +gousaiyang nosy_count: 6.0 -> 7.0 pull_requests: +23973 pull_request: https://github.com/python/cpython/pull/25235 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 20:02:10 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 00:02:10 +0000 Subject: [issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path In-Reply-To: <1612285380.24.0.495785451269.issue43105@roundup.psfhosted.org> Message-ID: <1617753730.41.0.549158934838.issue43105@roundup.psfhosted.org> Steve Dower added the comment: New changeset 04732ca993fa077a8b9640cc77fb2f152339585a by Steve Dower in branch 'master': bpo-43105: Importlib now resolves relative paths when creating module spec objects from file locations (GH-25121) https://github.com/python/cpython/commit/04732ca993fa077a8b9640cc77fb2f152339585a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 20:05:28 2021 From: report at bugs.python.org (Skip Montanaro) Date: Wed, 07 Apr 2021 00:05:28 +0000 Subject: [issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384) In-Reply-To: <1617717310.23.0.781870959378.issue41111@roundup.psfhosted.org> Message-ID: Skip Montanaro added the comment: > > Skip: By the way, I'm curious, why do you use --with-trace-refs? > I'm still horsing around with register opcodes and got in the habit of building with pydebug and trace refs enabled. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 20:12:22 2021 From: report at bugs.python.org (Saiyang Gou) Date: Wed, 07 Apr 2021 00:12:22 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1617754342.94.0.240176328476.issue38605@roundup.psfhosted.org> Change by Saiyang Gou : ---------- nosy: +gousaiyang nosy_count: 11.0 -> 12.0 pull_requests: +23974 pull_request: https://github.com/python/cpython/pull/25236 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 20:25:42 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 00:25:42 +0000 Subject: [issue39895] `pathlib.Path.touch()` calls `os.close()` without using accessor In-Reply-To: <1583639559.65.0.730763804779.issue39895@roundup.psfhosted.org> Message-ID: <1617755142.23.0.0718386190725.issue39895@roundup.psfhosted.org> Steve Dower added the comment: New changeset 986da8effcd2e9e9334ae016928ef795fb93c373 by Barney Gale in branch 'master': bpo-39895: Move `pathlib.Path.touch()` implementation into the path accessor. (GH-18838) https://github.com/python/cpython/commit/986da8effcd2e9e9334ae016928ef795fb93c373 ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 20:26:39 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 07 Apr 2021 00:26:39 +0000 Subject: [issue37609] support "UNC" device paths in ntpath.splitdrive In-Reply-To: <1563362794.09.0.456380769613.issue37609@roundup.psfhosted.org> Message-ID: <1617755199.88.0.780939912272.issue37609@roundup.psfhosted.org> Eryk Sun added the comment: > I've got a fairly simple implementation for this using the (new) > nt._path_splitroot native method It's for the best to let the system path API handle this, especially if doing so gets this issue resolved, as well as others like it and those that depend on it. I'm a bit disappointed, however, that PathCchSkipRoot() doesn't handle some of the cases that I handled in splitdrive.py. PathCchSkipRoot() doesn't support the "Global" link in device paths. Fortunately this case is uncommon. In practice "Global" is only needed when a DOS device name has to be created globally, e.g. "\\.\Global\SomeGlobalDevice". PathCchSkipRoot() splits "\\.\UNC\server\share" as "\\.\UNC\" and "server\share", but that's okay since no one uses "\\.\UNC". PathCchSkipRoot() restricts the "\\?\" prefix to drive names, volume GUID names, and the "UNC" device -- such as "\\?\X:", "\\?\Volume{12345678-1234-1234-1234-123456789ABC}", and "\\?\UNC\server\share". Other device names such as the "PIPE" device have to use the "\\.\" prefix. Rarely, a device path may need "\\?\" if it's a long path or needs to bypass normalization. I wanted splitdrive() to remain neutral for such cases, but that will have to be sacrificed. PathCchSkipRoot() doesn't ignore repeated slashes in the drive part of a UNC "\\server\share" or "\\?\UNC\server\share" path, even though GetFullPathNameW() collapses all but the initial two slashes. (More than two initial slashes is invalid.) For example, the system normalizes "//localhost///C$" as "\\localhost\C$: >>> os.chdir('//localhost///C$/Temp') >>> print(os.getcwd()) \\localhost\C$\Temp PathCchSkipRoot() also allows just a UNC server to count as a root, e.g. "\\server" or "\\?\UNC\server", though a valid UNC path requires a share name. Without a share, FindFirstFileW(L"//server/*", &find_data) will fail to parse the directory name correctly and try to open "//server/*", which is an invalid name. If splitdrive() requires a valid drive name, it should not return "//server" or "//server/" as a drive name. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 20:26:41 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 00:26:41 +0000 Subject: [issue40038] pathlib: remove partial support for preserving accessor when modifying a path In-Reply-To: <1584854130.01.0.225016964026.issue40038@roundup.psfhosted.org> Message-ID: <1617755201.07.0.753991555317.issue40038@roundup.psfhosted.org> Steve Dower added the comment: New changeset 2219187cab6bca009c42b63b2f4c30b5b10c916d by Barney Gale in branch 'master': bpo-40038: pathlib: remove partial support for preserving accessor when modifying a path (GH-19342) https://github.com/python/cpython/commit/2219187cab6bca009c42b63b2f4c30b5b10c916d ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 20:30:40 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 00:30:40 +0000 Subject: [issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path In-Reply-To: <1612285380.24.0.495785451269.issue43105@roundup.psfhosted.org> Message-ID: <1617755440.47.0.696856164623.issue43105@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +23975 pull_request: https://github.com/python/cpython/pull/25237 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 20:36:40 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 07 Apr 2021 00:36:40 +0000 Subject: [issue43751] await anext() returns None when default is given In-Reply-To: <1617724814.14.0.517501509303.issue43751@roundup.psfhosted.org> Message-ID: <1617755800.59.0.176002719619.issue43751@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch pull_requests: +23976 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25238 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 20:44:00 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 07 Apr 2021 00:44:00 +0000 Subject: [issue43751] await anext() returns None when default is given In-Reply-To: <1617724814.14.0.517501509303.issue43751@roundup.psfhosted.org> Message-ID: <1617756240.7.0.841450461053.issue43751@roundup.psfhosted.org> Dennis Sweeney added the comment: That change fixes that bug, but I think there may be another bug involving when a custom async iterator is passed rather than an async generator. This is at the limit of my knowledge, so any guidance would be appreciated. The test I wrote in the PR currently fails, due to some `tp_iternext` slot being NULL sometimes. Maybe different cases are needed for Coroutine/non-Coroutine? But it definitely seems like the aiter()/anext() code needs more test coverage. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 20:44:14 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 00:44:14 +0000 Subject: [issue43756] About updating audit events when function gains new arguments In-Reply-To: <1617750271.94.0.577978285316.issue43756@roundup.psfhosted.org> Message-ID: <1617756254.24.0.99569959705.issue43756@roundup.psfhosted.org> Steve Dower added the comment: Solution 1 is definitely out, as PyArg_ParseTuple is a very valid way to implement hooks but won't handle longer tuples. For Solution 2, we already have some events that use a slash to indicate "extra" information, so depending on context I'd either do "glob.glob/2" or add both "glob.glob/root_dir" and "glob.glob/dir_fd" events. I suspect in this case, the "glob.glob/2" name is better, because all the data really has to come together. Sending those values through separately might make more sense if there's some other linkable id (such as for socket events). Nobody should handle hooks that they don't expect with anything other than *args (and even then they should be careful, as hooks may pass through MB or GB of data, so logging or printing them directly may be a bad idea). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 21:19:24 2021 From: report at bugs.python.org (Saiyang Gou) Date: Wed, 07 Apr 2021 01:19:24 +0000 Subject: [issue43756] About updating audit events when function gains new arguments In-Reply-To: <1617750271.94.0.577978285316.issue43756@roundup.psfhosted.org> Message-ID: <1617758364.64.0.455727186215.issue43756@roundup.psfhosted.org> Change by Saiyang Gou : ---------- keywords: +patch pull_requests: +23977 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25239 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 21:21:06 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 07 Apr 2021 01:21:06 +0000 Subject: [issue43597] robotparser should support specifying SSL context In-Reply-To: <1616455516.19.0.272349627897.issue43597@roundup.psfhosted.org> Message-ID: <1617758466.4.0.726484720232.issue43597@roundup.psfhosted.org> Berker Peksag added the comment: I'm not opposing to the idea, but what's the practical use case here? I haven't seen a case where you needed to pass a custom SSLContext in order to fetch the robots.txt file. ---------- nosy: +berker.peksag versions: -Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 21:28:40 2021 From: report at bugs.python.org (Barney Gale) Date: Wed, 07 Apr 2021 01:28:40 +0000 Subject: [issue40107] pathlib: make `_Accessor.open()` return a file object and not a file descriptor In-Reply-To: <1585521459.52.0.94031195769.issue40107@roundup.psfhosted.org> Message-ID: <1617758921.0.0.630504423708.issue40107@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +23978 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25240 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 21:28:41 2021 From: report at bugs.python.org (Barney Gale) Date: Wed, 07 Apr 2021 01:28:41 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za> Message-ID: <1617758921.32.0.480562071242.issue24132@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +23979 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25240 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 21:56:13 2021 From: report at bugs.python.org (Tarun Chinmai Sekar) Date: Wed, 07 Apr 2021 01:56:13 +0000 Subject: [issue43597] robotparser should support specifying SSL context In-Reply-To: <1616455516.19.0.272349627897.issue43597@roundup.psfhosted.org> Message-ID: <1617760573.8.0.720428700221.issue43597@roundup.psfhosted.org> Tarun Chinmai Sekar added the comment: I am writing a web scraper, that runs in a container that has CA-Certificates stored in a non-standard location. The Ca-Certificates are managed by Certifi. By allowing to override the sslcontext, it is possible for the user to construct a sslcontext and pass it in. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 22:24:52 2021 From: report at bugs.python.org (Zackery Spytz) Date: Wed, 07 Apr 2021 02:24:52 +0000 Subject: [issue43750] Undefined constant PACKET_MULTIHOST referred to in package socket In-Reply-To: <1617722506.16.0.590696167901.issue43750@roundup.psfhosted.org> Message-ID: <1617762292.79.0.812297137374.issue43750@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 2.0 -> 3.0 pull_requests: +23980 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25241 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 22:32:48 2021 From: report at bugs.python.org (Barney Gale) Date: Wed, 07 Apr 2021 02:32:48 +0000 Subject: [issue43757] pathlib: move 'resolve()' logic out of path flavour Message-ID: <1617762768.57.0.0406169855145.issue43757@roundup.psfhosted.org> New submission from Barney Gale : Under-the-hood functionality in pathlib is divided between: - The 'flavour', which implements path syntax (separators, casefolding, etc) - The 'accessor', which accesses the local (file)system. The '_WindowsFlavour/_PosixFlavour.resolve()' function is misplaced, as it requires OS calls such as `os.getcwd()`, `os.readlink()`, and `nt._getfinalpathname()`. While the implementation *does* differ across Windows and POSIX, it's still properly part of the accessor interface, and not the flavour interface. In preparation for addressing bpo-24132 I'd like to get these interfaces really tidy. Once bpo-39899 is fixed, this will be the last remaining flavour method that does accessor-y things. ---------- components: Library (Lib) messages: 390397 nosy: barneygale priority: normal severity: normal status: open title: pathlib: move 'resolve()' logic out of path flavour type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 6 23:37:52 2021 From: report at bugs.python.org (Keith Smiley) Date: Wed, 07 Apr 2021 03:37:52 +0000 Subject: [issue43220] Argparse: Explicit default required arguments with add_mutually_exclusive_group are rejected In-Reply-To: <1613284485.11.0.495534943099.issue43220@roundup.psfhosted.org> Message-ID: <1617766672.78.0.573131343081.issue43220@roundup.psfhosted.org> Keith Smiley added the comment: Would someone be able to review this change? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 01:00:30 2021 From: report at bugs.python.org (hai shi) Date: Wed, 07 Apr 2021 05:00:30 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617771630.95.0.487896048934.issue43753@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 01:02:28 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Apr 2021 05:02:28 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1617771748.09.0.729234702659.issue38605@roundup.psfhosted.org> miss-islington added the comment: New changeset 1be456ae9d53bb1cba2b24fc86175c282d1c2169 by Saiyang Gou in branch 'master': bpo-38605: Update "Future statements" docs since PEP 563 is always enabled (GH-25236) https://github.com/python/cpython/commit/1be456ae9d53bb1cba2b24fc86175c282d1c2169 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 01:05:52 2021 From: report at bugs.python.org (Justin Lee) Date: Wed, 07 Apr 2021 05:05:52 +0000 Subject: [issue43758] dict.config TimedRotatingFileHandler filename .suffix does not function Message-ID: <1617771952.69.0.757936133435.issue43758@roundup.psfhosted.org> New submission from Justin Lee : Hi, I would like to change the .suffix for the TimedRotatingFileHandler for the "future-created" file in dictConfig written in json. Is there any suggestion on how to do that? ---------- messages: 390400 nosy: tea940314 priority: normal severity: normal status: open title: dict.config TimedRotatingFileHandler filename .suffix does not function type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 01:24:41 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 07 Apr 2021 05:24:41 +0000 Subject: [issue43758] dict.config TimedRotatingFileHandler filename .suffix does not function In-Reply-To: <1617771952.69.0.757936133435.issue43758@roundup.psfhosted.org> Message-ID: <1617773081.66.0.383523701712.issue43758@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 02:08:50 2021 From: report at bugs.python.org (Saiyang Gou) Date: Wed, 07 Apr 2021 06:08:50 +0000 Subject: [issue43756] About updating audit events when function gains new arguments In-Reply-To: <1617750271.94.0.577978285316.issue43756@roundup.psfhosted.org> Message-ID: <1617775730.29.0.704558184231.issue43756@roundup.psfhosted.org> Saiyang Gou added the comment: And one more question, should we ever remove an old version of event when we add a new version of it? A function whose signature got repeatedly changed may result in several versions of audit event raised together on a single operation, which is probably not good for performance. But removing the old event will make those hooks which are not written to handle the new version of the event unable to receive the old event at all, which doesn't look good. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 02:43:23 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 07 Apr 2021 06:43:23 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617777803.02.0.229086517058.issue43753@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 02:47:38 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 07 Apr 2021 06:47:38 +0000 Subject: [issue31861] add aiter() and anext() functions In-Reply-To: <1508851575.6.0.213398074469.issue31861@psf.upfronthosting.co.za> Message-ID: <1617778058.65.0.0365138546076.issue31861@roundup.psfhosted.org> Dennis Sweeney added the comment: A bug was reported in anext(): https://bugs.python.org/issue43751 ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 03:51:49 2021 From: report at bugs.python.org (Hynek Petrak) Date: Wed, 07 Apr 2021 07:51:49 +0000 Subject: [issue43741] http.client leaks from self.fp.read() In-Reply-To: <1617695018.24.0.921353674575.issue43741@roundup.psfhosted.org> Message-ID: <1617781909.73.0.360163513806.issue43741@roundup.psfhosted.org> Hynek Petrak added the comment: The leak does not seem to occure, when I use ret = r.read(10000).decode('utf-8') instead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 03:54:20 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 07 Apr 2021 07:54:20 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1617782060.41.0.938860883332.issue5758@roundup.psfhosted.org> Change by Inada Naoki : ---------- versions: +Python 3.10 -Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 04:07:48 2021 From: report at bugs.python.org (Nguyen Thai Binh) Date: Wed, 07 Apr 2021 08:07:48 +0000 Subject: [issue43759] StreamHandler does not print to sys.stderr immediately Message-ID: <1617782868.14.0.363269444057.issue43759@roundup.psfhosted.org> New submission from Nguyen Thai Binh : When logger.exception() is called in a `catch` clause, it never logs to sys.stderr immediately. Sometimes it only outputs when the program almost finishes. I don't know how to reproduce as it is occasional. Attached is the logging configuration for my program. Thank you. ---------- components: Library (Lib) files: logger.py messages: 390404 nosy: MunchDev priority: normal severity: normal status: open title: StreamHandler does not print to sys.stderr immediately type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file49937/logger.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 04:27:06 2021 From: report at bugs.python.org (Nguyen Thai Binh) Date: Wed, 07 Apr 2021 08:27:06 +0000 Subject: [issue43759] StreamHandler does not print to sys.stderr immediately In-Reply-To: <1617782868.14.0.363269444057.issue43759@roundup.psfhosted.org> Message-ID: <1617784026.81.0.874244814513.issue43759@roundup.psfhosted.org> Nguyen Thai Binh added the comment: I have managed to solve this by flushing the buffer. So issue closed. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 05:00:24 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 07 Apr 2021 09:00:24 +0000 Subject: [issue43220] Argparse: Explicit default required arguments with add_mutually_exclusive_group are rejected In-Reply-To: <1613284485.11.0.495534943099.issue43220@roundup.psfhosted.org> Message-ID: <1617786024.85.0.0216911522991.issue43220@roundup.psfhosted.org> Raymond Hettinger added the comment: I'll review this but it may take a little while to get to it. ---------- assignee: -> rhettinger nosy: +paul.j3, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 05:08:26 2021 From: report at bugs.python.org (Michael Felt) Date: Wed, 07 Apr 2021 09:08:26 +0000 Subject: [issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child In-Reply-To: <1585329415.65.0.534969367772.issue40092@roundup.psfhosted.org> Message-ID: <1617786506.85.0.483955331453.issue40092@roundup.psfhosted.org> Michael Felt added the comment: Willing to spend more time on this - but the variable names chosen blind me - looks like a circle. And, thinking about the address in the core dump starting with 0xd (segment 13) - confuses me somewhat - as from memory - I thought the shared library code/data converged on segment 14 (ie, addresses would begin with 0xe). So, perhaps it is the 0xd* address that is killing everything. See: https://bugs.python.org/issue43665#msg389923 -- as I am also still confused re: this line - looks suspect: with all arguments at 0xdddddddd PyVectorcall_Call(callable = 0xdddddddd, tuple = 0xdddddddd, kwargs = 0xdddddddd), line 255 in "call.c" And also this line, and lines like it - notice the value for what looks like a variable for argument_count: _PyEval_Vector(tstate = 0x22023cf0, con = 0x2000120c, locals = 0x22023960, args = 0x220239f0, argcount = 3508213100, kwnames = 0x22023cf0), line 46 in "pycore_ceval.h" _PyFunction_Vectorcall(func = 0x220239f0, stack = (nil), nargsf = 570572016, kwnames = 0x220239f0), line 361 in "call.c" method_vectorcall(method = 0x10103bdc, args = (nil), nargsf = 0, kwnames = 0x20045994), line 119 in "abstract.h" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 05:10:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 09:10:07 +0000 Subject: [issue43244] Move PyArena C API to the internal C API In-Reply-To: <1613586690.19.0.383646964758.issue43244@roundup.psfhosted.org> Message-ID: <1617786607.16.0.966254632431.issue43244@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +23982 pull_request: https://github.com/python/cpython/pull/25242 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 05:24:56 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 07 Apr 2021 09:24:56 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617787496.36.0.896468513026.issue43753@roundup.psfhosted.org> Mark Shannon added the comment: For any sane design of tagged pointers, `x == y` (in C) will work fine. `is` is not well defined except for a small set of values, so the docs for `Py_Is` would have to so vague as to be worthless, IMO. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 05:27:15 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 07 Apr 2021 09:27:15 +0000 Subject: [issue40228] Make setting line number in frame more robust. In-Reply-To: <1586360855.72.0.434652598832.issue40228@roundup.psfhosted.org> Message-ID: <1617787635.99.0.563164588105.issue40228@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 05:27:59 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 07 Apr 2021 09:27:59 +0000 Subject: [issue39537] Change line number table format In-Reply-To: <1580724394.63.0.487397350613.issue39537@roundup.psfhosted.org> Message-ID: <1617787679.44.0.917671768971.issue39537@roundup.psfhosted.org> Mark Shannon added the comment: PEP 626 fixed this ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 05:28:07 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 07 Apr 2021 09:28:07 +0000 Subject: [issue39537] Change line number table format In-Reply-To: <1580724394.63.0.487397350613.issue39537@roundup.psfhosted.org> Message-ID: <1617787687.56.0.199130124001.issue39537@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 05:35:49 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 07 Apr 2021 09:35:49 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be. Message-ID: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> New submission from Mark Shannon : The DISPATCH() macro has two failings. 1. Its check for tracing involves too much pointer chaser. 2. The logic assumes that computed-gotos is the "fast path" which makes switch dispatch, and therefore Python on Windows unnecessarily slow. ---------- messages: 390410 nosy: Mark.Shannon priority: normal severity: normal status: open title: The DISPATCH() macro is not as efficient as it could be. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 05:36:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 09:36:09 +0000 Subject: [issue43244] Move PyArena C API to the internal C API In-Reply-To: <1613586690.19.0.383646964758.issue43244@roundup.psfhosted.org> Message-ID: <1617788169.25.0.0721556614843.issue43244@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +23983 pull_request: https://github.com/python/cpython/pull/25243 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 06:01:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 10:01:16 +0000 Subject: [issue31861] add aiter() and anext() functions In-Reply-To: <1508851575.6.0.213398074469.issue31861@psf.upfronthosting.co.za> Message-ID: <1617789676.87.0.224408021924.issue31861@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 06:01:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 10:01:51 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1617789711.66.0.376512398386.issue5758@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 06:16:34 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 07 Apr 2021 10:16:34 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be. In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1617790594.37.0.732158469897.issue43760@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +23984 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25244 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 06:33:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 10:33:31 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617791611.36.0.361293751654.issue43753@roundup.psfhosted.org> STINNER Victor added the comment: > For any sane design of tagged pointers, `x == y` (in C) will work fine. I wrote a proof-of-concept for using tagged pointners in CPython: https://github.com/vstinner/cpython/pull/6 "The PR is large because of the first changes which add Py_IS_NONE(), Py_IS_TRUE() and Py_IS_FALSE() macros." For backward compatibility, I added a function to get a concrete Python object from a tagged pointer: the True as a tagged pointer becomes (PyObject *)&_Py_TrueStruct concrete object. Py_IS_TRUE() has to check for both values: tagged pointer or &_Py_TrueStruct (don't look at my exact implementation, it's wrong ;-)). In a perfect world, there would be no backward compatibility and you would never have to create Python objects from a tagged pointer. The other problem is that the stable ABI exposes "Py_True" as "&_Py_TrueStruct" and so C extensions built with the stable ABI uses "&_Py_TrueStruct", not the tagged pointer. See also bpo-39511 which discuss solutions for these problems. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 06:35:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 10:35:39 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617791739.22.0.464300516748.issue43753@roundup.psfhosted.org> STINNER Victor added the comment: > Also, there is too much faith in functions marked as "inline" always being inlined. I proposed to declare it as a "static inline" function, but I'm fine with a macro as well. I mostly care about the API: call "Py_Is()", not really about the exact implementation. In practice, for now, Py_Is(x, y) will continue to be compiled as "x == y". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 06:40:27 2021 From: report at bugs.python.org (Adrian Freund) Date: Wed, 07 Apr 2021 10:40:27 +0000 Subject: [issue43761] Documenting dataclass and namedtuple changes for structural pattern matching Message-ID: <1617792027.47.0.961772614464.issue43761@roundup.psfhosted.org> New submission from Adrian Freund : PEP 634 structural pattern matching adds an auto-generated __match_args__ attribute to classes with the dataclass decorator and to namedtuples. This change is currently not documented in the dataclass and namedtuple documentation, nor is it mentioned in PEP 557 Data Classes. I would suggest adding mentions of this behaviour in those three places. Additionally I think adding a new parameter to switch off generating __match_args__ to dataclass should be considered, as everything else generated by dataclass can be switched off using a parameter. ---------- assignee: docs at python components: Documentation messages: 390413 nosy: brandtbucher, docs at python, freundTech, gvanrossum priority: normal severity: normal status: open title: Documenting dataclass and namedtuple changes for structural pattern matching versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 06:51:19 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 07 Apr 2021 10:51:19 +0000 Subject: [issue43762] Add audit events for loading of sqlite3 extensions Message-ID: <1617792679.62.0.407303342016.issue43762@roundup.psfhosted.org> New submission from Erlend Egeberg Aasland : If Python is configured with --enable-loadable-sqlite-extensions, it is possible to load third party SQLite extensions (shared libraries/DLL?s) via the sqlite3 extension module. When enabled, the sqlite3.Connection.enable_load_extension() class method will enable the loading of third party extensions via SQL queries, using the SQL function load_extension(). It also enables loading extension via C, using the sqlite3.Connection.load_extension() class method. Suggesting to add the following audit event names to respectively the sqlite3.Connection.enable_load_extension() and sqlite3.Connection.load_extension() methods: - sqlite3.enable_load_extension - sqlite3.load_extension Ref. - https://discuss.python.org/t/should-we-audit-enabling-loading-of-sqlite3-extensions-shared-libraries/8124 - https://www.sqlite.org/loadext.html - https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.enable_load_extension ---------- components: Library (Lib) messages: 390414 nosy: berker.peksag, christian.heimes, erlendaasland priority: normal severity: normal status: open title: Add audit events for loading of sqlite3 extensions type: security versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 06:59:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 10:59:29 +0000 Subject: [issue43075] ReDoS in urllib.request In-Reply-To: <1611994306.46.0.333529770265.issue43075@roundup.psfhosted.org> Message-ID: <1617793169.33.0.308238233599.issue43075@roundup.psfhosted.org> STINNER Victor added the comment: > header = '' + ',' * (10 ** 5) I guess that a more generic protection against future attacks would be to limit the maximum length of a HTTP header. 100,000 characters for a HTTP Basic authentification does not sound reasonable. But for now, let's fix the regex. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:01:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 11:01:17 +0000 Subject: [issue43244] Move PyArena C API to the internal C API In-Reply-To: <1613586690.19.0.383646964758.issue43244@roundup.psfhosted.org> Message-ID: <1617793277.98.0.207887672167.issue43244@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d36d6a9c1808e87628ebaa855d4bec80130189f4 by Victor Stinner in branch 'master': bpo-43244: Remove Yield macro from pycore_ast.h (GH-25243) https://github.com/python/cpython/commit/d36d6a9c1808e87628ebaa855d4bec80130189f4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:05:49 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 07 Apr 2021 11:05:49 +0000 Subject: [issue43762] Add audit events for loading of sqlite3 extensions In-Reply-To: <1617792679.62.0.407303342016.issue43762@roundup.psfhosted.org> Message-ID: <1617793549.7.0.786767870897.issue43762@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch pull_requests: +23985 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25246 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:11:49 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 07 Apr 2021 11:11:49 +0000 Subject: [issue43761] Documenting dataclass and namedtuple changes for structural pattern matching In-Reply-To: <1617792027.47.0.961772614464.issue43761@roundup.psfhosted.org> Message-ID: <1617793909.93.0.325151814579.issue43761@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:14:28 2021 From: report at bugs.python.org (yeting li) Date: Wed, 07 Apr 2021 11:14:28 +0000 Subject: [issue43075] ReDoS in urllib.request In-Reply-To: <1611994306.46.0.333529770265.issue43075@roundup.psfhosted.org> Message-ID: <1617794068.06.0.95738793285.issue43075@roundup.psfhosted.org> yeting li added the comment: For a regex has polynomial worst-case complexity, limiting the maximum input length is indeed a very effective method. As shown below, as the input length becomes smaller, the matching time becomes significantly smaller. header = '' + ',' * (10 ** 4) 1.617s header = '' + ',' * (10 ** 3) 0.014s header = '' + ',' * (10 ** 2) 0.00017s ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:25:15 2021 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 07 Apr 2021 11:25:15 +0000 Subject: [issue43164] test_nntplib.NetworkedNNTP_SSLTests fails on "AMD64 RHEL8 FIPS Only Blake2 Builtin Hash" buildbot In-Reply-To: <1612798587.66.0.557577709319.issue43164@roundup.psfhosted.org> Message-ID: <1617794715.12.0.39800426666.issue43164@roundup.psfhosted.org> Charalampos Stratakis added the comment: The issue seems to be resolved and the buildbot is green. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:25:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 11:25:55 +0000 Subject: [issue43075] ReDoS in urllib.request In-Reply-To: <1611994306.46.0.333529770265.issue43075@roundup.psfhosted.org> Message-ID: <1617794755.29.0.0131400865931.issue43075@roundup.psfhosted.org> STINNER Victor added the comment: redos_python2.py: Updated benchmark. I confirm that PR 24391 fix a worst case performance, starting with 100 characters. Since the complexity is quadratic, strings longer 10^4 characters are likely to hang a client for several minutes. == Reference (vulnerable) == simple: Mean +- std dev: 2.10 us +- 0.05 us repeat 10: Mean +- std dev: 3.85 us +- 0.13 us repeat 10^2: Mean +- std dev: 133 us +- 3 us repeat 10^4: Mean +- std dev: 1.23 sec +- 0.05 sec == With the PR 24391 fix == simple: Mean +- std dev: 2.15 us +- 0.15 us repeat 10: Mean +- std dev: 2.44 us +- 0.04 us repeat 10^2: Mean +- std dev: 7.45 us +- 0.17 us repeat 10^4: Mean +- std dev: 574 us +- 28 us == Comparison == simple: Mean +- std dev: [ref] 2.10 us +- 0.05 us -> [fix] 2.15 us +- 0.15 us: 1.02x slower repeat 10: Mean +- std dev: [ref] 3.85 us +- 0.13 us -> [fix] 2.44 us +- 0.04 us: 1.58x faster repeat 10^2: Mean +- std dev: [ref] 133 us +- 3 us -> [fix] 7.45 us +- 0.17 us: 17.80x faster repeat 10^4: Mean +- std dev: [ref] 1.23 sec +- 0.05 sec -> [fix] 574 us +- 28 us: 2152.36x faster Geometric mean: 15.59x faster ---------- Added file: https://bugs.python.org/file49938/redos_python2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:27:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 11:27:50 +0000 Subject: [issue43075] ReDoS in urllib.request In-Reply-To: <1611994306.46.0.333529770265.issue43075@roundup.psfhosted.org> Message-ID: <1617794870.09.0.445887793436.issue43075@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7215d1ae25525c92b026166f9d5cac85fb1defe1 by Yeting Li in branch 'master': bpo-43075: Fix ReDoS in urllib AbstractBasicAuthHandler (GH-24391) https://github.com/python/cpython/commit/7215d1ae25525c92b026166f9d5cac85fb1defe1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:28:09 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Apr 2021 11:28:09 +0000 Subject: [issue43075] ReDoS in urllib.request In-Reply-To: <1611994306.46.0.333529770265.issue43075@roundup.psfhosted.org> Message-ID: <1617794889.94.0.896540760457.issue43075@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +23986 pull_request: https://github.com/python/cpython/pull/25247 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:28:20 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Apr 2021 11:28:20 +0000 Subject: [issue43075] ReDoS in urllib.request In-Reply-To: <1611994306.46.0.333529770265.issue43075@roundup.psfhosted.org> Message-ID: <1617794900.02.0.836233132535.issue43075@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +23987 pull_request: https://github.com/python/cpython/pull/25248 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:29:11 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Apr 2021 11:29:11 +0000 Subject: [issue43075] ReDoS in urllib.request In-Reply-To: <1611994306.46.0.333529770265.issue43075@roundup.psfhosted.org> Message-ID: <1617794951.66.0.200565651746.issue43075@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +23988 pull_request: https://github.com/python/cpython/pull/25249 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:29:19 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Apr 2021 11:29:19 +0000 Subject: [issue43075] ReDoS in urllib.request In-Reply-To: <1611994306.46.0.333529770265.issue43075@roundup.psfhosted.org> Message-ID: <1617794959.57.0.164524691745.issue43075@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +23989 pull_request: https://github.com/python/cpython/pull/25250 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:35:15 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 11:35:15 +0000 Subject: [issue40038] pathlib: remove partial support for preserving accessor when modifying a path In-Reply-To: <1584854130.01.0.225016964026.issue40038@roundup.psfhosted.org> Message-ID: <1617795315.25.0.360946653288.issue40038@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:36:00 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 11:36:00 +0000 Subject: [issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path In-Reply-To: <1612285380.24.0.495785451269.issue43105@roundup.psfhosted.org> Message-ID: <1617795360.44.0.378139366217.issue43105@roundup.psfhosted.org> Steve Dower added the comment: New changeset 0af99b44edf559305def22b2d68be685ce50d7f6 by Steve Dower in branch '3.9': bpo-43105: Importlib now resolves relative paths when creating module spec objects from file locations (GH-25121) https://github.com/python/cpython/commit/0af99b44edf559305def22b2d68be685ce50d7f6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:36:08 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 11:36:08 +0000 Subject: [issue39895] `pathlib.Path.touch()` calls `os.close()` without using accessor In-Reply-To: <1583639559.65.0.730763804779.issue39895@roundup.psfhosted.org> Message-ID: <1617795368.57.0.921097473462.issue39895@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:36:12 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 07 Apr 2021 11:36:12 +0000 Subject: [issue43763] [sqlite3] Use SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION iso. sqlite3_enable_load_extension() Message-ID: <1617795372.37.0.944356546491.issue43763@roundup.psfhosted.org> New submission from Erlend Egeberg Aasland : Quoting from the SQLite docs: "It is recommended that extension loading be enabled using the SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION method rather than this interface, so the load_extension() SQL function remains disabled. This will prevent SQL injections from giving attackers access to extension loading capabilities." Suggesting to make sqlite3.Connection.enable_load_extension a module level function, and use sqlite3_db_config() iso. sqlite3_enable_load_extension(). We could add an optional argument for also enabling the SQL function. 1. Introduce sqlite3.enable_load_extension(enable, /, enable_sql_api=False) 2. Add deprecation warning to sqlite3.Connection.enable_load_extension() 3. In Python 3.12, remove sqlite3.Connection.enable_load_extension() ---------- components: Extension Modules messages: 390422 nosy: berker.peksag, christian.heimes, erlendaasland priority: normal severity: normal status: open title: [sqlite3] Use SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION iso. sqlite3_enable_load_extension() type: security versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:36:42 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 11:36:42 +0000 Subject: [issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path In-Reply-To: <1612285380.24.0.495785451269.issue43105@roundup.psfhosted.org> Message-ID: <1617795402.29.0.171709554381.issue43105@roundup.psfhosted.org> Steve Dower added the comment: Just needs the 3.8 backport - will get to that later tonight. ---------- stage: patch review -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:38:56 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 11:38:56 +0000 Subject: [issue43756] About updating audit events when function gains new arguments In-Reply-To: <1617750271.94.0.577978285316.issue43756@roundup.psfhosted.org> Message-ID: <1617795536.9.0.542233695804.issue43756@roundup.psfhosted.org> Steve Dower added the comment: To remove an event, it needs to be deprecated as any public facing feature would be deprecated. I'm not sure how we'd go about publicising it though. There's currently no way to raise a warning, so it'd just have to be very clearly advertised in documentation (as a breaking change). Easiest to assume that an event will be permanent. If there's a significant impact due to an event that we want to avoid, we can address it then. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:45:13 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Apr 2021 11:45:13 +0000 Subject: [issue43075] ReDoS in urllib.request In-Reply-To: <1611994306.46.0.333529770265.issue43075@roundup.psfhosted.org> Message-ID: <1617795913.31.0.363872753283.issue43075@roundup.psfhosted.org> miss-islington added the comment: New changeset e7654b6046090914a8323931ed759a94a5f85d60 by Miss Islington (bot) in branch '3.8': bpo-43075: Fix ReDoS in urllib AbstractBasicAuthHandler (GH-24391) https://github.com/python/cpython/commit/e7654b6046090914a8323931ed759a94a5f85d60 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:48:47 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 07 Apr 2021 11:48:47 +0000 Subject: [issue43759] StreamHandler does not print to sys.stderr immediately In-Reply-To: <1617782868.14.0.363269444057.issue43759@roundup.psfhosted.org> Message-ID: <1617796127.78.0.140537860136.issue43759@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: fixed -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 07:53:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 11:53:23 +0000 Subject: [issue43244] Move PyArena C API to the internal C API In-Reply-To: <1613586690.19.0.383646964758.issue43244@roundup.psfhosted.org> Message-ID: <1617796403.0.0.762360608581.issue43244@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +23990 pull_request: https://github.com/python/cpython/pull/25252 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 08:14:59 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 07 Apr 2021 12:14:59 +0000 Subject: [issue43761] Documenting dataclass and namedtuple changes for structural pattern matching In-Reply-To: <1617792027.47.0.961772614464.issue43761@roundup.psfhosted.org> Message-ID: <1617797699.62.0.892941837104.issue43761@roundup.psfhosted.org> Eric V. Smith added the comment: Turning off the generation of __match_args__ should be a separate issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 08:29:47 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 07 Apr 2021 12:29:47 +0000 Subject: [issue43763] [sqlite3] Use SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION iso. sqlite3_enable_load_extension() In-Reply-To: <1617795372.37.0.944356546491.issue43763@roundup.psfhosted.org> Message-ID: <1617798587.93.0.0477791974675.issue43763@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > We could add an optional argument for also enabling the SQL function. Actually, using sqlite3_db_config(SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, ...) can only enable the C API, not the SQL API, so adding an optional argument to sqlite3.enable_load_extension() makes no sense. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 08:36:04 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 07 Apr 2021 12:36:04 +0000 Subject: [issue43763] [sqlite3] Use SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION iso. sqlite3_enable_load_extension() In-Reply-To: <1617795372.37.0.944356546491.issue43763@roundup.psfhosted.org> Message-ID: <1617798964.38.0.565343679277.issue43763@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > Suggesting to make sqlite3.Connection.enable_load_extension a module level function This actually needs to be a sqlite3.Connection method, thus altering the behaviour of the current function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 09:07:21 2021 From: report at bugs.python.org (Adrian Freund) Date: Wed, 07 Apr 2021 13:07:21 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses Message-ID: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> New submission from Adrian Freund : The dataclass decorator can take multiple parameters to enable or disable the generation of certain methods. PEP 634 Structural Pattern Matching extends dataclasses to also generate a __match_args__ attribute. I think adding a parameter to enable and disable generation of __match_args__ should be to dataclass should also be considered for consistency. Note that setting compare=False on a dataclass.field already excludes that field from __match_args__, but there is no way to disable generation of __match_args__ completely. ---------- components: Library (Lib) messages: 390429 nosy: brandtbucher, eric.smith, freundTech, gvanrossum priority: normal severity: normal status: open title: Turning off generation of __match_args__ for dataclasses versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 09:09:18 2021 From: report at bugs.python.org (Adrian Freund) Date: Wed, 07 Apr 2021 13:09:18 +0000 Subject: [issue43761] Documenting dataclass and namedtuple changes for structural pattern matching In-Reply-To: <1617792027.47.0.961772614464.issue43761@roundup.psfhosted.org> Message-ID: <1617800958.46.0.903142196576.issue43761@roundup.psfhosted.org> Adrian Freund added the comment: Ok. I created https://bugs.python.org/issue43764 for that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 09:15:07 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 07 Apr 2021 13:15:07 +0000 Subject: [issue43763] [sqlite3] Use SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION iso. sqlite3_enable_load_extension() In-Reply-To: <1617795372.37.0.944356546491.issue43763@roundup.psfhosted.org> Message-ID: <1617801307.52.0.534514169821.issue43763@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Attached patch alters the behaviour of sqlite3.Connection.enable_load_extension() to never enabling the SQL API. This may require a deprecation period and a warning since it's a change in behaviour, but since enable_load_extention() is not enabled by default, we can perhaps do without the warning? ---------- keywords: +patch Added file: https://bugs.python.org/file49939/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 09:48:01 2021 From: report at bugs.python.org (Christer Weinigel) Date: Wed, 07 Apr 2021 13:48:01 +0000 Subject: [issue43765] Add support for the RFC5705 SSL_export_keying_material function Message-ID: <1617803281.61.0.449713524257.issue43765@roundup.psfhosted.org> New submission from Christer Weinigel : OpenSSL has a function to "SSL_export_keying_material" as described in RFC5705. This function is needed to be able to support a bunch of other protocols such as "Network Time Security for the Network Time Protocol" defined in RFC8915 and half a dozen other RFCs. I have written a patch to add support for this function which can be found on github: https://github.com/wingel/cpython And it is used in my implementation of the NTS procotol which can also be found on github: https://github.com/Netnod/nts-poc-python It would be very nice if mainline Python could support for this function in the future so that I don't have to maintain a patched version of Python for this. I'll make a pull request on github for this when I have a bpo number. ---------- assignee: christian.heimes components: SSL messages: 390432 nosy: christian.heimes, wingel71 priority: normal severity: normal status: open title: Add support for the RFC5705 SSL_export_keying_material function type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 09:50:00 2021 From: report at bugs.python.org (Christer Weinigel) Date: Wed, 07 Apr 2021 13:50:00 +0000 Subject: [issue43765] Add support for the RFC5705 SSL_export_keying_material function In-Reply-To: <1617803281.61.0.449713524257.issue43765@roundup.psfhosted.org> Message-ID: <1617803400.85.0.102541001124.issue43765@roundup.psfhosted.org> Change by Christer Weinigel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 09:51:42 2021 From: report at bugs.python.org (Christer Weinigel) Date: Wed, 07 Apr 2021 13:51:42 +0000 Subject: [issue37952] Add support for export_keying_material to SSL library In-Reply-To: <1566809344.46.0.817861457106.issue37952@roundup.psfhosted.org> Message-ID: <1617803502.08.0.385258994559.issue37952@roundup.psfhosted.org> Christer Weinigel added the comment: OpenSSL has a function to "SSL_export_keying_material" as described in RFC5705. This functionality is needed to be able to support a bunch of other protocols such as "Network Time Security for the Network Time Protocol" which has now become a proper RFC as RFC8915. There are half a dozen other RFCs which also use this functionality. I have written a patch to add support for this function which can be found on github: https://github.com/wingel/cpython And it is used in my implementation of the NTS procotol which can also be found on github: https://github.com/Netnod/nts-poc-python It would be very nice if mainline Python could support for this function in the future so that I don't have to maintain a patched version of Python for this. ---------- versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 09:54:17 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 07 Apr 2021 13:54:17 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1617803657.21.0.300422039573.issue43764@roundup.psfhosted.org> Eric V. Smith added the comment: What's the situation where having __match_args__ is actually harmful in some way? I understand that if the generated version is wrong, you'd want to specify it yourself. But what's the use case for not having __match_args__ at all? ---------- assignee: -> eric.smith type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 09:57:39 2021 From: report at bugs.python.org (Christer Weinigel) Date: Wed, 07 Apr 2021 13:57:39 +0000 Subject: [issue37952] Add support for export_keying_material to SSL library In-Reply-To: <1566809344.46.0.817861457106.issue37952@roundup.psfhosted.org> Message-ID: <1617803859.69.0.582956030017.issue37952@roundup.psfhosted.org> Change by Christer Weinigel : ---------- keywords: +patch pull_requests: +23991 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25255 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 10:01:46 2021 From: report at bugs.python.org (Carl Friedrich Bolz-Tereick) Date: Wed, 07 Apr 2021 14:01:46 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617804106.62.0.365760101427.issue43753@roundup.psfhosted.org> Carl Friedrich Bolz-Tereick added the comment: Just chiming in to say that for PyPy this API would be extremely useful, because PyPy's "is" is not implementable with a pointer comparison on the C level (due to unboxing we need to compare integers, floats, etc by value). Right now, C extension code that compares pointers is subtly broken and cannot be fixed by us. ---------- nosy: +Carl.Friedrich.Bolz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 10:27:50 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 07 Apr 2021 14:27:50 +0000 Subject: [issue43766] Implement PEP 647 (User-Defined Type Guards) in typing.py Message-ID: <1617805670.27.0.185154049077.issue43766@roundup.psfhosted.org> New submission from Ken Jin : PEP 647 was recently accepted by the SC: https://mail.python.org/archives/list/python-dev at python.org/thread/2ME6F6YUVKHOQYKSHTVQQU5WD4CVAZU4/ I'd like to work on the implementation for typing.py and any required docs later on (unless someone is already working on it, then I hope you'd let me help too ;). Hopefully I can get it in before the 3.10 beta freeze. typing_extensions will need a port too, though that is much less urgent at the moment. ---------- components: Library (Lib) messages: 390436 nosy: gvanrossum, kj priority: normal severity: normal status: open title: Implement PEP 647 (User-Defined Type Guards) in typing.py versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 10:44:00 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 07 Apr 2021 14:44:00 +0000 Subject: [issue43495] Missing frame block push in compiler_async_comprehension_generator() In-Reply-To: <1615768342.52.0.844768701599.issue43495@roundup.psfhosted.org> Message-ID: <1617806640.04.0.36884014029.issue43495@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 7a7ba3d343d360a03a34bc3901628f9f40a58307 by tomKPZ in branch 'master': bpo-43495 : Push missing frame block in compile.c (GH-24865) https://github.com/python/cpython/commit/7a7ba3d343d360a03a34bc3901628f9f40a58307 ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 10:53:52 2021 From: report at bugs.python.org (PEW's Corner) Date: Wed, 07 Apr 2021 14:53:52 +0000 Subject: [issue43751] await anext() returns None when default is given In-Reply-To: <1617724814.14.0.517501509303.issue43751@roundup.psfhosted.org> Message-ID: <1617807232.75.0.0898396653457.issue43751@roundup.psfhosted.org> PEW's Corner added the comment: Regarding the custom async iterator, I don't know if this is the problem you're referring to, but the following code seems to terminate abruptly when running main2() (main1() is fine). This is without your changes, though. import asyncio class CustomAsyncIter: def __init__(self): self.iterator = iter(['A', 'B']) def __aiter__(self): return self async def __anext__(self): try: x = next(self.iterator) except StopIteration: raise StopAsyncIteration from None await asyncio.sleep(1) return x async def main1(): iter1 = CustomAsyncIter() print(await anext(iter1)) # Prints 'A' print(await anext(iter1)) # Prints 'B' print(await anext(iter1)) # Raises StopAsyncIteration async def main2(): iter1 = CustomAsyncIter() print('Before') # Prints 'Before' print(await anext(iter1, 'Z')) # Silently terminates the script!!! print('After') # This never gets executed asyncio.run(main2()) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 11:47:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 15:47:22 +0000 Subject: [issue43244] Move PyArena C API to the internal C API In-Reply-To: <1613586690.19.0.383646964758.issue43244@roundup.psfhosted.org> Message-ID: <1617810442.43.0.155861357149.issue43244@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +23992 pull_request: https://github.com/python/cpython/pull/25256 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 11:53:46 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 15:53:46 +0000 Subject: [issue39906] pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()` In-Reply-To: <1583699719.8.0.302577003742.issue39906@roundup.psfhosted.org> Message-ID: <1617810826.58.0.576845544595.issue39906@roundup.psfhosted.org> Steve Dower added the comment: New changeset abf964942f97f6489360a75fd57b5e4f41c75f57 by Barney Gale in branch 'master': bpo-39906: Add follow_symlinks parameter to pathlib.Path.stat() and chmod() (GH-18864) https://github.com/python/cpython/commit/abf964942f97f6489360a75fd57b5e4f41c75f57 ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 11:53:57 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 15:53:57 +0000 Subject: [issue39906] pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()` In-Reply-To: <1583699719.8.0.302577003742.issue39906@roundup.psfhosted.org> Message-ID: <1617810837.32.0.408749438596.issue39906@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 11:55:44 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 07 Apr 2021 15:55:44 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1617810944.79.0.395648745216.issue43739@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 11:56:38 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 15:56:38 +0000 Subject: [issue42999] `pathlib.Path.link_to()` documentation is misleading In-Reply-To: <1611289460.25.0.942447627462.issue42999@roundup.psfhosted.org> Message-ID: <1617810998.02.0.612313435291.issue42999@roundup.psfhosted.org> Steve Dower added the comment: New changeset 8aac1bea2eeac25a49f8912b67aacbedf9bc7934 by Barney Gale in branch 'master': bpo-42999: Expand and clarify pathlib.Path.link_to() documentation. (GH-24294) https://github.com/python/cpython/commit/8aac1bea2eeac25a49f8912b67aacbedf9bc7934 ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 11:58:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 15:58:07 +0000 Subject: [issue43075] ReDoS in urllib.request In-Reply-To: <1611994306.46.0.333529770265.issue43075@roundup.psfhosted.org> Message-ID: <1617811087.44.0.22782961427.issue43075@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a21d4fbd549ec9685068a113660553d7f80d9b09 by Miss Islington (bot) in branch '3.9': bpo-43075: Fix ReDoS in urllib AbstractBasicAuthHandler (GH-24391) (GH-25247) https://github.com/python/cpython/commit/a21d4fbd549ec9685068a113660553d7f80d9b09 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 12:08:19 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 07 Apr 2021 16:08:19 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1617811699.71.0.387525506064.issue43723@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Just to add the last time isAlive was removed in favor of is_alive it was significant change enough that several libraries in Fedora packaging Python libraries and other open source code. The GitHub PR shows several projects that were affected and I linked to this PR while filing the fixes to relevant libraries. https://github.com/python/cpython/pull/15225 There are still new reports of the isAlive change when people try to upgrade : https://github.com/search?l=Python&o=desc&q=isalive+is%3Aissue&s=updated&state=open&type=Issues I would request to really weigh in the cost of doing this since at one point this will cause more burden when the aliases have to be removed in future hindering Python upgrades and the change just seems to unify the casing of the method names without helping the user here. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 12:24:24 2021 From: report at bugs.python.org (paul j3) Date: Wed, 07 Apr 2021 16:24:24 +0000 Subject: [issue43220] Argparse: Explicit default required arguments with add_mutually_exclusive_group are rejected In-Reply-To: <1613284485.11.0.495534943099.issue43220@roundup.psfhosted.org> Message-ID: <1617812664.31.0.227909679004.issue43220@roundup.psfhosted.org> paul j3 added the comment: An overlapping issue https://bugs.python.org/issue18943 argparse: default args in mutually exclusive groups That issue shows that this problem arises with small integers as well (<257), which in cpython have unique ids. It's an implementation detail, pypy for example does not have this issue. The whole purpose of this extra default testing is to allow '?/*' positionals in mutually_exclusive_groups. The patch I proposed in 2013 is basically the same thing, except I called the new flag variable 'using_default'. We should review the discussion in that issue to see if it raises any additional issues or concerns. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 12:24:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 16:24:32 +0000 Subject: [issue43244] Move PyArena C API to the internal C API In-Reply-To: <1613586690.19.0.383646964758.issue43244@roundup.psfhosted.org> Message-ID: <1617812672.7.0.435469692061.issue43244@roundup.psfhosted.org> STINNER Victor added the comment: typed-ast was updated for these changes and to avoid including explicitly pydebug.h (it's included by Python.h: see bpo-35134 change): https://github.com/python/typed_ast/pull/158 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 12:29:14 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 16:29:14 +0000 Subject: [issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path In-Reply-To: <1612285380.24.0.495785451269.issue43105@roundup.psfhosted.org> Message-ID: <1617812954.14.0.448535436427.issue43105@roundup.psfhosted.org> Steve Dower added the comment: The 3.8 backport is much more complicated, as we don't have access to the PathSkipRoot function there. So we can't use the native function. There's probably another way to implement the fix for 3.8, but I'm leaving that for another day. Feel free to chime in with suggestions and/or PRs. ---------- versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 12:29:58 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 16:29:58 +0000 Subject: [issue42999] `pathlib.Path.link_to()` documentation is misleading In-Reply-To: <1611289460.25.0.942447627462.issue42999@roundup.psfhosted.org> Message-ID: <1617812998.62.0.100037943761.issue42999@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +23993 pull_request: https://github.com/python/cpython/pull/25257 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 12:31:56 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 16:31:56 +0000 Subject: [issue39659] pathlib calls `os.getcwd()` without using accessor In-Reply-To: <1581901062.0.0.795874471606.issue39659@roundup.psfhosted.org> Message-ID: <1617813116.64.0.895432636915.issue39659@roundup.psfhosted.org> Steve Dower added the comment: New changeset b05440c52b9814dbd47f679d47367e87855bd7b5 by Barney Gale in branch 'master': bpo-39659: Route calls from pathlib.Path to os.getcwd() via the path accessor (GH-18834) https://github.com/python/cpython/commit/b05440c52b9814dbd47f679d47367e87855bd7b5 ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 12:57:11 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 07 Apr 2021 16:57:11 +0000 Subject: [issue43716] curses.pair_number() function incorrect value under Windows In-Reply-To: <1617478451.24.0.000946150268907.issue43716@roundup.psfhosted.org> Message-ID: <1617814631.31.0.47167564758.issue43716@roundup.psfhosted.org> Serhiy Storchaka added the comment: The curses module is not supported on Windows. windows-curses is a third-party library. Use the corresponding bug tracker to report an issue with windows-curses. ---------- nosy: +serhiy.storchaka resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 13:00:00 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 07 Apr 2021 17:00:00 +0000 Subject: [issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow? In-Reply-To: <1610404013.09.0.265713602389.issue42899@roundup.psfhosted.org> Message-ID: <1617814800.92.0.299092524282.issue42899@roundup.psfhosted.org> Ethan Furman added the comment: Mark, it looks like the consensus is your proposal: "The implementation is allowed to skip any boolean test of a value, when it has *no* effect on the flow of the program and *at least one test* has already been performed on that value." Has the implementation been updated to reflect this? The beta freeze will be here soon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 13:11:21 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 17:11:21 +0000 Subject: [issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()` In-Reply-To: <1583643972.77.0.25342179601.issue39899@roundup.psfhosted.org> Message-ID: <1617815481.02.0.274454405363.issue39899@roundup.psfhosted.org> Steve Dower added the comment: I think this is worth unifying, but I'm concerned about making expanduser() return the original path on Windows - "~name" is a valid filename/relative path, and so code that does mkdir(expanduser("~nonuser/dir")) could create garbage in the current directory. I'd rather just raise OSError (or I guess RuntimeError, for consistency). Long term, I'd like to see it switch to calling GetProfilesDirectory on Windows, but that's separate from this change, and doesn't invalidate this one. Reading through the discussion, it seems like the primary concern about the change is "change for change sake". I think the amount and kind of code that's being removed is a good thing, and it's better represented as an "expand" step in the accessor than a "get" from the path. So let's get it merged, probably(?) with a stronger error for the unknown users, but happy to be talked out of that. And only for 3.10. ---------- nosy: +steve.dower resolution: not a bug -> stage: resolved -> patch review status: closed -> open versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 13:12:46 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 17:12:46 +0000 Subject: [issue42999] `pathlib.Path.link_to()` documentation is misleading In-Reply-To: <1611289460.25.0.942447627462.issue42999@roundup.psfhosted.org> Message-ID: <1617815566.29.0.690247941693.issue42999@roundup.psfhosted.org> Steve Dower added the comment: New changeset 34f93002bac980176a670ce2a4038c3be84effed by Steve Dower in branch '3.9': bpo-42999: Expand and clarify pathlib.Path.link_to() documentation. (GH-24294) https://github.com/python/cpython/commit/34f93002bac980176a670ce2a4038c3be84effed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 13:14:48 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 17:14:48 +0000 Subject: [issue42999] `pathlib.Path.link_to()` documentation is misleading In-Reply-To: <1611289460.25.0.942447627462.issue42999@roundup.psfhosted.org> Message-ID: <1617815688.08.0.655672818697.issue42999@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +23994 pull_request: https://github.com/python/cpython/pull/25258 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 13:20:42 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 07 Apr 2021 17:20:42 +0000 Subject: [issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow? In-Reply-To: <1610404013.09.0.265713602389.issue42899@roundup.psfhosted.org> Message-ID: <1617816042.14.0.929095493512.issue42899@roundup.psfhosted.org> Mark Shannon added the comment: I implemented it ages ago :) https://github.com/python/cpython/pull/24417 I need to be better at closing issues. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 13:21:14 2021 From: report at bugs.python.org (Barney Gale) Date: Wed, 07 Apr 2021 17:21:14 +0000 Subject: [issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()` In-Reply-To: <1583643972.77.0.25342179601.issue39899@roundup.psfhosted.org> Message-ID: <1617816074.1.0.189054233714.issue39899@roundup.psfhosted.org> Barney Gale added the comment: Thanks for taking a look, Steve. A couple things maybe worth noting: Firstly, `os.path.expanduser()` is already documented to return the path unchanged if the home directory can't be resolved: > If the expansion fails or if the path does not begin with a tilde, the path is returned unchanged. Secondly, `ntpath.expanduser()` already returns the path unchanged if neither USERPROFILE nor HOMEPATH are in the environment. An alternative would be to leave `ntpath.expanduser()` method alone, and forgo the slightly-improved error checking in `WindowsPath.expanduser()` in the name of conformity. Or perhaps we could add a `stict` parameter to `expanduser()`? I can understand why this could be seen as change for change's sake. In fact this code removal greatly aids my work towards addressing bpo-24132. Thanks again ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed versions: +Python 3.9 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 13:41:48 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 07 Apr 2021 17:41:48 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1617817308.41.0.636387345178.issue43764@roundup.psfhosted.org> Brandt Bucher added the comment: I agree with Eric. You can already disable the automatic creation of __match_args__ by setting it yourself on the class being decorated, and "__match_args__ = ()" will make the class behave the exact same as if __match_args__ is not defined at all. >>> from dataclasses import dataclass >>> @dataclass ... class X: ... __match_args__ = () ... a: int ... b: int ... c: int ... >>> X.__match_args__ () I too have trouble imagining a case where the actual *presence* of the attribute matters. But assuming those cases exist, wouldn't a simple "del X.__match_args__" suffice? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 13:48:56 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 07 Apr 2021 17:48:56 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1617817736.29.0.54639176859.issue43764@roundup.psfhosted.org> Brandt Bucher added the comment: > Note that setting compare=False on a dataclass.field already excludes that field from __match_args__... It appears you did find a genuine bug though! I was surprised by this comment, and after digging a bit deeper into _process_class found that we should be generating these from "field_list", not "flds": >>> @dataclass(repr=False, eq=False, init=False) ... class X: ... a: int ... b: int ... c: int ... Traceback (most recent call last): File "", line 2, in File "/home/bucher/src/cpython/Lib/dataclasses.py", line 1042, in wrap return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen) File "/home/bucher/src/cpython/Lib/dataclasses.py", line 1020, in _process_class cls.__match_args__ = tuple(f.name for f in flds if f.init) UnboundLocalError: local variable 'flds' referenced before assignment ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 13:50:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 07 Apr 2021 17:50:29 +0000 Subject: [issue18861] Problems with recursive automatic exception chaining In-Reply-To: <1377657727.9.0.627993776621.issue18861@psf.upfronthosting.co.za> Message-ID: <1617817829.65.0.914471407227.issue18861@roundup.psfhosted.org> Irit Katriel added the comment: For the issue of which contexts need to be suppressed when __suppress_context__ is true, I think we don't need to keep the whole tree of exceptions. It might be enough to save the dynamic "nesting depth of the try-excepts". Here is a solution with two integers per exception, plus one on the thread state. Would it work? We add an int field called except_depth to the thread state (incremented in ceval just before the try of a try-except and decremented after the last except: block). Whenever an exception is caught, this value is copied to it (to a new int we put on BaseException, call it depth). The __suppress_context__ field we change from bool to int (alternatively: add a new field and leave this one alone). Instead of setting it to True when there is __cause__, we set it to the except-depth of the raise...from that raised it. Then the code displaying the traceback can use the depths information to determine which contexts to suppress (the ones up to and not including the first one with depth < the suppress_context value). Returning to Nick's examples from 2013-11-08 14:34: # No context on Exception3 is exactly what we want try: try: raise Exception1 except Exception1: raise Exception2 except Exception2 as exc raise Exception3 from Exception2 Exception1 - depth = 2 Exception2 - depth = 1 Exception3 - depth = ? suppress_context = 1 (suppress both Exception1 and Exception2, they have depths >= 1) # Not seeing Exception1 as the context for Exception3 is surprising! try: raise Exception1 except Exception1: try: raise Exception2 except Exception2 as exc raise Exception3 from Exception2 Exception1 - depth = 1 Exception2 - depth = 2 Exception3 - depth = ? suppress_context = 2 (suppress only Exception2, Exception1 is too shallow) To consider more elaborate nesting: try: try: raise Exception0 except T: # Does not catch Exception0 pass except Exception1: try: raise Exception2 except Exception2 as exc raise Exception3 from Exception2 Whatever happens in the topmost try-block, if Exception0 is the context of anything raised inside the "except Exception1" block, then its depth is 1 because it was caught by this except. So it won't be suppressed by anything raised at a deeper level. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 13:59:31 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 07 Apr 2021 17:59:31 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617818371.8.0.848790063722.issue43753@roundup.psfhosted.org> Raymond Hettinger added the comment: > Just chiming in to say that for PyPy this API would be extremely useful Thanks for that input. Given that there would be some value add, I withdraw my objection. > I proposed to declare it as a "static inline" function, > but I'm fine with a macro as well. Let's use a macro then because inlining in guaranteed and we don't have to be on the lookout for failures to inline. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 14:03:51 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 07 Apr 2021 18:03:51 +0000 Subject: [issue43761] Documenting dataclass and namedtuple changes for structural pattern matching In-Reply-To: <1617792027.47.0.961772614464.issue43761@roundup.psfhosted.org> Message-ID: <1617818631.14.0.457194155797.issue43761@roundup.psfhosted.org> Raymond Hettinger added the comment: > This change is currently not documented in the dataclass > and namedtuple documentation, I don't think we need to do that. In the end, __match_args__ will be added in many places. The right place to document it is in the pattern matching docs. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 14:15:38 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 07 Apr 2021 18:15:38 +0000 Subject: [issue43766] Implement PEP 647 (User-Defined Type Guards) in typing.py In-Reply-To: <1617805670.27.0.185154049077.issue43766@roundup.psfhosted.org> Message-ID: <1617819338.75.0.516720117529.issue43766@roundup.psfhosted.org> Guido van Rossum added the comment: Go for it! I assume that this will be pretty simple, right? TypeGuard[X] should show up in __annotations__ as exactly that. It can be implemented in pure Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 14:17:21 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 07 Apr 2021 18:17:21 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1617819441.71.0.43500043956.issue43739@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 14:18:03 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Apr 2021 18:18:03 +0000 Subject: [issue43755] lambda expression no longer valid at comp_if in Python 3.9 In-Reply-To: <1617739645.22.0.813638332511.issue43755@roundup.psfhosted.org> Message-ID: <1617819483.21.0.214234075538.issue43755@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset f91fc7a679e076cb9a703f6db4d95b63935562e3 by Miss Islington (bot) in branch '3.9': bpo-43755: Update docs to reflect that lambda is not allowed in `comp_if` since 3.9 (GH-25231) (GH-25233) https://github.com/python/cpython/commit/f91fc7a679e076cb9a703f6db4d95b63935562e3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 14:23:51 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 18:23:51 +0000 Subject: [issue42999] `pathlib.Path.link_to()` documentation is misleading In-Reply-To: <1611289460.25.0.942447627462.issue42999@roundup.psfhosted.org> Message-ID: <1617819831.43.0.116700516434.issue42999@roundup.psfhosted.org> Steve Dower added the comment: New changeset 9f578734624d1c0172220556ca97898730144172 by Steve Dower in branch '3.8': bpo-42999: Expand and clarify pathlib.Path.link_to() documentation. (GH-24294) https://github.com/python/cpython/commit/9f578734624d1c0172220556ca97898730144172 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 14:25:29 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 18:25:29 +0000 Subject: [issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()` In-Reply-To: <1583643972.77.0.25342179601.issue39899@roundup.psfhosted.org> Message-ID: <1617819929.24.0.166088900116.issue39899@roundup.psfhosted.org> Steve Dower added the comment: > Firstly, `os.path.expanduser()` is already documented to return the path unchanged if the home directory can't be resolved: Ah, too bad. Doesn't prevent us from changing it, but hopefully it means that everyone using it is already checking the result and not blindly using it. > I can understand why this could be seen as change for change's sake. In fact this code removal greatly aids my work towards addressing bpo-24132. In light of this, did you mean to close the issue? Or do you still want to pursue making the change? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 14:32:57 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 18:32:57 +0000 Subject: [issue39659] pathlib calls `os.getcwd()` without using accessor In-Reply-To: <1581901062.0.0.795874471606.issue39659@roundup.psfhosted.org> Message-ID: <1617820377.07.0.972977887464.issue39659@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 14:33:30 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 07 Apr 2021 18:33:30 +0000 Subject: [issue43767] Compiler arning about 'Yield' macro redefinition on Windows Message-ID: <1617820410.09.0.691386987943.issue43767@roundup.psfhosted.org> New submission from Guido van Rossum : When building from scratch on Windows I get this warning: c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\winbase.h(103): warning C4005: 'Yield': macro redefinition [C:\Users\gvanrossum\cpython\PCbuild\pythoncore.vcxproj] I know there is at least one place where we try to prevent this warning, e.g. in Include/internal/pycore_ast.h there's this line: #undef Yield /* undefine macro conflicting with */ But apparently this isn't enough, or the error comes from a different file, or some rearrangement of header files made this #undef ineffective. Victor, is it possible that your https://github.com/python/cpython/pull/24933 reintroduced this warning? Steve, what can I do to diagnose this better? (The warning doesn't tell me where winbase.h was included.) ---------- components: Windows messages: 390462 nosy: gvanrossum, paul.moore, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal stage: needs patch status: open title: Compiler arning about 'Yield' macro redefinition on Windows type: compile error versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 14:33:34 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 18:33:34 +0000 Subject: [issue42999] `pathlib.Path.link_to()` documentation is misleading In-Reply-To: <1611289460.25.0.942447627462.issue42999@roundup.psfhosted.org> Message-ID: <1617820414.73.0.0423434602377.issue42999@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 14:34:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 18:34:00 +0000 Subject: [issue43767] Compiler arning about 'Yield' macro redefinition on Windows In-Reply-To: <1617820410.09.0.691386987943.issue43767@roundup.psfhosted.org> Message-ID: <1617820440.84.0.981363394427.issue43767@roundup.psfhosted.org> STINNER Victor added the comment: This issue should be fixed: commit d36d6a9c1808e87628ebaa855d4bec80130189f4 Author: Victor Stinner Date: Wed Apr 7 13:01:09 2021 +0200 bpo-43244: Remove Yield macro from pycore_ast.h (GH-25243) * pycore_ast.h no longer defines the Yield macro. * Fix a compiler warning on Windows: "warning C4005: 'Yield': macro redefinition". * Python-ast.c now defines directly functions with their real _Py_xxx() name, rather than xxx(). * Remove "#undef Yield" in C files including pycore_ast.h. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 14:35:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 18:35:27 +0000 Subject: [issue43767] Compiler arning about 'Yield' macro redefinition on Windows In-Reply-To: <1617820410.09.0.691386987943.issue43767@roundup.psfhosted.org> Message-ID: <1617820527.92.0.599927366788.issue43767@roundup.psfhosted.org> STINNER Victor added the comment: Fixing this super annoying Yield warning was one of my motivation for moving Python-ast.h to the internal C API (pycore_ast.h) :-D I disliked that Python-ast.h defined tons of symbols without "Py" (or "_Py") prefix: commit 94faa0724f8cbae6867c491c8e465e35f4fdbfbb Author: Victor Stinner Date: Tue Mar 23 20:47:40 2021 +0100 bpo-43244: Remove ast.h, asdl.h, Python-ast.h headers (GH-24933) These functions were undocumented and excluded from the limited C API. Most names defined by these header files were not prefixed by "Py" and so could create names conflicts. For example, Python-ast.h defined a "Yield" macro which was conflict with the "Yield" name used by the Windows header. Use the Python ast module instead. * Move Include/asdl.h to Include/internal/pycore_asdl.h. * Move Include/Python-ast.h to Include/internal/pycore_ast.h. * Remove ast.h header file. * pycore_symtable.h no longer includes Python-ast.h. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 14:35:59 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 07 Apr 2021 18:35:59 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1617820559.82.0.698503048764.issue43764@roundup.psfhosted.org> Guido van Rossum added the comment: I assume the OP wants to have a class that doesn't allow positional patterns. The right way to spell that is indeed to add __match_args__ = () to the class, there's no need to add another flag to @dataclass. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 14:44:39 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 07 Apr 2021 18:44:39 +0000 Subject: [issue43767] Compiler arning about 'Yield' macro redefinition on Windows In-Reply-To: <1617820410.09.0.691386987943.issue43767@roundup.psfhosted.org> Message-ID: <1617821079.47.0.74372150848.issue43767@roundup.psfhosted.org> Guido van Rossum added the comment: Thanks! Dup of bpo-43244. ---------- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 15:06:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Apr 2021 19:06:51 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1617822411.66.0.273437378012.issue36540@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 58d72cab89cf9652acc0bf0007aa20b2bcc98499 by Saiyang Gou in branch 'master': bpo-36540: Improve doc of function definition regarding positional-only arguments (GH-25235) https://github.com/python/cpython/commit/58d72cab89cf9652acc0bf0007aa20b2bcc98499 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 15:12:18 2021 From: report at bugs.python.org (Saiyang Gou) Date: Wed, 07 Apr 2021 19:12:18 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1617822738.08.0.625651072505.issue36540@roundup.psfhosted.org> Change by Saiyang Gou : ---------- pull_requests: +23995 pull_request: https://github.com/python/cpython/pull/25259 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 15:12:33 2021 From: report at bugs.python.org (Jerry Chen) Date: Wed, 07 Apr 2021 19:12:33 +0000 Subject: [issue43768] Possible race condition on multiprocessing.Manager().dict() on macOS Message-ID: <1617822753.2.0.370273367232.issue43768@roundup.psfhosted.org> New submission from Jerry Chen : I am not sure if this is a bug or an expected case. Long story short, I tried to print the content of a `multiprocessing.Manager().dict()` in the main thread, but I got a strange error. I encountered this error only when the number of pools is rather large (>20) and only on `macOS` (works perfectly on `Linux`). Specs: ``` CPU: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz macOS: 11.2.3 ``` The minimum err code is attached: ```python3 #!/usr/bin/env python3 from contextlib import suppress import multiprocessing as mp import time def run(): D[mp.current_process().name] = 'some val' time.sleep(0.5) if __name__ == '__main__': mp.set_start_method('fork') D, rets = mp.Manager().dict(), [] with mp.Pool(25) as p: for _ in range(33): rets.append(p.apply_async(run)) while rets: for ret in rets[:]: with suppress(mp.TimeoutError): ret.get(timeout=0) rets.remove(ret) print(len(D)) ``` Error: ``` multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/usr/local/Cellar/python at 3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/managers.py", line 801, in _callmethod conn = self._tls.connection AttributeError: 'ForkAwareLocal' object has no attribute 'connection' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/Cellar/python at 3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "/Users/???", line 9, in run D[mp.current_process().name] = 'some val' File "", line 2, in __setitem__ File "/usr/local/Cellar/python at 3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/managers.py", line 805, in _callmethod self._connect() File "/usr/local/Cellar/python at 3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/managers.py", line 792, in _connect conn = self._Client(self._token.address, authkey=self._authkey) File "/usr/local/Cellar/python at 3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/connection.py", line 507, in Client c = SocketClient(address) File "/usr/local/Cellar/python at 3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/connection.py", line 635, in SocketClient s.connect(address) ConnectionRefusedError: [Errno 61] Connection refused """ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Users/???", line 22, in ret.get(timeout=0) File "/usr/local/Cellar/python at 3.9/3.9.2_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 771, in get raise self._value ConnectionRefusedError: [Errno 61] Connection refused ``` ---------- components: macOS messages: 390468 nosy: jerryc443, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Possible race condition on multiprocessing.Manager().dict() on macOS type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 15:14:52 2021 From: report at bugs.python.org (Saiyang Gou) Date: Wed, 07 Apr 2021 19:14:52 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1617822892.2.0.58005594614.issue36540@roundup.psfhosted.org> Change by Saiyang Gou : ---------- pull_requests: +23996 pull_request: https://github.com/python/cpython/pull/25260 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 15:18:46 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 19:18:46 +0000 Subject: [issue37609] support "UNC" device paths in ntpath.splitdrive In-Reply-To: <1563362794.09.0.456380769613.issue37609@roundup.psfhosted.org> Message-ID: <1617823126.19.0.84451627825.issue37609@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +23997 pull_request: https://github.com/python/cpython/pull/25261 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 15:32:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 19:32:24 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617823944.54.0.720703204615.issue43753@roundup.psfhosted.org> STINNER Victor added the comment: PR 25227: I reimplemented Py_Is() as a macro and I added unit tests. Other added functions simply call Py_Is(), example: #define Py_IsNone(x) Py_Is(x, Py_None) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 15:32:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Apr 2021 19:32:32 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1617823952.66.0.181427834224.issue36540@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 4554ab435727a0f3b6441c9c1a8d3fe6534433c7 by Saiyang Gou in branch '3.8': [3.8] bpo-36540: Improve doc of function definition regarding positional-only arguments (GH-25235) (GH-25260) https://github.com/python/cpython/commit/4554ab435727a0f3b6441c9c1a8d3fe6534433c7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 15:32:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Apr 2021 19:32:56 +0000 Subject: [issue36540] PEP 570: Python Positional-Only Parameters In-Reply-To: <1554512763.87.0.931597726758.issue36540@roundup.psfhosted.org> Message-ID: <1617823976.06.0.479909423192.issue36540@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 3b1cf202976d9590d5b453c47b883f2e7cd1a7a5 by Saiyang Gou in branch '3.9': [3.9] bpo-36540: Improve doc of function definition regarding positional-only arguments (GH-25235) (GH-25259) https://github.com/python/cpython/commit/3b1cf202976d9590d5b453c47b883f2e7cd1a7a5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 15:33:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 19:33:06 +0000 Subject: [issue43767] Compiler arning about 'Yield' macro redefinition on Windows In-Reply-To: <1617820410.09.0.691386987943.issue43767@roundup.psfhosted.org> Message-ID: <1617823986.43.0.545020094493.issue43767@roundup.psfhosted.org> Change by STINNER Victor : ---------- superseder: -> Move PyArena C API to the internal C API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 15:34:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 19:34:32 +0000 Subject: [issue43244] Move PyArena C API to the internal C API In-Reply-To: <1613586690.19.0.383646964758.issue43244@roundup.psfhosted.org> Message-ID: <1617824072.25.0.972244968547.issue43244@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d27f8d2e07d31670af469ef387a37bc9e96ea8ad by Victor Stinner in branch 'master': bpo-43244: Rename pycore_ast.h functions to _PyAST_xxx() (GH-25252) https://github.com/python/cpython/commit/d27f8d2e07d31670af469ef387a37bc9e96ea8ad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 15:35:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 19:35:41 +0000 Subject: [issue43244] Move PyArena C API to the internal C API In-Reply-To: <1613586690.19.0.383646964758.issue43244@roundup.psfhosted.org> Message-ID: <1617824141.75.0.0372700004699.issue43244@roundup.psfhosted.org> STINNER Victor added the comment: "Remove Yield macro from pycore_ast.h" I'm happy that this one is gone, it was a common and annoying compiler warning on Windows! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 15:52:13 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 07 Apr 2021 19:52:13 +0000 Subject: [issue43766] Implement PEP 647 (User-Defined Type Guards) in typing.py In-Reply-To: <1617805670.27.0.185154049077.issue43766@roundup.psfhosted.org> Message-ID: <1617825133.74.0.26915763699.issue43766@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 16:34:58 2021 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 07 Apr 2021 20:34:58 +0000 Subject: [issue15443] datetime module has no support for nanoseconds In-Reply-To: <1343158610.62.0.806232279741.issue15443@psf.upfronthosting.co.za> Message-ID: <1617827698.37.0.627479234128.issue15443@roundup.psfhosted.org> Alexander Belopolsky added the comment: @pganssle - let's keep the substantive discussions in the tracker so that they are not lost on github. You wrote: """ what is still blocking / needs to be done on this? Beta freeze for Python 3.10 is coming up at the beginning of May and I think we may have enough time to get this in before then. Probably would have been better to get it into an alpha release, but if we miss beta freeze it'll get pushed to 3.11, and I do think that nanosecond support is a desirable feature for a lot of people. It might be good for us to get an explicit "to-do" list of concerns to be addressed before this can be merged. """ I don't think full nanosecond support is feasible to complete in the remaining weeks, but we can try to add nanoseconds to timedelta only. The mixed datetime + timedelta ops will still truncate, but many time-related operations will be enabled. I would even argue that when nanoseconds precision is required, it is more often intervals no longer than a few days and rarely a specific point in time. ---------- versions: +Python 3.10 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 16:56:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 20:56:51 +0000 Subject: [issue42923] Py_FatalError(): dump the list of extension modules In-Reply-To: <1610535013.1.0.942204365805.issue42923@roundup.psfhosted.org> Message-ID: <1617829011.22.0.67605498319.issue42923@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +23998 pull_request: https://github.com/python/cpython/pull/25262 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 17:13:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 21:13:01 +0000 Subject: [issue42923] Py_FatalError(): dump the list of extension modules In-Reply-To: <1610535013.1.0.942204365805.issue42923@roundup.psfhosted.org> Message-ID: <1617829981.81.0.214531202608.issue42923@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3d55aa9e7365af76e40680271328deece27a7339 by Victor Stinner in branch 'master': bpo-42923: Fix _Py_DumpExtensionModules() for NULL sysdict (GH-25262) https://github.com/python/cpython/commit/3d55aa9e7365af76e40680271328deece27a7339 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 17:13:43 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 07 Apr 2021 21:13:43 +0000 Subject: [issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path In-Reply-To: <1612285380.24.0.495785451269.issue43105@roundup.psfhosted.org> Message-ID: <1617830023.8.0.245875153564.issue43105@roundup.psfhosted.org> Eryk Sun added the comment: > The 3.8 backport is much more complicated, as we don't have access to > the PathSkipRoot function there. So we can't use the native function. I guess you missed the comment that I left on the PR a few days ago. The 3.8 backport can use the older PathSkipRootW() in shlwapi.dll [1]. It works similarly, except it doesn't support a drive relative root such as "C:spam" -> ("C:", "spam"), but it's easy enough to handle that case in C. Also, it's documented that it's limited to MAX_PATH, but it works fine with long paths in Windows 10, even if the process does not have long-path support enabled. Anyway, just limit the copy to the first `MAX_PATH - 1` characters. Practically speaking, no root is anywhere near that long. It would require a ridiculously long device name in a "\\.\" device path. Examples: import ctypes shlwapi = ctypes.WinDLL('shlwapi') shlwapi.PathSkipRootW.restype = ctypes.c_wchar_p path = (ctypes.c_wchar * 1000)() It returns NULL if there's no root: >>> path.value = r'spam' >>> shlwapi.PathSkipRootW(path) is None True Drive-relative paths aren't supported the same as they are in PathCchSkipRoot(): >>> path.value = r'C:spam' >>> shlwapi.PathSkipRootW(path) is None True Otherwise it seems to support the same range of paths as PathCchSkipRoot(): >>> path.value = r'\spam' >>> shlwapi.PathSkipRootW(path) 'spam' >>> path.value = r'C:\spam' >>> shlwapi.PathSkipRootW(path) 'spam' >>> path.value = r'\\server\share\spam' >>> shlwapi.PathSkipRootW(path) 'spam' >>> path.value = r'\\?\C:\spam' >>> shlwapi.PathSkipRootW(path) 'spam' >>> path.value = r'\\?\UNC\server\share\spam' >>> shlwapi.PathSkipRootW(path) 'spam' >>> path.value = r'\\?\Volume{12345678-1234-1234-1234-123456789ABC}\spam' >>> shlwapi.PathSkipRootW(path) 'spam' >>> path.value = r'\\.\PIPE\spam' >>> shlwapi.PathSkipRootW(path) 'spam' --- [1] https://docs.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-pathskiprootw ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 17:17:20 2021 From: report at bugs.python.org (Barney Gale) Date: Wed, 07 Apr 2021 21:17:20 +0000 Subject: [issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()` In-Reply-To: <1583643972.77.0.25342179601.issue39899@roundup.psfhosted.org> Message-ID: <1617830240.86.0.816746107767.issue39899@roundup.psfhosted.org> Barney Gale added the comment: Apologies, I think I started writing a comment before your reply was posted, which undid your changes. ---------- resolution: not a bug -> status: closed -> open versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 17:24:15 2021 From: report at bugs.python.org (Philip Bond) Date: Wed, 07 Apr 2021 21:24:15 +0000 Subject: [issue43769] ipaddress module takes bytes input as valid ip address Message-ID: <1617830655.85.0.0538438287047.issue43769@roundup.psfhosted.org> New submission from Philip Bond : Hi I came across an issue with the ipaddress module where it doesent raise a ValueError when passed a non IP address. Example see attached file use tabs for indents and that doesent work with the form. What happens is it when it takes b'PING' as the call to ipaddress.IPv4Address(address) as the byte value == 4 it doesent raise a ValueError as the bytes for PING are 50 49 4e 47 ---------- components: Unicode files: cidr-gen.py messages: 390478 nosy: ezio.melotti, philip.bond, vstinner priority: normal severity: normal status: open title: ipaddress module takes bytes input as valid ip address type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file49940/cidr-gen.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 17:26:58 2021 From: report at bugs.python.org (Paul Ganssle) Date: Wed, 07 Apr 2021 21:26:58 +0000 Subject: [issue15443] datetime module has no support for nanoseconds In-Reply-To: <1343158610.62.0.806232279741.issue15443@psf.upfronthosting.co.za> Message-ID: <1617830818.11.0.383023437196.issue15443@roundup.psfhosted.org> Paul Ganssle added the comment: > I don't think full nanosecond support is feasible to complete in the remaining weeks This may be so, but I think the important part of that question is "what work needs to be done and what questions need to be answered?" If the answer is that we need to make 3 decisions and do the C implementation, that seems feasible to do in under a month. If the answer is that we've got 10 contentious UI issues and we probably want to go through the PEP process, I agree with your assessment of the timing. Regardless, we'll need to know what work needs to be done before we do it... > but we can try to add nanoseconds to timedelta only. The mixed datetime + timedelta ops will still truncate, but many time-related operations will be enabled. I would even argue that when nanoseconds precision is required, it is more often intervals no longer than a few days and rarely a specific point in time. To be honest, I don't find this very compelling and I think it will only confuse people. I think most people use `timedelta` to represent something you add or subtract to a `datetime`. Having the `nanoseconds` part of it truncate seems like it would be frustrating and counter-intuitive. >From the use cases in this thread: - ns-precision timestamps: https://bugs.python.org/issue15443#msg180125 - ns-precision timestamps: https://bugs.python.org/issue15443#msg223039 - Your suggestion that `datetime` should be able to support what `timespec` does: https://bugs.python.org/issue15443#msg223042 - ns-precision timestamps: https://bugs.python.org/issue15443#msg270266 So I don't think there's high enough demand for nanosecond-timedelta on its own that we need to rush it out there before datetime gets it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 17:27:16 2021 From: report at bugs.python.org (Philip Bond) Date: Wed, 07 Apr 2021 21:27:16 +0000 Subject: [issue43769] ipaddress module takes bytes input as valid ip address In-Reply-To: <1617830655.85.0.0538438287047.issue43769@roundup.psfhosted.org> Message-ID: <1617830836.31.0.546620961633.issue43769@roundup.psfhosted.org> Philip Bond added the comment: To replicate ./cidr-gen.py google.com You will see the IP variable is a Russian IP but that was a red herring, I initially thought its was a compromised module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 17:28:29 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 07 Apr 2021 21:28:29 +0000 Subject: [issue43769] ipaddress module takes bytes input as valid ip address In-Reply-To: <1617830655.85.0.0538438287047.issue43769@roundup.psfhosted.org> Message-ID: <1617830909.94.0.50030946515.issue43769@roundup.psfhosted.org> Eric V. Smith added the comment: The reproducer is: >>> ipaddress.IPv4Address(b"PING") IPv4Address('80.73.78.71') ---------- components: +Library (Lib) -Unicode nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 17:33:21 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 07 Apr 2021 21:33:21 +0000 Subject: [issue43769] ipaddress module takes bytes input as valid ip address In-Reply-To: <1617830655.85.0.0538438287047.issue43769@roundup.psfhosted.org> Message-ID: <1617831201.89.0.53798333843.issue43769@roundup.psfhosted.org> Eric V. Smith added the comment: This is documented behavior. See https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Address "The following constitutes a valid IPv4 address: ... An integer packed into a bytes object of length 4 (most significant octet first). " And the example: >>> ipaddress.IPv4Address(b'\xC0\xA8\x00\x01') IPv4Address('192.168.0.1') So I'm going to close this as not a bug. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 17:46:00 2021 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 07 Apr 2021 21:46:00 +0000 Subject: [issue15443] datetime module has no support for nanoseconds In-Reply-To: <1343158610.62.0.806232279741.issue15443@psf.upfronthosting.co.za> Message-ID: <1617831960.37.0.89940280644.issue15443@roundup.psfhosted.org> Alexander Belopolsky added the comment: Is there high enough demand for nanoseconds in datetime and time instances? How often nanosecond timestamps contain anything other than 0s or garbage in the last three digits? In my experience, all people want to do with such timestamps is to convert them to something expressed in hours, minutes and seconds rather than just a huge number of seconds and back without loosing the value. A timedelta is almost always a decent replacement for either datetime or time in those cases and sometimes it is even preferable because arithmetically it is closer to numbers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 17:48:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 21:48:22 +0000 Subject: [issue43770] Rework C types initialization Message-ID: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> New submission from STINNER Victor : Currently, PyType_Ready() is called late on many static types, which can lead to bugs. For example, PyObject_SetAttr() can fail if the type of the object is not ready yet. PyType_Read() is responsible to initialize tp_getattro and tp_setattro members of the PyTypeObject structure. We must explicitly initialize all static types before using them. Moreover, many static types initialize explicitly : tp_getattro = PyObject_GenericGetAttr and: tp_setattro = PyObject_GenericSetAttr whereas it's the default implementation. They can be omitted. I created this issue as a placeholder for multiple changes to modify how types implemented in C are initialized. ---------- components: Interpreter Core messages: 390484 nosy: vstinner priority: normal severity: normal status: open title: Rework C types initialization versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 17:55:02 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 21:55:02 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1617832502.24.0.154597963372.issue43770@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +23999 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25263 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 17:59:10 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Wed, 07 Apr 2021 21:59:10 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1617832750.2.0.16706809025.issue38820@roundup.psfhosted.org> Miro Hron?ok added the comment: Python 3.10.0a7 with OpenSSL 3.0 from https://copr.fedorainfracloud.org/coprs/saprasad/openssl-3.0/ in https://copr.fedorainfracloud.org/coprs/g/python/openssl-3.0/package/python3.10/ (full logs available there). 3 tests failed: test_imaplib test_ssl test_urllib2_localnet Many: ssl.SSLError: [SSL: KRB5_S_TKT_NYV] unexpected eof while reading (_ssl.c:2628) Also: Traceback (most recent call last): File "/builddir/build/BUILD/Python-3.10.0a7/Lib/test/test_ssl.py", line 1413, in test_load_cert_chain ctx.load_cert_chain(CERTFILE_PROTECTED, password=getpass_huge) SystemError: _PyEval_EvalFrameDefault returned a result with an exception set And: ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1122) ssl.SSLError: [SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad certificate (_ssl.c:1122) ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:1122) ---------- nosy: +hroncok versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 17:59:44 2021 From: report at bugs.python.org (mdcb) Date: Wed, 07 Apr 2021 21:59:44 +0000 Subject: [issue15443] datetime module has no support for nanoseconds In-Reply-To: <1343158610.62.0.806232279741.issue15443@psf.upfronthosting.co.za> Message-ID: <1617832784.36.0.737468487553.issue15443@roundup.psfhosted.org> mdcb added the comment: This brings me back some times. Sorry if I am not up to date, the issue as I recall from back then was there wasn't even microseconds. In telemetry, you can often have these kind time stamped measurements, it's not insignificant noise nobody cares about. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 18:00:52 2021 From: report at bugs.python.org (Barney Gale) Date: Wed, 07 Apr 2021 22:00:52 +0000 Subject: [issue43757] pathlib: move 'resolve()' logic out of path flavour In-Reply-To: <1617762768.57.0.0406169855145.issue43757@roundup.psfhosted.org> Message-ID: <1617832852.69.0.754207124581.issue43757@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +24000 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25264 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 18:06:05 2021 From: report at bugs.python.org (Philip Bond) Date: Wed, 07 Apr 2021 22:06:05 +0000 Subject: [issue43769] ipaddress module takes bytes input as valid ip address In-Reply-To: <1617830655.85.0.0538438287047.issue43769@roundup.psfhosted.org> Message-ID: <1617833165.72.0.606222052656.issue43769@roundup.psfhosted.org> Philip Bond added the comment: Thanks Eric. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 18:06:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 07 Apr 2021 22:06:34 +0000 Subject: [issue37712] Exception frames from unittest.TestCase.fail dependent on nesting In-Reply-To: <1564448224.13.0.206274970387.issue37712@roundup.psfhosted.org> Message-ID: <1617833194.05.0.195119416167.issue37712@roundup.psfhosted.org> Irit Katriel added the comment: I think this is the same as issue42247. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 18:07:07 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 07 Apr 2021 22:07:07 +0000 Subject: [issue42247] unittest hides traceback frames in chained exceptions In-Reply-To: <1604341559.53.0.224869314437.issue42247@roundup.psfhosted.org> Message-ID: <1617833227.03.0.136119077774.issue42247@roundup.psfhosted.org> Irit Katriel added the comment: I think this is the same as issue37712. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 18:12:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 22:12:45 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1617833565.64.0.44628844737.issue43770@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a518099078c8ae51860009fb801db897af9eed62 by Victor Stinner in branch 'master': bpo-43770: Sort types in _PyTypes_Init() (GH-25263) https://github.com/python/cpython/commit/a518099078c8ae51860009fb801db897af9eed62 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 18:20:09 2021 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 07 Apr 2021 22:20:09 +0000 Subject: [issue15443] datetime module has no support for nanoseconds In-Reply-To: <1343158610.62.0.806232279741.issue15443@psf.upfronthosting.co.za> Message-ID: <1617834009.81.0.649762295194.issue15443@roundup.psfhosted.org> Alexander Belopolsky added the comment: > In telemetry, a nanosecond often translates to about a foot and 5 hours gets you to Pluto. Telemetry is exactly an application where absolute timestamps rarely make any sense. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 18:28:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 22:28:51 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1617834531.27.0.630424131261.issue43770@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24001 pull_request: https://github.com/python/cpython/pull/25265 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 18:33:34 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 07 Apr 2021 22:33:34 +0000 Subject: [issue43751] await anext() returns None when default is given In-Reply-To: <1617724814.14.0.517501509303.issue43751@roundup.psfhosted.org> Message-ID: <1617834814.97.0.240695793439.issue43751@roundup.psfhosted.org> Dennis Sweeney added the comment: Okay, the PR should fix those problems now. I am still apprehensive about whether all of the corner cases are covered, so reviews are welcome, as are suggestions of more test cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 18:48:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 22:48:11 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1617835691.61.0.501278312818.issue43770@roundup.psfhosted.org> STINNER Victor added the comment: New changeset df5dc1c7a536abc2b497cb9506f8a37949838309 by Victor Stinner in branch 'master': bpo-43770: _PyTypes_Init() inits more static types (GH-25265) https://github.com/python/cpython/commit/df5dc1c7a536abc2b497cb9506f8a37949838309 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 18:50:18 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 22:50:18 +0000 Subject: [issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()` In-Reply-To: <1583643972.77.0.25342179601.issue39899@roundup.psfhosted.org> Message-ID: <1617835818.34.0.727322016034.issue39899@roundup.psfhosted.org> Steve Dower added the comment: New changeset 3f3d82b84823eb28abeedf317bbe107bbe7f6492 by Barney Gale in branch 'master': bpo-39899: os.path.expanduser(): don't guess other Windows users' home directories if the basename of the current user's home directory doesn't match their username. (GH-18841) https://github.com/python/cpython/commit/3f3d82b84823eb28abeedf317bbe107bbe7f6492 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 18:50:43 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Apr 2021 22:50:43 +0000 Subject: [issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()` In-Reply-To: <1583643972.77.0.25342179601.issue39899@roundup.psfhosted.org> Message-ID: <1617835843.78.0.277743420666.issue39899@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 18:57:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 22:57:39 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1617836259.46.0.242979947546.issue43770@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24002 pull_request: https://github.com/python/cpython/pull/25266 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 18:59:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 22:59:05 +0000 Subject: [issue31861] add aiter() and anext() functions In-Reply-To: <1508851575.6.0.213398074469.issue31861@psf.upfronthosting.co.za> Message-ID: <1617836345.54.0.373141187743.issue31861@roundup.psfhosted.org> STINNER Victor added the comment: I proposed to PR 25266 to rename PyAnextAwaitable_Type to _PyAnextAwaitable_Type, and to initialize the type at Python startup: can someone please have a look? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 19:11:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 23:11:45 +0000 Subject: [issue43682] Make static methods created by @staticmethod callable In-Reply-To: <1617201081.91.0.895015962683.issue43682@roundup.psfhosted.org> Message-ID: <1617837105.65.0.348913253877.issue43682@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24003 pull_request: https://github.com/python/cpython/pull/25268 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 19:16:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 23:16:04 +0000 Subject: [issue43682] Make static methods created by @staticmethod callable In-Reply-To: <1617201081.91.0.895015962683.issue43682@roundup.psfhosted.org> Message-ID: <1617837364.67.0.588350471795.issue43682@roundup.psfhosted.org> STINNER Victor added the comment: Serhiy Storchaka: > If make staticmethod a calllable and always wrap open, we need to change also its repr and add the __doc__ attribute (and perhaps other attributes to make it more interchangeable with the original function). You right and I like this idea! I created PR 25268 to inherit the function attributes (__name__, __doc__, etc.) in @staticmethod and @classmethod wrappers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 19:29:42 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 07 Apr 2021 23:29:42 +0000 Subject: [issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()` In-Reply-To: <1583643972.77.0.25342179601.issue39899@roundup.psfhosted.org> Message-ID: <1617838182.02.0.169681857307.issue39899@roundup.psfhosted.org> Eryk Sun added the comment: For a "~user" path, the value of userhome should always be used if target_user == current_user. If for some reason the USERPROFILE environment variable isn't defined, the fallback "%HOMEDRIVE%%HOMEPATH%" does not necessarily end in the user's name. Example rewrite: if i != 1: #~user target_user = path[1:i] if isinstance(target_user, bytes): target_user = os.fsdecode(target_user) current_user = os.environ.get('USERNAME') if target_user != current_user: # Try to guess user home directory. By default all user # profile directories are located in the same place and are # named by corresponding usernames. If userhome isn't a # normal profile directory, this guess is likely wrong, # so we bail out. if current_user != basename(userhome): return path userhome = join(dirname(userhome), target_user) ---------- nosy: +eryksun status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 19:35:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 07 Apr 2021 23:35:01 +0000 Subject: [issue15443] datetime module has no support for nanoseconds In-Reply-To: <1343158610.62.0.806232279741.issue15443@psf.upfronthosting.co.za> Message-ID: <1617838501.0.0.366998575065.issue15443@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 19:43:49 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 07 Apr 2021 23:43:49 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1617839029.37.0.392511732721.issue14243@roundup.psfhosted.org> Ethan Furman added the comment: I think the best solution, albeit slightly backwards incompatible, is to change NamedTemporaryFile such that if (and only if) it is being used as a context manager, the underlying file is not closed until the context manager ends. This should be the default behavior with no new flags. Since context managers are used for resource acquisition (`__enter__`) and cleanup (`__exit__`), having the resource disappear in the middle of the `with` block is counter-intuitive. Given that closing a file in the middle of its CM seems like a very odd thing to do (one could just leave the CM and the file would close), do we need a deprecation period or can we just make the change? ---------- nosy: +ethan.furman title: tempfile.NamedTemporaryFile not particularly useful on Windows -> tempfile.NamedTemporaryFile not particularly useful on Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 19:57:35 2021 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 07 Apr 2021 23:57:35 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1617839855.55.0.433638863169.issue38820@roundup.psfhosted.org> Change by Charalampos Stratakis : ---------- nosy: +cstratak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 20:14:13 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 08 Apr 2021 00:14:13 +0000 Subject: [issue43754] Eliminate bindings for partial pattern matches In-Reply-To: <1617739231.38.0.2365910918.issue43754@roundup.psfhosted.org> Message-ID: <1617840853.46.0.105625017482.issue43754@roundup.psfhosted.org> Brandt Bucher added the comment: Guido informed me that Mark is currently maintaining a PEP 653 implementation branch. I checked it out today, and it looks like it has *lots* of conflicts with this one. For the time being, I'm going to experiment with other ways of accomplishing this that don't involve rewriting most of the pattern compiler. That way we can minimize potential merge conflicts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 20:42:45 2021 From: report at bugs.python.org (Barney Gale) Date: Thu, 08 Apr 2021 00:42:45 +0000 Subject: [issue27002] Support different modes in posixpath.realpath() In-Reply-To: <1462992884.19.0.13993979036.issue27002@psf.upfronthosting.co.za> Message-ID: <1617842565.02.0.836539888967.issue27002@roundup.psfhosted.org> Barney Gale added the comment: Just stumbled upon this issue after submitting a PR: https://github.com/python/cpython/pull/25264 In my PR, `strict=False` is like `--canonicalize-missing`, and `strict=True` is like `--canonicalize-existing`. Looks like our patches are along similar lines. I've missed a trick by not calling `stat()` to trigger the ELOOP error. ---------- nosy: +barneygale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 20:45:51 2021 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Thu, 08 Apr 2021 00:45:51 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1617842751.01.0.628764687286.issue38820@roundup.psfhosted.org> Change by Chih-Hsuan Yen : ---------- nosy: -yan12125 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 21:24:25 2021 From: report at bugs.python.org (Barney Gale) Date: Thu, 08 Apr 2021 01:24:25 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za> Message-ID: <1617845065.98.0.121554294462.issue24132@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +24005 pull_request: https://github.com/python/cpython/pull/25271 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 21:24:25 2021 From: report at bugs.python.org (Barney Gale) Date: Thu, 08 Apr 2021 01:24:25 +0000 Subject: [issue42998] pathlib.Path: add `username` argument to `home()` In-Reply-To: <1611287835.84.0.363729514225.issue42998@roundup.psfhosted.org> Message-ID: <1617845065.91.0.28794569219.issue42998@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +24004 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25271 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 21:34:40 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 08 Apr 2021 01:34:40 +0000 Subject: [issue36865] FileInput does not allow 'rt' mode, but all its existing delegates do In-Reply-To: <1557408143.65.0.0603138385641.issue36865@roundup.psfhosted.org> Message-ID: <1617845680.96.0.0167751711547.issue36865@roundup.psfhosted.org> Inada Naoki added the comment: I don't think we should support "text for regular file but binary for compressed file" mode in FileInput. So no need to add 't'. We should just fix #5758. ---------- nosy: +methane resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> fileinput.hook_compressed returning bytes from gz file _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 22:12:01 2021 From: report at bugs.python.org (Barney Gale) Date: Thu, 08 Apr 2021 02:12:01 +0000 Subject: [issue930024] os.path.realpath can't handle symlink loops Message-ID: <1617847921.02.0.779405720757.issue930024@roundup.psfhosted.org> Change by Barney Gale : ---------- nosy: +barneygale nosy_count: 3.0 -> 4.0 pull_requests: +24006 pull_request: https://github.com/python/cpython/pull/25264 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 23:31:16 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 08 Apr 2021 03:31:16 +0000 Subject: [issue43712] PEP 597: fileinput uses locale encoding In-Reply-To: <1617450057.65.0.948181942157.issue43712@roundup.psfhosted.org> Message-ID: <1617852676.89.0.978313786318.issue43712@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +24007 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25272 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 7 23:31:17 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 08 Apr 2021 03:31:17 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1617852677.01.0.973431623007.issue5758@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +methane nosy_count: 5.0 -> 6.0 pull_requests: +24008 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25272 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 02:12:00 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 08 Apr 2021 06:12:00 +0000 Subject: [issue43340] json.load() can raise UnicodeDecodeError, but this is not documented In-Reply-To: <1614450261.52.0.147425024304.issue43340@roundup.psfhosted.org> Message-ID: <1617862320.02.0.547181213422.issue43340@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: rhettinger -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 02:13:24 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 08 Apr 2021 06:13:24 +0000 Subject: [issue43731] PEP 597: logging.fileConfig() uses locale encoding. In-Reply-To: <1617596968.06.0.267322224871.issue43731@roundup.psfhosted.org> Message-ID: <1617862404.06.0.554077387563.issue43731@roundup.psfhosted.org> Inada Naoki added the comment: s/basicConfig/fileConfig/ basicConfig() is fixed by fb7869. ---------- title: PEP 597: logging.basicConfig() uses locale encoding. -> PEP 597: logging.fileConfig() uses locale encoding. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 02:20:02 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 08 Apr 2021 06:20:02 +0000 Subject: [issue43731] PEP 597: logging.fileConfig() uses locale encoding. In-Reply-To: <1617596968.06.0.267322224871.issue43731@roundup.psfhosted.org> Message-ID: <1617862802.95.0.912291104372.issue43731@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +24009 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25273 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 03:09:57 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 08 Apr 2021 07:09:57 +0000 Subject: [issue42998] pathlib.Path: add `username` argument to `home()` In-Reply-To: <1611287835.84.0.363729514225.issue42998@roundup.psfhosted.org> Message-ID: <1617865797.29.0.0400337593324.issue42998@roundup.psfhosted.org> Serhiy Storchaka added the comment: os.path.expanduser() has flaws. 1. It can return an argument unchanged if failed to determine the home directory. 2. On Unix it does not work for users not found in the local password database. 3. On Windows it only guess the home directory for other users. It does not work if you have home directory at nonstandard location (i.e. on other disk). Until we fix these flaws it is better to not add flawed by design feature in pathlib. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 03:15:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 08 Apr 2021 07:15:22 +0000 Subject: [issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()` In-Reply-To: <1583643972.77.0.25342179601.issue39899@roundup.psfhosted.org> Message-ID: <1617866122.63.0.692657957848.issue39899@roundup.psfhosted.org> Serhiy Storchaka added the comment: AFAIK you can set arbitrary path as user home directory. So home directories of different users can even not be on the same disk, and the last component of the path can be different from the user name. os.path.expanduser() has many flaws, and it just "guess" the home directory for other users. It is difficult to fix os.path.expanduser() due to backward compatibility, but we should do better in pathlib from start. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 03:22:20 2021 From: report at bugs.python.org (=?utf-8?b?4Lib4Lie4LiZ4Lie4Lix4LiK4Lij4LmMIOC4muC4o+C4o+C4nuC4iOC4sQ==?= =?utf-8?b?4LiZ4LiX4Lij4LmM?=) Date: Thu, 08 Apr 2021 07:22:20 +0000 Subject: [issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10 In-Reply-To: <1582025189.05.0.731615044433.issue39674@roundup.psfhosted.org> Message-ID: <1617866540.75.0.220927581556.issue39674@roundup.psfhosted.org> Change by ???????? ?????????? : ---------- components: +Unicode -Library (Lib) nosy: +ezio.melotti versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 03:25:47 2021 From: report at bugs.python.org (=?utf-8?q?Max_B=C3=A9langer?=) Date: Thu, 08 Apr 2021 07:25:47 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1617866747.27.0.18073215374.issue41100@roundup.psfhosted.org> Change by Max B?langer : ---------- nosy: +maxbelanger nosy_count: 18.0 -> 19.0 pull_requests: +24010 pull_request: https://github.com/python/cpython/pull/25274 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 03:25:47 2021 From: report at bugs.python.org (=?utf-8?q?Max_B=C3=A9langer?=) Date: Thu, 08 Apr 2021 07:25:47 +0000 Subject: [issue42688] ctypes memory error on Apple Silicon with external libffi In-Reply-To: <1608443574.61.0.0166938419217.issue42688@roundup.psfhosted.org> Message-ID: <1617866747.69.0.669914441906.issue42688@roundup.psfhosted.org> Change by Max B?langer : ---------- nosy: +maxbelanger nosy_count: 4.0 -> 5.0 pull_requests: +24011 pull_request: https://github.com/python/cpython/pull/25274 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 03:35:09 2021 From: report at bugs.python.org (Maxime Belanger) Date: Thu, 08 Apr 2021 07:35:09 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1617867309.69.0.389575491399.issue41100@roundup.psfhosted.org> Maxime Belanger added the comment: I had some time today, so I took a crack at merging this into Python 3.8. I've filed GH-25274 with my proposal. To summarize, I'm suggesting back porting all changes from bpo-41100 (as well as the subsequent bpo-42688) but without the weak-linking changes to `posixmodule` and co, the installer changes and the `universal2` variant. This means we don't support `arm64` officially, but someone can build for it from source if they'd like. This should unblock Homebrew (which currently manually patches based on some obsolete PRs) as well as folks who build from source and have a particular need (as we would for example at Dropbox). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 03:53:41 2021 From: report at bugs.python.org (Florian Bruhin) Date: Thu, 08 Apr 2021 07:53:41 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1617868421.38.0.786397108953.issue40066@roundup.psfhosted.org> Change by Florian Bruhin : ---------- nosy: +The Compiler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 03:58:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 07:58:43 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1617868723.95.0.407656963228.issue43770@roundup.psfhosted.org> STINNER Victor added the comment: New changeset b98eba5bc2ffbe7a0ed49d540ebc4f756ae61985 by Victor Stinner in branch 'master': bpo-43770: _PyTypes_Init() inits _PyAnextAwaitable_Type (GH-25266) https://github.com/python/cpython/commit/b98eba5bc2ffbe7a0ed49d540ebc4f756ae61985 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 04:01:40 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 08 Apr 2021 08:01:40 +0000 Subject: [issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()` In-Reply-To: <1583643972.77.0.25342179601.issue39899@roundup.psfhosted.org> Message-ID: <1617868900.31.0.288862209116.issue39899@roundup.psfhosted.org> Eryk Sun added the comment: > os.path.expanduser() has many flaws, and it just "guess" the > home directory for other users. I'm fine with not guessing another user's profile directory (or home directory) in some cases, or even always. But the code that got committed bails out even if the target user is the same as the current user, according to the USERNAME environment variable. It shouldn't do that. --- If we want something better than guessing, it's not very hard to get the real profile directory or home directory for another user on the current system. The profile directory is configured as the "ProfileImagePath" value in a subkey of "HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList". The subkey name is the user SID in string form. The SID can be looked up with LookupAccountNameW(NULL, target_user, &sid, ...) and converted to string form with ConvertSidToStringSidW(&sid, string_sid). If there's no local profile directory, try looking up the user's configured home_dir and/or home_dir_drive (a mapped drive for a remote home directory) via NetUserGetInfo(NULL, target_user, 4, &info). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 04:13:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 08:13:38 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1617869618.24.0.131942322279.issue43770@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24012 pull_request: https://github.com/python/cpython/pull/25275 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 04:21:42 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 08 Apr 2021 08:21:42 +0000 Subject: [issue43087] ctypes documentation error In-Reply-To: <1612120039.68.0.861661788705.issue43087@roundup.psfhosted.org> Message-ID: <1617870102.46.0.555592450573.issue43087@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 5490b49fa6646c9f48869955c12cf6af9fc3f2a4 by Miss Islington (bot) in branch '3.9': [3.9] bpo-43087: Fix error in ctypes "Incomplete Types" doc (GH-24404) https://github.com/python/cpython/commit/5490b49fa6646c9f48869955c12cf6af9fc3f2a4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 04:22:05 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 08 Apr 2021 08:22:05 +0000 Subject: [issue43087] ctypes documentation error In-Reply-To: <1612120039.68.0.861661788705.issue43087@roundup.psfhosted.org> Message-ID: <1617870125.91.0.235505588372.issue43087@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 754dc353565eeb4a43a912417cc5b66959458f1b by Miss Islington (bot) in branch '3.8': [3.8] bpo-43087: Fix error in ctypes "Incomplete Types" doc (GH-24404) https://github.com/python/cpython/commit/754dc353565eeb4a43a912417cc5b66959458f1b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 04:22:29 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 08 Apr 2021 08:22:29 +0000 Subject: [issue43087] ctypes documentation error In-Reply-To: <1612120039.68.0.861661788705.issue43087@roundup.psfhosted.org> Message-ID: <1617870149.78.0.590269148846.issue43087@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 04:29:02 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 08:29:02 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1617870542.89.0.74089968947.issue43770@roundup.psfhosted.org> STINNER Victor added the comment: I tried to put assertions in PyObject_GetAttr(), _PyObject_LookupAttr(), _PyObject_GetMethod() and PyObject_SetAttr() to ensure that the type is ready. It breaks many tests, examples: test_buffer test_pickle test_picklebuffer test_pickletools test_structmembers For example, Modules/_testbuffer.c does not initialize its ndarray type. Example of crash: ----------------- Objects/object.c:892: PyObject_GetAttr: Assertion "tp->tp_flags & (1UL << 12)" failed Enable tracemalloc to get the memory block allocation traceback object address : 0x7f4d89119a00 object refcount : 4 object type : 0x8768c0 object type name: type object repr : Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed Python runtime state: initialized Current thread 0x00007f4d96eba740 (most recent call first): File "/home/vstinner/python/master/Lib/test/test_picklebuffer.py", line 80 in test_ndarray_2d (...) Extension modules: _testcapi, _testbuffer (total: 2) ----------------- Another example of crash: ----------------- Objects/object.c:892: PyObject_GetAttr: Assertion "tp->tp_flags & (1UL << 12)" failed Enable tracemalloc to get the memory block allocation traceback object address : 0x7f174ec9aa00 object refcount : 3 object type : 0x8768c0 object type name: type object repr : Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed Python runtime state: initialized Current thread 0x00007f175ca42740 (most recent call first): File "/home/vstinner/python/master/Lib/test/pickletester.py", line 304 in __reduce_ex__ (...) Extension modules: _testcapi, _testbuffer, numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg.lapack_lite, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator (total: 16) ----------------- The C API tries to make the type ready automatically. For example, PyObject_Hash() calls PyType_Ready() if needed and then retry tp_hash: Py_hash_t PyObject_Hash(PyObject *v) { PyTypeObject *tp = Py_TYPE(v); if (tp->tp_hash != NULL) return (*tp->tp_hash)(v); /* To keep to the general practice that inheriting * solely from object in C code should work without * an explicit call to PyType_Ready, we implicitly call * PyType_Ready here and then check the tp_hash slot again */ if (tp->tp_dict == NULL) { if (PyType_Ready(tp) < 0) return -1; if (tp->tp_hash != NULL) return (*tp->tp_hash)(v); } /* Otherwise, the object can't be hashed */ return PyObject_HashNotImplemented(v); } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 04:35:17 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Thu, 08 Apr 2021 08:35:17 +0000 Subject: [issue42134] Raise ImportWarning when falling back to find_module() In-Reply-To: <1603494610.04.0.950789467246.issue42134@roundup.psfhosted.org> Message-ID: <1617870917.7.0.991844792396.issue42134@roundup.psfhosted.org> Miro Hron?ok added the comment: Brett, would you accept a PR that changes the changelog entry to contain the ".find_spec() not found; falling back to find_module()" message, for better search-ability? I needed to use grep + git blame to be able to find out what's going on. Also, could you please explain how to migrate to find_spec() in https://docs.python.org/3.10/whatsnew/3.10.html#porting-to-python-3-10 ? I'd do that, but I don't know yet what is the proper way. ---------- nosy: +hroncok, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 04:55:02 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 08 Apr 2021 08:55:02 +0000 Subject: [issue35889] sqlite3.Row doesn't have useful repr In-Reply-To: <1549112536.04.0.744689521798.issue35889@roundup.psfhosted.org> Message-ID: <1617872102.32.0.86107782914.issue35889@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: AFAICS, this is fixed by the attached one-liner, based on Serhiy's suggestion (based on Raymond's suggestion). $ python3.10 test.py $ ./python.exe test.py # patch applied $ cat test.py import sqlite3 cx = sqlite3.connect(":memory:") cx.row_factory = sqlite3.Row query = """ select 1 as number, 'two' as string, x'1f' as blob """ for row in cx.execute(query): print(repr(row)) If Berker & Serhiy approves, I'll create a PR for it. ---------- nosy: +erlendaasland Added file: https://bugs.python.org/file49941/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 04:55:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 08:55:07 +0000 Subject: [issue42134] Raise ImportWarning when falling back to find_module() In-Reply-To: <1603494610.04.0.950789467246.issue42134@roundup.psfhosted.org> Message-ID: <1617872107.03.0.115073451265.issue42134@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-43540 "importlib: Document how to replace load_module() in What's New in Python 3.10". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 04:56:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 08:56:50 +0000 Subject: [issue43540] importlib: Document how to replace load_module() in What's New in Python 3.10 In-Reply-To: <1616062773.63.0.458155955758.issue43540@roundup.psfhosted.org> Message-ID: <1617872210.44.0.295045619329.issue43540@roundup.psfhosted.org> STINNER Victor added the comment: find_module() and find_loader() are now also deprecated (bpo-42134). Currently, What's New in Python 3.10 says: "(superseded by exec_module())". It would be great to have a documentation like the good subprocess "replacement" documentation: https://docs.python.org/dev/library/subprocess.html#subprocess-replacements ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 05:05:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 09:05:50 +0000 Subject: [issue43540] importlib: Document how to replace load_module() in What's New in Python 3.10 In-Reply-To: <1616062773.63.0.458155955758.issue43540@roundup.psfhosted.org> Message-ID: <1617872750.22.0.193265740511.issue43540@roundup.psfhosted.org> STINNER Victor added the comment: Concrete issue: setuptools defines a VendorImporter class with find_module() method, but no find_spec() method. How can it be ported to Python 3.10? https://github.com/pypa/setuptools/issues/2632 ---------- nosy: +hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 05:07:26 2021 From: report at bugs.python.org (Bill Collins) Date: Thu, 08 Apr 2021 09:07:26 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617872846.44.0.694950815183.issue43745@roundup.psfhosted.org> Bill Collins added the comment: The embeddable dists for 3.9.4 have updated, but the 3.8.9 packages are still showing the builds from April 2nd. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 05:33:10 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 08 Apr 2021 09:33:10 +0000 Subject: [issue35889] sqlite3.Row doesn't have useful repr In-Reply-To: <1549112536.04.0.744689521798.issue35889@roundup.psfhosted.org> Message-ID: <1617874390.42.0.615587638935.issue35889@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Even better, let's keep Row as it is and just add this as an example in the docs. If a verbose repr is needed, it's easy to override __repr__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 05:33:51 2021 From: report at bugs.python.org (Andrey Moiseev) Date: Thu, 08 Apr 2021 09:33:51 +0000 Subject: [issue43771] [Windows] stdin line buffer size Message-ID: <1617874431.78.0.824806811531.issue43771@roundup.psfhosted.org> New submission from Andrey Moiseev : sys.stdin.readline() in Windows console only allows 512 characters on input per line. So large pastes are truncated at 512 chars, which is a bit inconvenient for prototyping. The buffer size seems to be determined by BUFSIZ compile time constant: https://github.com/python/cpython/blob/63298930fb531ba2bb4f23bc3b915dbf1e17e9e1/Modules/_io/winconsoleio.c#L30-L31 In C, I am able to set a larger buffer at runtime with setvbuf() call: setvbuf(stdin, NULL, 0, 2024); But I can't seem to make it work through ctypes.cdll.msvcrt.setvbuf ---------- components: Windows messages: 390518 nosy: Andrey Moiseev, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: [Windows] stdin line buffer size type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 05:37:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 09:37:17 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1617874637.53.0.49294024604.issue43770@roundup.psfhosted.org> STINNER Victor added the comment: PR 25275: this is a subtle difference if PyTypeObject.tp_setattro is set statically to PyObject_GenericSetAttr() or if it's inherited by PyType_Ready(). Reference (master):: * BaseException.__dict__['__setattr__'] = * BaseException.__setattr__ = With the PR: * no '__setattr___' in BaseException.__dict__ * BaseException.__setattr__ = Because of that, doctest.DocTestFinder().find(builtins) returns less items, and so test_doctest fails. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 05:46:46 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 08 Apr 2021 09:46:46 +0000 Subject: [issue43771] [Windows] stdin line buffer size In-Reply-To: <1617874431.78.0.824806811531.issue43771@roundup.psfhosted.org> Message-ID: <1617875206.62.0.931671739762.issue43771@roundup.psfhosted.org> Eryk Sun added the comment: The limit of 512 characters is not for sys.stdin in general. It's for io._WindowsConsoleIO, which gets used as the raw file for non-redirected sys.stdin -- and opening "CON" and "CONIN$" -- if legacy mode isn't enabled. See bpo-41849. ---------- nosy: +eryksun resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Support reading long lines with io._WindowsConsoleIO _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 06:00:09 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 08 Apr 2021 10:00:09 +0000 Subject: [issue35889] sqlite3.Row doesn't have useful repr In-Reply-To: <1549112536.04.0.744689521798.issue35889@roundup.psfhosted.org> Message-ID: <1617876009.42.0.539452635161.issue35889@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Suggesting to either close this or add an example to the docs. Up to Berker / Serhiy. ---------- Added file: https://bugs.python.org/file49942/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 06:22:59 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 08 Apr 2021 10:22:59 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be. In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1617877379.89.0.293250552637.issue43760@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 28d28e053db6b69d91c2dfd579207cd8ccbc39e7 by Mark Shannon in branch 'master': bpo-43760: Streamline dispatch sequence for machines without computed gotos. (GH-25244) https://github.com/python/cpython/commit/28d28e053db6b69d91c2dfd579207cd8ccbc39e7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 07:08:37 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 08 Apr 2021 11:08:37 +0000 Subject: [issue43661] api-ms-win-core-path-l1-1.0.dll, redux of 40740 (which has since been closed) In-Reply-To: <1617044884.9.0.569070921495.issue43661@roundup.psfhosted.org> Message-ID: <1617880117.77.0.240530088748.issue43661@roundup.psfhosted.org> Eric V. Smith added the comment: Closing as a duplicate. Any discussion should be on the original issue. ---------- nosy: +eric.smith resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Missing api-ms-win-core-path-l1-1.0.dll for python-3.9.0b1-amd64.exe Under Win7 type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 07:09:29 2021 From: report at bugs.python.org (Larry Hastings) Date: Thu, 08 Apr 2021 11:09:29 +0000 Subject: [issue43772] Minor repr error in typing.TypeVar.__ror__() Message-ID: <1617880169.66.0.0347480943951.issue43772@roundup.psfhosted.org> New submission from Larry Hastings : The implementation of the | operator for TypeVar objects is as follows: def __or__(self, right): return Union[self, right] def __ror__(self, right): return Union[self, right] I think the implementation of __ror__ is ever-so-slightly inaccurate. Shouldn't it be this? def __ror__(self, left): return Union[left, self] I assume this wouldn't affect runtime behavior, as unions are sets and are presumably unordered. The only observable difference should be in the repr() (and only then if both are non-None), as this reverses the elements. The repr for Union does preserve the order of the elements it contains, so it's visible to the user there. ---------- components: Library (Lib) messages: 390524 nosy: larry priority: low severity: normal stage: test needed status: open title: Minor repr error in typing.TypeVar.__ror__() type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 07:14:23 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 08 Apr 2021 11:14:23 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be. In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1617880464.0.0.1290073817.issue43760@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +24013 pull_request: https://github.com/python/cpython/pull/25276 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 07:34:47 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 11:34:47 +0000 Subject: [issue43682] Make static methods created by @staticmethod callable In-Reply-To: <1617201081.91.0.895015962683.issue43682@roundup.psfhosted.org> Message-ID: <1617881687.95.0.818821570812.issue43682@roundup.psfhosted.org> STINNER Victor added the comment: There is a nice side effect of PR 25268 + PR 25117: pydoc provides better self documentation for the following code: class X: @staticmethod def sm(x, y): '''A static method''' ... pydoc on X.sm: --- sm(x, y) A static method --- instead of: --- --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 07:37:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 11:37:11 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617881831.85.0.869863064703.issue43753@roundup.psfhosted.org> STINNER Victor added the comment: Mark: > `is` is not well defined except for a small set of values, so the docs for `Py_Is` would have to so vague as to be worthless, IMO. I don't propose to change the "is" operator semantic: Py_Is(x, y) is C would behave *exaclty* as "x is y" in Python. Check my implementation: the IS_OP bytecode uses directly Py_Is(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 07:43:30 2021 From: report at bugs.python.org (Florian Bruhin) Date: Thu, 08 Apr 2021 11:43:30 +0000 Subject: [issue43540] importlib: Document how to replace load_module() in What's New in Python 3.10 In-Reply-To: <1616062773.63.0.458155955758.issue43540@roundup.psfhosted.org> Message-ID: <1617882210.7.0.453994931799.issue43540@roundup.psfhosted.org> Change by Florian Bruhin : ---------- nosy: +The Compiler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 07:46:14 2021 From: report at bugs.python.org (Barney Gale) Date: Thu, 08 Apr 2021 11:46:14 +0000 Subject: [issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()` In-Reply-To: <1583643972.77.0.25342179601.issue39899@roundup.psfhosted.org> Message-ID: <1617882374.55.0.148506430381.issue39899@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +24014 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/25277 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 07:51:02 2021 From: report at bugs.python.org (Anthony Flury) Date: Thu, 08 Apr 2021 11:51:02 +0000 Subject: [issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative In-Reply-To: <1617659396.43.0.525762996462.issue43737@roundup.psfhosted.org> Message-ID: <1617882662.22.0.833453783484.issue43737@roundup.psfhosted.org> Change by Anthony Flury : ---------- pull_requests: +24015 pull_request: https://github.com/python/cpython/pull/25279 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 07:51:40 2021 From: report at bugs.python.org (Barney Gale) Date: Thu, 08 Apr 2021 11:51:40 +0000 Subject: [issue42998] pathlib.Path: add `username` argument to `home()` In-Reply-To: <1611287835.84.0.363729514225.issue42998@roundup.psfhosted.org> Message-ID: <1617882700.56.0.47751393741.issue42998@roundup.psfhosted.org> Barney Gale added the comment: Thanks for the feedback. 1. We can check the return value, like we do in `Path.expanduser()` 2. Seems like expected behaviour? 3. Worth fixing in `ntpath.expanduser()` I think. See Eryk Sun's comment here: https://bugs.python.org/issue39899#msg390507 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 07:53:21 2021 From: report at bugs.python.org (Barney Gale) Date: Thu, 08 Apr 2021 11:53:21 +0000 Subject: [issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()` In-Reply-To: <1583643972.77.0.25342179601.issue39899@roundup.psfhosted.org> Message-ID: <1617882801.57.0.0682286709241.issue39899@roundup.psfhosted.org> Barney Gale added the comment: Good spot Eryk - I've put in another PR to address it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 09:31:56 2021 From: report at bugs.python.org (Carlton Gibson) Date: Thu, 08 Apr 2021 13:31:56 +0000 Subject: [issue43773] macOS official installer builds not respecting DYLD_LIBRARY_PATH environment variable. Message-ID: <1617888716.6.0.448516461166.issue43773@roundup.psfhosted.org> New submission from Carlton Gibson : Hi. On MacOS 11.3 "Big Sur", with the latest 3.9.4 installed with the official installer downloaded from python.org, the DYLD_LIBRARY_PATH environment variable is not being respected. This looks very similar to Issue40198 https://bugs.python.org/issue40198 To begin everything looks correct as per 40198: ~ $ python3 --version Python 3.9.4 ~ $ which python3 /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 ~ $ codesign --display --entitlements=:- /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 Executable=/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 com.apple.security.cs.allow-dyld-environment-variables com.apple.security.cs.disable-library-validation com.apple.security.cs.disable-executable-page-protection com.apple.security.automation.apple-events The active python is that from the official installer, and it looks to have the correct entitlements, as per the resolution to 40198. However, it's not working in practice. I create a script test: ~ $ cat ~/bin/sqlite_config.py import os import sqlite3 print("DYLD_LIBRARY_PATH:" ) print(os.getenv('DYLD_LIBRARY_PATH')) print("SQLite Version:") print(sqlite3.sqlite_version) Together with a compiled SQLite version: ~ $ ls /Users/carlton/lib/sqlite/3.35.4 libsqlite3.dylib Trying to use this, the dylib is not picked up: ~ $ DYLD_LIBRARY_PATH="/Users/carlton/lib/sqlite/3.35.4" python3 ~/bin/sqlite_config.py DYLD_LIBRARY_PATH: /Users/carlton/lib/sqlite/3.35.4 SQLite Version: 3.34.0 Contrast the same when run with a pyenv installed python: ~ $ pyenv which python3.8 /Users/carlton/.pyenv/versions/3.8.3/bin/python3.8 ~ $ DYLD_LIBRARY_PATH="/Users/carlton/lib/sqlite/3.35.4" /Users/carlton/.pyenv/versions/3.8.3/bin/python3.8 ~/bin/sqlite_config.py DYLD_LIBRARY_PATH: /Users/carlton/lib/sqlite/3.35.4 SQLite Version: 3.35.4 The expected result, in both cases, is that the last lines should read: SQLite Version: 3.35.4 I don't know if this is the result of a tightening in macOS' SIP in Big Sur (or something else entirely...) ??I thought to test it by installing the official build in a different location (so not in the SIP protected `/Library/` space but somewhere in `~` but the installer doesn't look like it allows that (no doubt for good reasons). Next step for me with be building from source to see if I can dig deeper, but I thought I'd report it, as it does look like a change in behaviour from the *success* reported in 40198. Thanks very much! ---------- components: macOS messages: 390529 nosy: carltongibson, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: macOS official installer builds not respecting DYLD_LIBRARY_PATH environment variable. type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 10:18:05 2021 From: report at bugs.python.org (Mariatta) Date: Thu, 08 Apr 2021 14:18:05 +0000 Subject: [issue43715] curses inch() and scrbkgd() documentation ommissions In-Reply-To: <1617477723.19.0.381446769409.issue43715@roundup.psfhosted.org> Message-ID: <1617891485.67.0.570318087155.issue43715@roundup.psfhosted.org> Mariatta added the comment: Thanks for the patch, but I find it difficult to read in plain text. Can you create a pull request with the your suggested changes? ---------- nosy: +Mariatta _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 10:33:12 2021 From: report at bugs.python.org (Anthony Flury) Date: Thu, 08 Apr 2021 14:33:12 +0000 Subject: [issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative In-Reply-To: <1617659396.43.0.525762996462.issue43737@roundup.psfhosted.org> Message-ID: <1617892392.1.0.567693874144.issue43737@roundup.psfhosted.org> Change by Anthony Flury : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 10:33:29 2021 From: report at bugs.python.org (Anthony Flury) Date: Thu, 08 Apr 2021 14:33:29 +0000 Subject: [issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative In-Reply-To: <1617659396.43.0.525762996462.issue43737@roundup.psfhosted.org> Message-ID: <1617892409.08.0.225468661266.issue43737@roundup.psfhosted.org> Change by Anthony Flury : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 10:41:11 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 08 Apr 2021 14:41:11 +0000 Subject: [issue43772] Minor repr error in typing.TypeVar.__ror__() In-Reply-To: <1617880169.66.0.0347480943951.issue43772@roundup.psfhosted.org> Message-ID: <1617892871.75.0.87501107254.issue43772@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +gvanrossum, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 11:08:59 2021 From: report at bugs.python.org (conchylicultor) Date: Thu, 08 Apr 2021 15:08:59 +0000 Subject: [issue43746] Weird typing annotation closure behavior In-Reply-To: <1617705463.18.0.247710543326.issue43746@roundup.psfhosted.org> Message-ID: <1617894539.49.0.0148829337222.issue43746@roundup.psfhosted.org> conchylicultor added the comment: > Do you have an actual use case for self-referential annotations? I'm not sure I understand the question. My use case is the following: ``` from ... import losses class A: losses: losses.Losses = losses.Losses() ``` Currently this is failing be cause this get resolved as: ``` class A: name: .Losses().Losses = .Losses() ``` Instead of what I want/expected: ``` class A: name: .Losses = .Losses() ``` I would expect that both "losses.Losses" on the left and right of the `=` refer to the outer module (`name: .Losses`), while currently it is resolved as `name: name.Losses` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 11:17:46 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 08 Apr 2021 15:17:46 +0000 Subject: [issue43747] Can't create new interpreter in multi thread In-Reply-To: <1617711734.82.0.851064276146.issue43747@roundup.psfhosted.org> Message-ID: <1617895066.12.0.814171468094.issue43747@roundup.psfhosted.org> Eric V. Smith added the comment: You might have more luck asking on the capi-sig mailing list: https://mail.python.org/mailman3/lists/capi-sig.python.org/ I'm going to close this, because it looks like a usage question and not a bug. If it turns out to be a bug, please re-open this issue. ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 11:24:16 2021 From: report at bugs.python.org (Larry Hastings) Date: Thu, 08 Apr 2021 15:24:16 +0000 Subject: [issue43746] Weird typing annotation closure behavior In-Reply-To: <1617705463.18.0.247710543326.issue43746@roundup.psfhosted.org> Message-ID: <1617895456.3.0.606638134327.issue43746@roundup.psfhosted.org> Larry Hastings added the comment: By "use case", I mean, what problem are you solving in a useful program by doing this? So far it seems like a pointless exercise in seeing what funny behavior you can try with annotations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 11:47:11 2021 From: report at bugs.python.org (conchylicultor) Date: Thu, 08 Apr 2021 15:47:11 +0000 Subject: [issue43746] Weird typing annotation closure behavior In-Reply-To: <1617705463.18.0.247710543326.issue43746@roundup.psfhosted.org> Message-ID: <1617896831.36.0.195884135537.issue43746@roundup.psfhosted.org> conchylicultor added the comment: The above example is a real world example I have currently have. Basically I have some dataclass based configuration like: in losses.py: ``` class LossesParams: ... ``` in dataset.py: ``` class DatasetParams: ... ``` in config.py: ``` @dataclasses.dataclass class Params: losses: losses.LossesParams = dataclasses.field() dataset: dataset.DatasetParams = dataclasses.field() ``` I want to use params as: ``` param = Params() param.datasets.batch_size = 123 ``` However the above code fail at `dataset: dataset.DatasetParams = dataclasses.field()` due to the closure issue. The example is simplified but this is a very concrete problem I encountered. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 11:50:33 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 08 Apr 2021 15:50:33 +0000 Subject: [issue42998] pathlib.Path: add `username` argument to `home()` In-Reply-To: <1611287835.84.0.363729514225.issue42998@roundup.psfhosted.org> Message-ID: <1617897033.63.0.0234053907199.issue42998@roundup.psfhosted.org> Eryk Sun added the comment: > 3. Worth fixing in `ntpath.expanduser()` To expand on the suggestion in msg390507, here's a demo that implements getting the profile path of a local user account, with support for the special profile directories "Default", "Public", and "ProgramData" (i.e. ALLUSERSPROFILE). ERROR_NONE_MAPPED = 1332 def get_profile_path(name): if not isinstance(name, str): raise TypeError(f'name must be str, not {type(name).__name__}') profile_list = r'Software\Microsoft\Windows NT\CurrentVersion\ProfileList' if name.lower() in ('default', 'public', 'programdata'): subkey = profile_list value = name else: try: sid = lookup_account_name(name)[0] except OSError as e: if e.winerror != ERROR_NONE_MAPPED: raise raise KeyError(f'name not found: {name}') subkey = f'{profile_list}\\{sid}' value = 'ProfileImagePath' try: with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, subkey) as hkey: path, dtype = winreg.QueryValueEx(hkey, value) except FileNotFoundError: raise KeyError(f'name not found: {name}') if dtype == winreg.REG_SZ: return path if dtype == winreg.REG_EXPAND_SZ: return winreg.ExpandEnvironmentStrings(path) raise TypeError('profile path value must be a string type (1 or 2), ' f'not {dtype}') For example: >>> print(get_profile_path('administrator')) C:\Users\Administrator >>> print(get_profile_path('default')) C:\Users\Default >>> print(get_profile_path('public')) C:\Users\Public >>> print(get_profile_path('programdata')) C:\ProgramData >>> print(get_profile_path('system')) C:\Windows\system32\config\systemprofile >>> print(get_profile_path('localservice')) C:\Windows\ServiceProfiles\LocalService >>> print(get_profile_path('networkservice')) C:\Windows\ServiceProfiles\NetworkService For lookup_account_name(), _winapi.LookupAccountName(system_name, account_name) has to be implemented. It should convert the SID result to string form via ConvertSidToStringSidW() and return the tuple (sid_string, domain_name, account_type). Here's a ctypes prototype implementation of lookup_account_name(): import ctypes lsalookup = ctypes.WinDLL( 'api-ms-win-security-lsalookup-l2-1-0', use_last_error=True) sddl = ctypes.WinDLL('api-ms-win-security-sddl-l1-1-0', use_last_error=True) heap = ctypes.WinDLL('api-ms-win-core-heap-l2-1-0', use_last_error=True) ERROR_INSUFFICIENT_BUFFER = 122 def lookup_account_name(name): sid = (ctypes.c_char * 1)() cb = ctypes.c_ulong() cch = ctypes.c_ulong() name_use = ctypes.c_ulong() lsalookup.LookupAccountNameW(None, name, sid, ctypes.byref(cb), None, ctypes.byref(cch), ctypes.byref(name_use)) error = ctypes.get_last_error() if error != ERROR_INSUFFICIENT_BUFFER: raise ctypes.WinError(error) sid = (ctypes.c_char * cb.value)() domain_name = (ctypes.c_wchar * cch.value)() success = lsalookup.LookupAccountNameW(None, name, sid, ctypes.byref(cb), domain_name, ctypes.byref(cch), ctypes.byref(name_use)) if not success: raise ctypes.WinError(ctypes.get_last_error()) ssid = ctypes.c_wchar_p() if not sddl.ConvertSidToStringSidW(sid, ctypes.byref(ssid)): raise ctypes.WinError(ctypes.get_last_error()) string_sid = ssid.value heap.LocalFree(ssid) return string_sid, domain_name.value, name_use.value ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 12:05:03 2021 From: report at bugs.python.org (Roundup Robot) Date: Thu, 08 Apr 2021 16:05:03 +0000 Subject: [issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10 In-Reply-To: <1582025189.05.0.731615044433.issue39674@roundup.psfhosted.org> Message-ID: <1617897903.17.0.551040255218.issue39674@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 5.0 -> 6.0 pull_requests: +24016 pull_request: https://github.com/python/cpython/pull/25280 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 12:05:16 2021 From: report at bugs.python.org (Roundup Robot) Date: Thu, 08 Apr 2021 16:05:16 +0000 Subject: [issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10 In-Reply-To: <1582025189.05.0.731615044433.issue39674@roundup.psfhosted.org> Message-ID: <1617897916.88.0.895184636839.issue39674@roundup.psfhosted.org> Change by Roundup Robot : ---------- pull_requests: +24017 pull_request: https://github.com/python/cpython/pull/25281 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 12:18:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 16:18:07 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation Message-ID: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> New submission from STINNER Victor : Attached PR documents configure, compiler and linker options to build Python. ---------- assignee: docs at python components: Documentation messages: 390536 nosy: docs at python, vstinner priority: normal severity: normal status: open title: [Doc] Document configure options in the Python documentation versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 12:28:10 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 08 Apr 2021 16:28:10 +0000 Subject: [issue43766] Implement PEP 647 (User-Defined Type Guards) in typing.py In-Reply-To: <1617805670.27.0.185154049077.issue43766@roundup.psfhosted.org> Message-ID: <1617899290.45.0.15898295672.issue43766@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +24018 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25282 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 12:33:44 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 08 Apr 2021 16:33:44 +0000 Subject: [issue43766] Implement PEP 647 (User-Defined Type Guards) in typing.py In-Reply-To: <1617805670.27.0.185154049077.issue43766@roundup.psfhosted.org> Message-ID: <1617899624.96.0.346562555753.issue43766@roundup.psfhosted.org> Ken Jin added the comment: > I assume that this will be pretty simple, right? Yep! The PR speaks for itself ;). typing.py has pretty nice internal constructs to make these types of additions a breeze. I'm really grateful to whoever wrote/refactored the _SpecialForm decorator to what it is today. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 12:36:52 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 08 Apr 2021 16:36:52 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617899812.76.0.890873883572.issue43745@roundup.psfhosted.org> Steve Dower added the comment: I just purged the CDN again and it seems to be fine now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 13:07:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 17:07:37 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1617901657.3.0.88851735407.issue43774@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +24019 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25283 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 13:13:26 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 08 Apr 2021 17:13:26 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1617902006.79.0.0560229815794.issue43764@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +24020 pull_request: https://github.com/python/cpython/pull/25284 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 13:56:34 2021 From: report at bugs.python.org (Maria Kazakova) Date: Thu, 08 Apr 2021 17:56:34 +0000 Subject: [issue43775] JSON Parsing Alarm: Requests + Json = JSONDecodeError Message-ID: <1617904594.75.0.587910269593.issue43775@roundup.psfhosted.org> New submission from Maria Kazakova : I tried to use the usual code: response = requests.get (url) response.json () OR json.loads (response.text) BUT it returns JSONDecodeError Expecting value: line 1 column 1 (char 0) ? no matter, which website I am trying to parse, with headers or without them. However, response.status_code = 200 and response.text returns the whole html-content. Two days ago everything worked completely fine, and now this disaster happens. I asked a couple of friends to try the same ? and everyone failed to succeed, everyone gets this error ? using Jupyter Notebook (+Anaconda, Python 3.7), PyCharm (+Python 3.9) and Google Colab. Please help :( ---------- components: Windows messages: 390539 nosy: marikasakowa, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: JSON Parsing Alarm: Requests + Json = JSONDecodeError type: crash versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 14:26:18 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 08 Apr 2021 18:26:18 +0000 Subject: [issue43772] Minor repr error in typing.TypeVar.__ror__() In-Reply-To: <1617892871.83.0.276667822768.issue43772@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Yes.-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 14:38:41 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 08 Apr 2021 18:38:41 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1617907121.17.0.0286404495423.issue40066@roundup.psfhosted.org> Change by Ethan Furman : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 14:41:25 2021 From: report at bugs.python.org (Sviatoslav Sydorenko) Date: Thu, 08 Apr 2021 18:41:25 +0000 Subject: [issue43540] importlib: Document how to replace load_module() in What's New in Python 3.10 In-Reply-To: <1616062773.63.0.458155955758.issue43540@roundup.psfhosted.org> Message-ID: <1617907285.9.0.650527330106.issue43540@roundup.psfhosted.org> Sviatoslav Sydorenko added the comment: @vstinner: I think I figure out the solution ? https://github.com/pypa/setuptools/pull/2633 ---------- nosy: +webknjaz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 14:42:23 2021 From: report at bugs.python.org (mkocher) Date: Thu, 08 Apr 2021 18:42:23 +0000 Subject: [issue43776] Popen with shell=True yield mangled repr output Message-ID: <1617907343.84.0.247878991461.issue43776@roundup.psfhosted.org> New submission from mkocher : When using Popen with shell=True, the output of the repr is not particularly user friendly. When using the form `p = Popen('python --version'.split())`, the output is reasonably output in a user friendly form of ``. However, when running with `shell=True`, the output is mangled. For example, trying to run `python --help` via `p = Popen('python --version', shell=True)` yields the following output. `` The original change appears to be motivated by https://bugs.python.org/issue38724 and the PR here: https://github.com/python/cpython/pull/17151/files ---------- components: Library (Lib) messages: 390542 nosy: mkocher priority: normal severity: normal status: open title: Popen with shell=True yield mangled repr output type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 14:57:16 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 08 Apr 2021 18:57:16 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1617908236.88.0.352329125983.issue43739@roundup.psfhosted.org> Shreyan Avigyan added the comment: Please have a review. ---------- type: compile error -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 15:15:36 2021 From: report at bugs.python.org (Joshua Bronson) Date: Thu, 08 Apr 2021 19:15:36 +0000 Subject: [issue43751] await anext() returns None when default is given In-Reply-To: <1617724814.14.0.517501509303.issue43751@roundup.psfhosted.org> Message-ID: <1617909336.43.0.983698051657.issue43751@roundup.psfhosted.org> Change by Joshua Bronson : ---------- nosy: +jab _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 15:34:41 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 08 Apr 2021 19:34:41 +0000 Subject: [issue43775] JSON Parsing Alarm: Requests + Json = JSONDecodeError In-Reply-To: <1617904594.75.0.587910269593.issue43775@roundup.psfhosted.org> Message-ID: <1617910481.13.0.774057078024.issue43775@roundup.psfhosted.org> Serhiy Storchaka added the comment: JSON is not HTML. If response.text contains HTML, it is expected that json.loads() cannot parse it. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 15:41:16 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 08 Apr 2021 19:41:16 +0000 Subject: [issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative In-Reply-To: <1617659396.43.0.525762996462.issue43737@roundup.psfhosted.org> Message-ID: <1617910876.76.0.936859427861.issue43737@roundup.psfhosted.org> Raymond Hettinger added the comment: I agree with Steven that minor fact should not be given more weight. It has a specification in the Reference and it own FAQ entry. IMO it doesn't belong in tutorial because having a negative modulus is rare and because burying the use in details makes the tutorial harder to read. The intent of the tutorial is to have a structured, example driven, overview of the language. It necessarily omits uncommon cases and detailed specifications. Thanks for the suggestion, but I am going to close this one as Steven suggested. ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 15:44:56 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 08 Apr 2021 19:44:56 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1617911096.04.0.282834568567.issue38659@roundup.psfhosted.org> Change by Ethan Furman : ---------- keywords: +patch pull_requests: +24021 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25285 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 15:54:45 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 08 Apr 2021 19:54:45 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1617911685.26.0.741042333545.issue43764@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset d92c59f48680122ce0e4d1ccf69d92b983e8db01 by Brandt Bucher in branch 'master': bpo-43764: Fix `__match_args__` generation logic for dataclasses (GH-25284) https://github.com/python/cpython/commit/d92c59f48680122ce0e4d1ccf69d92b983e8db01 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 15:58:43 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 08 Apr 2021 19:58:43 +0000 Subject: [issue43775] JSON Parsing Alarm: Requests + Json = JSONDecodeError In-Reply-To: <1617904594.75.0.587910269593.issue43775@roundup.psfhosted.org> Message-ID: <1617911923.21.0.878149456232.issue43775@roundup.psfhosted.org> Raymond Hettinger added the comment: > Two days ago everything worked completely fine, > and now this disaster happens. It's unlikely that Python itself changed over those two days. It's more likely that the data source has changed. Try this in your notebook: import requests r = requests.get('https://api.github.com/users/gvanrossum') print(r.status_code) print(r.headers['Content-Type']) print(r.json()) If that works, try it with your url. If the content-type is not 'application/json; charset=utf-8', then you've identified a problem with the data source rather than with the tooling. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 16:05:34 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 08 Apr 2021 20:05:34 +0000 Subject: [issue43746] Weird typing annotation closure behavior In-Reply-To: <1617705463.18.0.247710543326.issue43746@roundup.psfhosted.org> Message-ID: <1617912334.0.0.165444573788.issue43746@roundup.psfhosted.org> Eric V. Smith added the comment: Can you put together an example we can actually run? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 16:05:55 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 08 Apr 2021 20:05:55 +0000 Subject: [issue43746] Weird typing annotation closure behavior In-Reply-To: <1617705463.18.0.247710543326.issue43746@roundup.psfhosted.org> Message-ID: <1617912355.51.0.498650233384.issue43746@roundup.psfhosted.org> Change by Eric V. Smith : ---------- Removed message: https://bugs.python.org/msg390548 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 16:06:53 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 08 Apr 2021 20:06:53 +0000 Subject: [issue43746] Weird typing annotation closure behavior In-Reply-To: <1617705463.18.0.247710543326.issue43746@roundup.psfhosted.org> Message-ID: <1617912413.12.0.531976559371.issue43746@roundup.psfhosted.org> Eric V. Smith added the comment: Can you put together an example we can run? Either from a single file, or multiple modules in the current directory? The "..." import makes it complicated to reproduce. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 16:23:14 2021 From: report at bugs.python.org (Bob Kline) Date: Thu, 08 Apr 2021 20:23:14 +0000 Subject: [issue43777] Remove description of "pip search" command from tutorial Message-ID: <1617913394.59.0.105021549467.issue43777@roundup.psfhosted.org> New submission from Bob Kline : The official tutorial instructs users to find third-party packages by using the "pip search" command, which no longer works (and will be deprecated -- and presumably subsequently removed -- according to the error message). See https://docs.python.org/3.10/tutorial/venv.html#managing-packages-with-pip That passage should be removed from the tutorial. ---------- assignee: docs at python components: Documentation messages: 390550 nosy: bkline, docs at python priority: normal severity: normal status: open title: Remove description of "pip search" command from tutorial versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 16:28:29 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 08 Apr 2021 20:28:29 +0000 Subject: [issue43773] macOS official installer builds not respecting DYLD_LIBRARY_PATH environment variable. In-Reply-To: <1617888716.6.0.448516461166.issue43773@roundup.psfhosted.org> Message-ID: <1617913709.47.0.00893784800176.issue43773@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the report. However, I think you've drawn the wrong conclusion form what you've observed. The reason you are unable to do what you are trying to do is that the _sqlite3 module included with the python.org macOS Pythons is statically linked with its own copy of an sqlite3 library, not dynamically linked. This has been true for a long time (10+ years); I believe the original reason was to avoid linking with the Apple-supplied system copy of the sqlite3 library. You can see this by using otool: - with the python.org 3.9.4: $ /usr/local/bin/python3.9 -c 'import sys;print(sys.version)' 3.9.4 (v3.9.4:1f2e3088f3, Apr 4 2021, 12:19:19) [Clang 12.0.0 (clang-1200.0.32.29)] $ /usr/local/bin/python3.9 -c 'import _sqlite3;print(_sqlite3.__file__)' /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_sqlite3.cpython-39-darwin.so $ otool -L $(/usr/local/bin/python3.9 -c 'import _sqlite3;print(_sqlite3.__file__)') /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_sqlite3.cpython-39-darwin.so: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1) - with a MacPorts python3.9.4: $ /opt/macports/bin/python3.9 -c 'import _sqlite3;print(_sqlite3.__file__)' /opt/macports/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_sqlite3.cpython-39-darwin.so $ otool -L $(/opt/macports/bin/python3.9 -c 'import _sqlite3;print(_sqlite3.__file__)') /opt/macports/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_sqlite3.cpython-39-darwin.so: /opt/macports/lib/libsqlite3.0.dylib (compatibility version 9.0.0, current version 9.6.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1) If you want to replace the sqlite3 library, you would need to rebuild the _sqlite3 module. That's not something we would encourage or support. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 16:31:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 20:31:24 +0000 Subject: [issue43778] [Doc] Doc/tools/extensions/glossary_search.py fails with FileNotFoundError if the _static/ directory doesn't exist Message-ID: <1617913884.68.0.820989252764.issue43778@roundup.psfhosted.org> New submission from STINNER Victor : Doc/tools/extensions/glossary_search.py failed multiple times on my doc PR: https://github.com/python/cpython/pull/25283 The fail is not deterministic (random error, timing issue?), it depends if the directory was already created by something else or not. Error on the Docs PR job of the Azure Pipeline: -------------- 2021-04-08T17:55:57.7774293Z writing output... [ 98%] whatsnew/3.5 2021-04-08T17:55:58.0531588Z writing output... [ 98%] whatsnew/3.6 2021-04-08T17:55:58.3085384Z writing output... [ 99%] whatsnew/3.7 2021-04-08T17:55:58.5638166Z writing output... [ 99%] whatsnew/3.8 2021-04-08T17:55:59.3385073Z writing output... [ 99%] whatsnew/3.9 2021-04-08T17:55:59.5205350Z writing output... [ 99%] whatsnew/changelog 2021-04-08T17:56:02.4282200Z writing output... [100%] whatsnew/index 2021-04-08T17:56:03.1454692Z 2021-04-08T17:56:03.1463636Z Writing glossary.json 2021-04-08T17:56:03.1466614Z 2021-04-08T17:56:03.1467473Z Exception occurred: 2021-04-08T17:56:03.3286028Z File "/home/vsts/work/1/s/Doc/tools/extensions/glossary_search.py", line 49, in on_build_finish 2021-04-08T17:56:03.3287379Z with open(path.join(app.outdir, '_static', 'glossary.json'), 'w') as f: 2021-04-08T17:56:03.3288351Z FileNotFoundError: [Errno 2] No such file or directory: '/home/vsts/work/1/s/Doc/build/html/_static/glossary.json' 2021-04-08T17:56:03.3294489Z The full traceback has been saved in /tmp/sphinx-err-1c8jemiu.log, if you want to report the issue to the developers. 2021-04-08T17:56:03.3295501Z Please also report this if it was a user error, so that a better error message can be provided next time. 2021-04-08T17:56:03.3296536Z A bug report can be filed in the tracker at . Thanks! -------------- https://dev.azure.com/Python/cpython/_build/results?buildId=78035&view=results Error on Travis CI: -------------- PATH=./venv/bin:$PATH sphinx-build -b html -d build/doctrees -q -W -j4 -W . build/html Extension error: Handler for event 'build-finished' threw an exception (exception: [Errno 2] No such file or directory: '/home/travis/build/python/cpython/Doc/build/html/_static/glossary.json') Makefile:49: recipe for target 'build' failed -------------- https://travis-ci.com/github/python/cpython/jobs/497108477 Attached PR fix the extension: create the directory if it doesn't exists. ---------- assignee: docs at python components: Documentation messages: 390552 nosy: docs at python, vstinner priority: normal severity: normal status: open title: [Doc] Doc/tools/extensions/glossary_search.py fails with FileNotFoundError if the _static/ directory doesn't exist versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 16:32:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 20:32:38 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1617913958.43.0.992695809899.issue43774@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a41782cc84bcd813209a03e6e11c60e77dbc7718 by Victor Stinner in branch 'master': bpo-43774: Document configure options (GH-25283) https://github.com/python/cpython/commit/a41782cc84bcd813209a03e6e11c60e77dbc7718 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 16:42:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 20:42:23 +0000 Subject: [issue43778] [Doc] Doc/tools/extensions/glossary_search.py fails with FileNotFoundError if the _static/ directory doesn't exist In-Reply-To: <1617913884.68.0.820989252764.issue43778@roundup.psfhosted.org> Message-ID: <1617914543.17.0.871773311597.issue43778@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +24022 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25286 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 17:31:25 2021 From: report at bugs.python.org (Brett Cannon) Date: Thu, 08 Apr 2021 21:31:25 +0000 Subject: [issue42134] Raise ImportWarning when falling back to find_module() In-Reply-To: <1603494610.04.0.950789467246.issue42134@roundup.psfhosted.org> Message-ID: <1617917485.42.0.334914841767.issue42134@roundup.psfhosted.org> Brett Cannon added the comment: > would you accept a PR that changes the changelog entry to contain the ".find_spec() not found; falling back to find_module()" message, for better search-ability? Sure! > Also, could you please explain how to migrate to find_spec() in https://docs.python.org/3.10/whatsnew/3.10.html#porting-to-python-3-10 ? I'd do that, but I don't know yet what is the proper way. The problem is it will possibly vary from class to class. You can probably get pretty far with https://docs.python.org/3/library/importlib.html#importlib.util.spec_from_file_location or https://docs.python.org/3/library/importlib.html#importlib.util.spec_from_loader depending. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 17:37:37 2021 From: report at bugs.python.org (Roundup Robot) Date: Thu, 08 Apr 2021 21:37:37 +0000 Subject: [issue43777] Remove description of "pip search" command from tutorial In-Reply-To: <1617913394.59.0.105021549467.issue43777@roundup.psfhosted.org> Message-ID: <1617917857.18.0.515958015177.issue43777@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +24023 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25287 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 17:39:56 2021 From: report at bugs.python.org (Bob Kline) Date: Thu, 08 Apr 2021 21:39:56 +0000 Subject: [issue43777] Remove description of "pip search" command from tutorial In-Reply-To: <1617913394.59.0.105021549467.issue43777@roundup.psfhosted.org> Message-ID: <1617917996.15.0.0816373515833.issue43777@roundup.psfhosted.org> Bob Kline added the comment: PR submitted: https://github.com/python/cpython/pull/25287 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 17:44:14 2021 From: report at bugs.python.org (Brett Cannon) Date: Thu, 08 Apr 2021 21:44:14 +0000 Subject: [issue43540] importlib: Document how to replace load_module() in What's New in Python 3.10 In-Reply-To: <1616062773.63.0.458155955758.issue43540@roundup.psfhosted.org> Message-ID: <1617918254.49.0.258941491115.issue43540@roundup.psfhosted.org> Brett Cannon added the comment: Much like the question about load_module(), replacing find_module() with find_spec() can be helped with things like importlib.util.spec_from_file_location() and .spec_from_loader() (https://docs.python.org/3/library/importlib.html#importlib.util.spec_from_file_location and https://docs.python.org/3/library/importlib.html#importlib.util.spec_from_loader), but there isn't a 1:1 swap, so it will take some thought. And the docs in importlib for things like find_module() say to implement find_spec() which then mentions spec_from_loader() may be useful. As for replicating the subprocess docs approach, that's a little different since those alternatives in the stdlib are not going anywhere while the stuff in importlib is going to be gone in 3.12 so it will only last for two years. And BTW I took care of six for you knowing you were going to ask about it if I didn't. ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 18:06:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 22:06:23 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1617919583.82.0.45607738392.issue43774@roundup.psfhosted.org> STINNER Victor added the comment: With Sphinx 2, there is an error on the Docs PR job of Azure Pipelines: Warning, treated as error: /home/vsts/work/1/s/Doc/using/configure.rst:416:unknown option: --enable-universalsdk ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 18:07:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 22:07:21 +0000 Subject: [issue43778] [Doc] Doc/tools/extensions/glossary_search.py fails with FileNotFoundError if the _static/ directory doesn't exist In-Reply-To: <1617913884.68.0.820989252764.issue43778@roundup.psfhosted.org> Message-ID: <1617919641.38.0.0959230438692.issue43778@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f32d0221477f18993666bb66cc79c61c4e145d42 by Victor Stinner in branch 'master': bpo-43778: Fix Sphinx glossary_search extension (GH-25286) https://github.com/python/cpython/commit/f32d0221477f18993666bb66cc79c61c4e145d42 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 18:08:01 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 08 Apr 2021 22:08:01 +0000 Subject: [issue43779] Fix possible _PyArena_AddPyObject ref leaks Message-ID: <1617919681.12.0.940558119091.issue43779@roundup.psfhosted.org> New submission from Erlend Egeberg Aasland : _PyArena_AddPyObject() only steals the object reference if successful. - In Parser/pegen.c, _PyPegen_fill_token(), the return value is not checked at all. - In Parser/asdl_c.py, none of the (two) calls to _PyArena_AddPyObject() decref on failure - Ditto for Python/Python-ast.c Attached patch fixes all callers. I'll put up a PR if it looks ok. Alternatively, one could make _PyArena_AddPyObject() _not_ steal the reference, but since it's an exposed API, that's probably not an option. ---------- files: patch.diff keywords: patch messages: 390559 nosy: erlendaasland, pablogsal priority: normal severity: normal status: open title: Fix possible _PyArena_AddPyObject ref leaks type: behavior versions: Python 3.10 Added file: https://bugs.python.org/file49943/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 18:08:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 22:08:42 +0000 Subject: [issue43778] [Doc] Doc/tools/extensions/glossary_search.py fails with FileNotFoundError if the _static/ directory doesn't exist In-Reply-To: <1617913884.68.0.820989252764.issue43778@roundup.psfhosted.org> Message-ID: <1617919722.79.0.355911768281.issue43778@roundup.psfhosted.org> STINNER Victor added the comment: Python 3.9 is not affected, this Sphinx extension is new in Python 3.10. By the way, I like this feature! The new " Glossary: borrowed reference " block in: https://docs.python.org/3.10/search.html?q=borrowed+reference ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 18:10:55 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 08 Apr 2021 22:10:55 +0000 Subject: [issue43779] Fix possible parser/AST ref leaks In-Reply-To: <1617919681.12.0.940558119091.issue43779@roundup.psfhosted.org> Message-ID: <1617919855.59.0.625333010346.issue43779@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- title: Fix possible _PyArena_AddPyObject ref leaks -> Fix possible parser/AST ref leaks _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 18:18:16 2021 From: report at bugs.python.org (Benoit Hudson) Date: Thu, 08 Apr 2021 22:18:16 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1617920296.78.0.630536672604.issue41100@roundup.psfhosted.org> Benoit Hudson added the comment: Is there any hope of a backport to 3.7? Or has that ship sailed? ---------- nosy: +benoithudson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 18:20:45 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 08 Apr 2021 22:20:45 +0000 Subject: [issue43779] Fix possible parser/AST ref leaks In-Reply-To: <1617919681.12.0.940558119091.issue43779@roundup.psfhosted.org> Message-ID: <1617920445.37.0.314889450972.issue43779@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Ah, I see that the Parser/asdl_c.py case is handled by the callers. So that leaves only Parser/pegen.c. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 18:20:48 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Apr 2021 22:20:48 +0000 Subject: [issue43779] Fix possible parser/AST ref leaks In-Reply-To: <1617919681.12.0.940558119091.issue43779@roundup.psfhosted.org> Message-ID: <1617920448.14.0.972415446518.issue43779@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks Erlend. Mind creating a PR from the patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 18:20:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 22:20:13 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1617920413.17.0.555034158755.issue41100@roundup.psfhosted.org> STINNER Victor added the comment: > Is there any hope of a backport to 3.7? Or has that ship sailed? Python 3.7 doesn't accept bugfixes anymore, nor new features, nor new platofrm support (macOS 11). The 3.7 branch now only accept security fixes: https://devguide.python.org/#status-of-python-branches ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 18:21:27 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 08 Apr 2021 22:21:27 +0000 Subject: [issue43779] Fix possible parser/AST ref leaks In-Reply-To: <1617919681.12.0.940558119091.issue43779@roundup.psfhosted.org> Message-ID: <1617920487.22.0.836976689142.issue43779@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Yes, I'll do that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 18:23:12 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 08 Apr 2021 22:23:12 +0000 Subject: [issue43779] Fix possible parser/AST ref leaks In-Reply-To: <1617919681.12.0.940558119091.issue43779@roundup.psfhosted.org> Message-ID: <1617920592.42.0.975136884569.issue43779@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24024 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25289 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 18:32:21 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 08 Apr 2021 22:32:21 +0000 Subject: [issue43779] Fix possible parser/AST ref leaks In-Reply-To: <1617919681.12.0.940558119091.issue43779@roundup.psfhosted.org> Message-ID: <1617921141.72.0.434028188394.issue43779@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: We could also adjust Parser/asdl_c.py to decref right after a failed _PyArena_AddPyObject() call, instead of goto failure and Py_XDECREF. I'm not sure it's worth it though. ---------- Added file: https://bugs.python.org/file49944/parser.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 18:33:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Apr 2021 22:33:58 +0000 Subject: [issue43779] Fix possible parser/AST ref leaks In-Reply-To: <1617919681.12.0.940558119091.issue43779@roundup.psfhosted.org> Message-ID: <1617921238.04.0.508254411777.issue43779@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > We could also adjust Parser/asdl_c.py to decref right after a failed _PyArena_AddPyObject() call, instead of goto failure and Py_XDECREF. I'm not sure it's worth it though. I normally recommend having the least amount of exist paths possible, makes reasoning easily normally at the cost of some extra NULL checks for the XDECREF in failure scenarios ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 18:34:29 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 08 Apr 2021 22:34:29 +0000 Subject: [issue39702] PEP 614: Relaxing Grammar Restrictions On Decorators In-Reply-To: <1582215145.16.0.34815642768.issue39702@roundup.psfhosted.org> Message-ID: <1617921269.58.0.49231172644.issue39702@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset 1e051a21b7106a93c30b74aad7e1f40d6c0c477b by Saiyang Gou in branch 'master': bpo-39702: Remove dotted_name from decorator documentation (GH-25234) https://github.com/python/cpython/commit/1e051a21b7106a93c30b74aad7e1f40d6c0c477b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 18:36:14 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 08 Apr 2021 22:36:14 +0000 Subject: [issue43779] Fix possible parser/AST ref leaks In-Reply-To: <1617919681.12.0.940558119091.issue43779@roundup.psfhosted.org> Message-ID: <1617921374.68.0.697334243767.issue43779@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: +1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 18:40:51 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 08 Apr 2021 22:40:51 +0000 Subject: [issue39702] PEP 614: Relaxing Grammar Restrictions On Decorators In-Reply-To: <1582215145.16.0.34815642768.issue39702@roundup.psfhosted.org> Message-ID: <1617921651.18.0.917801634315.issue39702@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24025 pull_request: https://github.com/python/cpython/pull/25290 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 19:04:03 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 08 Apr 2021 23:04:03 +0000 Subject: [issue39702] PEP 614: Relaxing Grammar Restrictions On Decorators In-Reply-To: <1582215145.16.0.34815642768.issue39702@roundup.psfhosted.org> Message-ID: <1617923043.22.0.0871460513214.issue39702@roundup.psfhosted.org> miss-islington added the comment: New changeset a9228d02d16fe90f2f13e7e9ec478f7b4f8607a2 by Miss Islington (bot) in branch '3.9': [3.9] bpo-39702: Remove dotted_name from decorator documentation (GH-25234) (GH-25290) https://github.com/python/cpython/commit/a9228d02d16fe90f2f13e7e9ec478f7b4f8607a2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 19:24:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 23:24:06 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1617924246.0.0.633481930047.issue43774@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24026 pull_request: https://github.com/python/cpython/pull/25293 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 19:29:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 23:29:27 +0000 Subject: [issue39674] Keep deprecated features in Python 3.9 to ease migration from Python 2.7, but remove in Python 3.10 In-Reply-To: <1582025189.05.0.731615044433.issue39674@roundup.psfhosted.org> Message-ID: <1617924567.6.0.820689807894.issue39674@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 20d56bd41b56023ce9fa3739c0c9aa8be8d48bfa by Markus Gerstel in branch '3.8': bpo-39674: Fix collections ABC deprecation notice (GH-25281) https://github.com/python/cpython/commit/20d56bd41b56023ce9fa3739c0c9aa8be8d48bfa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 19:51:56 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 08 Apr 2021 23:51:56 +0000 Subject: [issue43780] Sync importlib_metadata enhancements through 3.10. Message-ID: <1617925916.07.0.133652663909.issue43780@roundup.psfhosted.org> New submission from Jason R. Coombs : Incorporate importlib_metadata changes from 3.8 through 3.10: https://importlib-metadata.readthedocs.io/en/latest/history.html#v3-10-0 Two main changes: - Add mtime-based caching during distribution discovery. - Flagged use of dict result from ``entry_points`` as deprecated. ---------- components: Library (Lib) messages: 390572 nosy: jaraco priority: normal severity: normal status: open title: Sync importlib_metadata enhancements through 3.10. versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 19:53:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 23:53:58 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1617926038.1.0.613415449482.issue43774@roundup.psfhosted.org> STINNER Victor added the comment: The following syntax fails on the Docs PR job of the Azure Pipelines: ------------------ .. cmdoption:: --with-cxx-main .. cmdoption:: --with-cxx-main=COMPILER Compile the Python ``main()`` function and link Python executable with C++ compiler: ``$CXX``, or *COMPILER* if specified. ------------------ Error: ------------------ Warning, treated as error: /home/vsts/work/1/s/Doc/using/configure.rst:47:Duplicate explicit target name: "cmdoption--with-cxx-main". Makefile:49: recipe for target 'build' failed ------------------ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 19:57:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Apr 2021 23:57:00 +0000 Subject: [issue43751] await anext() returns None when default is given In-Reply-To: <1617724814.14.0.517501509303.issue43751@roundup.psfhosted.org> Message-ID: <1617926220.42.0.48546545715.issue43751@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 19:58:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 23:58:14 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1617926294.87.0.221288041461.issue43774@roundup.psfhosted.org> STINNER Victor added the comment: > The following syntax fails on the Docs PR job of the Azure Pipelines: It uses Sphinx 2.2.0. Do we still support Spinx 2.2.0? Collecting sphinx==2.2.0 ... Successfully installed Jinja2-2.11.3 MarkupSafe-1.1.1 Pygments-2.8.1 alabaster-0.7.12 babel-2.9.0 blurb-1.0.8 certifi-2020.12.5 chardet-4.0.0 docutils-0.17 idna-2.10 imagesize-1.2.0 packaging-20.9 pyparsing-2.4.7 python-docs-theme-2020.12 pytz-2021.1 requests-2.25.1 snowballstemmer-2.1.0 sphinx-2.2.0 sphinxcontrib-applehelp-1.0.2 sphinxcontrib-devhelp-1.0.2 sphinxcontrib-htmlhelp-1.0.3 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.3 sphinxcontrib-serializinghtml-1.1.4 urllib3-1.26.4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 19:58:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 23:58:27 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1617926307.6.0.735468110912.issue43774@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 54366953633dbe5d9585dbae0c633d4e92df2d04 by Victor Stinner in branch 'master': bpo-43774: Enhance configure documentation (GH-25293) https://github.com/python/cpython/commit/54366953633dbe5d9585dbae0c633d4e92df2d04 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 19:59:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Apr 2021 23:59:05 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1617926345.03.0.290508195004.issue43774@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24027 pull_request: https://github.com/python/cpython/pull/25296 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 20:06:40 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 09 Apr 2021 00:06:40 +0000 Subject: [issue43780] Sync importlib_metadata enhancements through 3.10. In-Reply-To: <1617925916.07.0.133652663909.issue43780@roundup.psfhosted.org> Message-ID: <1617926800.84.0.0181569979374.issue43780@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- keywords: +patch pull_requests: +24028 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25297 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 20:18:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Apr 2021 00:18:11 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1617927491.58.0.561748304649.issue43774@roundup.psfhosted.org> STINNER Victor added the comment: I wrote PR 25296 to reuse Doc/requirements.txt in the Docs PR job of Azure Pipelines. It installs Sphinx 3.2.1 as expected, and with this version, no warning is emitted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 21:23:59 2021 From: report at bugs.python.org (Sam Stern) Date: Fri, 09 Apr 2021 01:23:59 +0000 Subject: [issue43781] SIGSEGV when replacing _multiprocessing.SemLock at runtime Message-ID: <1617931439.33.0.179250347978.issue43781@roundup.psfhosted.org> New submission from Sam Stern : When patching `_multiprocessing.SemLock` at runtime and then instantiating an instance of `multiprocessing.Pool`, the interpreter throws a SIGSEGV when trying to access a field of `_multiprocessing.SemLock` on pre-3.9 pythons ---------- components: Interpreter Core files: this-segfaults.py messages: 390577 nosy: sternj priority: normal severity: normal status: open title: SIGSEGV when replacing _multiprocessing.SemLock at runtime type: crash versions: Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file49945/this-segfaults.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 21:26:32 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 09 Apr 2021 01:26:32 +0000 Subject: [issue31956] Add start and stop parameters to the array.index() In-Reply-To: <1509966827.68.0.213398074469.issue31956@psf.upfronthosting.co.za> Message-ID: <1617931592.58.0.125822796656.issue31956@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 21:30:22 2021 From: report at bugs.python.org (Sam Stern) Date: Fri, 09 Apr 2021 01:30:22 +0000 Subject: [issue43781] SIGSEGV when replacing _multiprocessing.SemLock at runtime In-Reply-To: <1617931439.33.0.179250347978.issue43781@roundup.psfhosted.org> Message-ID: <1617931822.1.0.716310297114.issue43781@roundup.psfhosted.org> Sam Stern added the comment: This does not arise on 3.8.9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 21:44:40 2021 From: report at bugs.python.org (William Pickard) Date: Fri, 09 Apr 2021 01:44:40 +0000 Subject: [issue43776] Popen with shell=True yield mangled repr output In-Reply-To: <1617907343.84.0.247878991461.issue43776@roundup.psfhosted.org> Message-ID: <1617932680.57.0.0525438515921.issue43776@roundup.psfhosted.org> William Pickard added the comment: Actually, the problem is independent of the value of "shell", the __repr__ function from the initial PR that introduced it expects "args" to be a sequence and converts it to a list. ---------- nosy: +WildCard65 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 21:52:15 2021 From: report at bugs.python.org (Anthony Sottile) Date: Fri, 09 Apr 2021 01:52:15 +0000 Subject: [issue43782] Failure to build from source on ppc64le on ubuntu xenial Message-ID: <1617933135.46.0.871973088731.issue43782@roundup.psfhosted.org> New submission from Anthony Sottile : I realize this is unlikely to be a helpful report, but something that changed between 3.9.3 and 3.9.4 has caused the build to break on (admittedly a strange platform) ppc64le I attached the build log (zipped because otherwise it's too big ?) The live URL is here: https://launchpadlibrarian.net/532585040/buildlog_ubuntu-xenial-ppc64el.python3.9_3.9.4-1+xenial1_BUILDING.txt.gz Probably the most relevant part of the bug report is this bit, though I'm guessing so I don't really know what is useful and what is not. ``` Preprocessed source stored into /tmp/ccIkITd0.out file, please attach this to your bugreport. === BEGIN GCC DUMP === // Target: powerpc64le-linux-gnu // Configured with: ../src/configure -v --with-pkgversion='Ubuntu/IBM 5.4.0-6ubuntu1~16.04.12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-ppc64el/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-ppc64el --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-ppc64el --with-arch-directory=ppc64le --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-secureplt --with-cpu=power8 --enable-targets=powerpcle-linux --disable-multilib --enable-multiarch --disable-werror --with-long-double-128 --enable-checking=release --build=powerpc64le-linux-gnu --host=powerpc64le-linux-gnu --target=powerpc64le-linux-gnu // Thread model: posix // gcc version 5.4.0 20160609 (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.12) // // ../Python/ceval.c: In function 'is_tstate_valid': // ../Python/ceval.c:5694:1: internal compiler error: Segmentation fault // } // ^ // Please submit a full bug report, // with preprocessed source if appropriate. // See for instructions. ``` ---------- components: Build files: buildlog.tgz messages: 390580 nosy: Anthony Sottile priority: normal severity: normal status: open title: Failure to build from source on ppc64le on ubuntu xenial versions: Python 3.9 Added file: https://bugs.python.org/file49946/buildlog.tgz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 21:59:16 2021 From: report at bugs.python.org (Ethan Smith) Date: Fri, 09 Apr 2021 01:59:16 +0000 Subject: [issue43782] Failure to build from source on ppc64le on ubuntu xenial In-Reply-To: <1617933135.46.0.871973088731.issue43782@roundup.psfhosted.org> Message-ID: <1617933556.98.0.0690233930357.issue43782@roundup.psfhosted.org> Change by Ethan Smith : ---------- nosy: +ethan smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 22:03:03 2021 From: report at bugs.python.org (Anthony Sottile) Date: Fri, 09 Apr 2021 02:03:03 +0000 Subject: [issue43782] Failure to build from source on ppc64le on ubuntu xenial In-Reply-To: <1617933135.46.0.871973088731.issue43782@roundup.psfhosted.org> Message-ID: <1617933783.76.0.567042512806.issue43782@roundup.psfhosted.org> Anthony Sottile added the comment: hmmm strange, the only changes in 3.9.4 are a revert -- perhaps this is a flakey bug in gcc and not actionable I've clicked rebuild on my build, maybe it'll magically fix it plus xenial is almost end of lifed so I doubt anyone cares about this strange architecture on an old platform anyway ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 22:03:28 2021 From: report at bugs.python.org (Ruairidh MacLeod) Date: Fri, 09 Apr 2021 02:03:28 +0000 Subject: [issue43782] Failure to build from source on ppc64le on ubuntu xenial In-Reply-To: <1617933135.46.0.871973088731.issue43782@roundup.psfhosted.org> Message-ID: <1617933808.27.0.335706069883.issue43782@roundup.psfhosted.org> Change by Ruairidh MacLeod : ---------- nosy: +rkm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 22:03:46 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 09 Apr 2021 02:03:46 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1617933826.72.0.793767838681.issue43774@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for adding this. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 22:06:06 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 09 Apr 2021 02:06:06 +0000 Subject: [issue43783] Make ParamSpec.args/kwargs more useful objects Message-ID: <1617933966.5.0.0238313977797.issue43783@roundup.psfhosted.org> New submission from Jelle Zijlstra : Currently, typing.ParamSpec.args and ParamSpec.kwargs are just object() instances, which makes them useless for runtime inspection of __annotations__. This type was introduced by PEP 612. Instead, I propose to make them return some special helper object with __origin__ set to the underlying ParamSpec object. I'll work on a PR soon. ---------- components: Library (Lib) messages: 390583 nosy: Jelle Zijlstra, gvanrossum, levkivskyi priority: normal severity: normal status: open title: Make ParamSpec.args/kwargs more useful objects versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 22:06:20 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 09 Apr 2021 02:06:20 +0000 Subject: [issue43783] Make ParamSpec.args/kwargs more useful objects In-Reply-To: <1617933966.5.0.0238313977797.issue43783@roundup.psfhosted.org> Message-ID: <1617933980.01.0.208957732476.issue43783@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- assignee: -> Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 22:42:50 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 09 Apr 2021 02:42:50 +0000 Subject: [issue43782] Failure to build from source on ppc64le on ubuntu xenial In-Reply-To: <1617933135.46.0.871973088731.issue43782@roundup.psfhosted.org> Message-ID: <1617936170.12.0.0180410576343.issue43782@roundup.psfhosted.org> Zachary Ware added the comment: The error message certainly looks more like a compiler bug than a Python bug. FTR, we also have several builders on buildbot.python.org [1] running Fedora or RHEL on PPC64LE, none of which appear to have a problem. [1] https://buildbot.python.org/all/#/builders?tags=%2B3.9 (search ppc64le) ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 22:48:12 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 09 Apr 2021 02:48:12 +0000 Subject: [issue43783] Make ParamSpec.args/kwargs more useful objects In-Reply-To: <1617933966.5.0.0238313977797.issue43783@roundup.psfhosted.org> Message-ID: <1617936492.9.0.847906723007.issue43783@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- keywords: +patch pull_requests: +24029 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25298 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 22:51:51 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 09 Apr 2021 02:51:51 +0000 Subject: [issue43777] Remove description of "pip search" command from tutorial In-Reply-To: <1617913394.59.0.105021549467.issue43777@roundup.psfhosted.org> Message-ID: <1617936711.89.0.236016796464.issue43777@roundup.psfhosted.org> Inada Naoki added the comment: You are misreading the error message. > RuntimeError: PyPI's XMLRPC API is currently disabled due to unmanageable load and will be deprecated in the near future. See https://status.python.org/ for more information. This error message says "PyPI's XMLRPC API" is disabled and will be deprecated. It doesn't say `pip search` command is disabled and will be deprecated. Removing or reimplement `pip search` is discussed in this issue: https://github.com/pypa/pip/issues/5216 Anyway, I am +1 to remove it from the tutorial. ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 22:57:37 2021 From: report at bugs.python.org (Colin Caprani) Date: Fri, 09 Apr 2021 02:57:37 +0000 Subject: [issue38974] using tkinter.filedialog.askopenfilename() freezes python 3.8 In-Reply-To: <1575488682.09.0.412861821421.issue38974@roundup.psfhosted.org> Message-ID: <1617937057.16.0.255324639937.issue38974@roundup.psfhosted.org> Colin Caprani added the comment: In case it helps, I have the same problem. Running python 3.8.8 on Windows 10, and any MWE doesn't work, e.g.: from tkinter import filedialog from tkinter import * root = Tk() root.filename = filedialog.askopenfilename(initialdir = "/",title = "Select file",filetypes = (("jpeg files","*.jpg"),("all files","*.*"))) print (root.filename) I just get the spinning circle and unresponsive dialog. I have quite a few shell integrations so uninstalling them is not ideal. ---------- nosy: +colin.caprani _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 8 23:56:55 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 09 Apr 2021 03:56:55 +0000 Subject: [issue43682] Make static methods created by @staticmethod callable In-Reply-To: <1617201081.91.0.895015962683.issue43682@roundup.psfhosted.org> Message-ID: <1617940615.93.0.699506519428.issue43682@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 01:10:40 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 09 Apr 2021 05:10:40 +0000 Subject: [issue43779] Fix possible parser/AST ref leaks In-Reply-To: <1617919681.12.0.940558119091.issue43779@roundup.psfhosted.org> Message-ID: <1617945040.64.0.918938910676.issue43779@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24030 pull_request: https://github.com/python/cpython/pull/25294 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 01:25:49 2021 From: report at bugs.python.org (Kevin M) Date: Fri, 09 Apr 2021 05:25:49 +0000 Subject: [issue43784] [Windows] interpreter hangs indefinitely on subprocess.communicate during __del__ at script exit Message-ID: <1617945949.93.0.237236734747.issue43784@roundup.psfhosted.org> New submission from Kevin M : I've noticed an issue (or user error) in which Python a call that otherwise usually works in the __del__ step of a class will freeze when the Python interpreter is exiting. I've attached sample code that I've ran against Python 3.9.1 on Windows 10. The code below runs a process and communicates via the pipe. class SubprocTest(object): def run(self): print("run") proc_args = ["cmd.exe"] self._process = subprocess.Popen(proc_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) def __del__(self): print("__del__") if self._process is not None: self.terminate() def terminate(self): print("terminate") self._process.communicate(input=b"exit\n", timeout=1) print("kill") self._process.kill() self._process = None if __name__ == "__main__": s = SubprocTest() s.run() del s print("s done") t = SubprocTest() t.run() print("t done") Current output: run __del__ terminate kill s done run t done __del__ terminate <<<<<< hangs indefinitely here, even though timeout=1 Expected output: run __del__ terminate kill s done run t done __del__ terminate kill In normal circumstances, when you del the object and force a run of __del__(), the process ends properly and the terminate() method completes. When the Python interpreter exits, Python calls the __del__() method of the class. In this case, the terminate() never completes and the script freezes indefinitely on the communicate() ---------- components: Library (Lib), Windows files: win_subprocess_hang.py messages: 390587 nosy: paul.moore, steve.dower, sylikc, tim.golden, zach.ware priority: normal severity: normal status: open title: [Windows] interpreter hangs indefinitely on subprocess.communicate during __del__ at script exit versions: Python 3.9 Added file: https://bugs.python.org/file49947/win_subprocess_hang.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 01:42:16 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 09 Apr 2021 05:42:16 +0000 Subject: [issue43785] bz2 performance issue. Message-ID: <1617946936.07.0.338866506245.issue43785@roundup.psfhosted.org> New submission from Inada Naoki : The original issue is reported here. https://discuss.python.org/t/non-optimal-bz2-reading-speed/6869 1. Only BZ2File uses RLock() lzma and gzip don't use RLock(). It adds significant performance overhead. When I removed `with self._lock:`, decompression speed improved from about 148k line/sec to 200k line/sec. 2. The default __iter__ calls `readline()` for each iteration. BZ2File.readline() is implemented in C so it is slightly slow than C implementation. If I add this `__iter__()` to BZ2File, decompression speed improved from about 148k lines/sec (or 200k lines/sec) to 500k lines/sec. def __iter__(self): self._check_can_read() return iter(self._buffer) If this __iter__ method is safe, it can be added to gzip and lzma too. ---------- components: Library (Lib) files: dec.py messages: 390588 nosy: methane priority: normal severity: normal status: open title: bz2 performance issue. versions: Python 3.10 Added file: https://bugs.python.org/file49948/dec.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 01:42:37 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 09 Apr 2021 05:42:37 +0000 Subject: [issue43785] bz2 performance issue. In-Reply-To: <1617946936.07.0.338866506245.issue43785@roundup.psfhosted.org> Message-ID: <1617946957.52.0.473536270235.issue43785@roundup.psfhosted.org> Change by Inada Naoki : ---------- type: -> performance Added file: https://bugs.python.org/file49949/create.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 01:52:46 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 09 Apr 2021 05:52:46 +0000 Subject: [issue43785] bz2 performance issue. In-Reply-To: <1617946936.07.0.338866506245.issue43785@roundup.psfhosted.org> Message-ID: <1617947566.07.0.169222028415.issue43785@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +24031 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25299 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 02:04:52 2021 From: report at bugs.python.org (Carlton Gibson) Date: Fri, 09 Apr 2021 06:04:52 +0000 Subject: [issue43773] macOS official installer builds not respecting DYLD_LIBRARY_PATH environment variable. In-Reply-To: <1617888716.6.0.448516461166.issue43773@roundup.psfhosted.org> Message-ID: <1617948292.82.0.678447142263.issue43773@roundup.psfhosted.org> Carlton Gibson added the comment: Hi Ned, Thank you for the reply. That explains a lot. I hadn't considered that SQLite would be statically linked. > I believe the original reason was to avoid linking with the Apple-supplied system copy of the sqlite3 library. I can see that being a goal, yes. It's likely a niche use-case needing to adjust the SQLite version, so ? Thanks again! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 02:29:43 2021 From: report at bugs.python.org (conchylicultor) Date: Fri, 09 Apr 2021 06:29:43 +0000 Subject: [issue43746] Weird typing annotation closure behavior In-Reply-To: <1617705463.18.0.247710543326.issue43746@roundup.psfhosted.org> Message-ID: <1617949783.6.0.830883612207.issue43746@roundup.psfhosted.org> conchylicultor added the comment: Sure, here is a minimal reproductible example demonstrating the issue: ``` import pathlib class C: pathlib: pathlib.Path = None ``` Which raises: ``` File "....py", line 5, in C pathlib: pathlib.Path = None AttributeError: 'NoneType' object has no attribute 'Path' ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 03:05:41 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 09 Apr 2021 07:05:41 +0000 Subject: [issue43746] Weird typing annotation closure behavior In-Reply-To: <1617705463.18.0.247710543326.issue43746@roundup.psfhosted.org> Message-ID: <1617951941.83.0.907075755525.issue43746@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: I guess this is similar to the explanation at https://bugs.python.org/issue36363#msg338389 > The problem in the original code is that the annotation references a global name that is shadowed by a local (to the class body) name, and because of the initialization, the latter takes precedence. (To see for yourself, use the dis module to disassemble the code for Spam and Spaz.) ---------- nosy: +gvanrossum, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 03:05:55 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 09 Apr 2021 07:05:55 +0000 Subject: [issue43785] bz2 performance issue. In-Reply-To: <1617946936.07.0.338866506245.issue43785@roundup.psfhosted.org> Message-ID: <1617951955.48.0.246078661318.issue43785@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 03:08:52 2021 From: report at bugs.python.org (Maria Kazakova) Date: Fri, 09 Apr 2021 07:08:52 +0000 Subject: [issue43775] JSON Parsing Alarm: Requests + Json = JSONDecodeError In-Reply-To: <1617904594.75.0.587910269593.issue43775@roundup.psfhosted.org> Message-ID: <1617952132.59.0.591617702829.issue43775@roundup.psfhosted.org> Maria Kazakova added the comment: Thank you so much for the answers!! The problem was indeed with the data source, they have fixed it. Sorry for bothering you! Wish you all the best!!! ---------- nosy: -paul.moore, steve.dower, tim.golden, zach.ware resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 03:09:19 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 09 Apr 2021 07:09:19 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1617952159.83.0.461810047811.issue41486@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 03:28:49 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 09 Apr 2021 07:28:49 +0000 Subject: [issue43784] starting a thread in __del__ hangs at interpreter shutdown In-Reply-To: <1617945949.93.0.237236734747.issue43784@roundup.psfhosted.org> Message-ID: <1617953329.01.0.712698519941.issue43784@roundup.psfhosted.org> Eryk Sun added the comment: It's not a subprocess bug, per se. It's due to creating the stdout/stderr worker threads from the __del__ finalizer while the interpreter is shutting down. Minimal reproducer, confirmed in both Linux and Windows: import threading class C: def __del__(self): t = threading.Thread(target=print, args=('spam',), daemon=True) t.start() c = C() #del c # uncomment to prevent hanging ---------- components: -Windows nosy: +eryksun title: [Windows] interpreter hangs indefinitely on subprocess.communicate during __del__ at script exit -> starting a thread in __del__ hangs at interpreter shutdown type: -> behavior versions: +Python 3.10, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 03:30:17 2021 From: report at bugs.python.org (Ma Lin) Date: Fri, 09 Apr 2021 07:30:17 +0000 Subject: [issue43785] bz2 performance issue. In-Reply-To: <1617946936.07.0.338866506245.issue43785@roundup.psfhosted.org> Message-ID: <1617953417.7.0.467670018723.issue43785@roundup.psfhosted.org> Change by Ma Lin : ---------- nosy: +malin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 03:30:45 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 09 Apr 2021 07:30:45 +0000 Subject: [issue43784] starting a thread in __del__ hangs at interpreter shutdown In-Reply-To: <1617945949.93.0.237236734747.issue43784@roundup.psfhosted.org> Message-ID: <1617953445.19.0.182748312013.issue43784@roundup.psfhosted.org> Change by Eryk Sun : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 03:49:13 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Apr 2021 07:49:13 +0000 Subject: [issue43682] Make static methods created by @staticmethod callable In-Reply-To: <1617201081.91.0.895015962683.issue43682@roundup.psfhosted.org> Message-ID: <1617954553.47.0.0825960331593.issue43682@roundup.psfhosted.org> Serhiy Storchaka added the comment: Currently pydoc on X.sm gives: --- sm(x, y) A static method --- I concur with Mark Shannon. The root problem is that Python functions and built-in functions have different behavior when assigned as class attribute. The former became an instance method, but the latter is not. If wrap builtin open with statickmethod, the repr of open will be something like "staticmethod()" instead of just "". It is confusing. It will produce a lot of questions why open (and only open) is so special. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 03:51:55 2021 From: report at bugs.python.org (=?utf-8?q?Jo=C3=ABl_Larose?=) Date: Fri, 09 Apr 2021 07:51:55 +0000 Subject: [issue43746] Weird typing annotation closure behavior In-Reply-To: <1617705463.18.0.247710543326.issue43746@roundup.psfhosted.org> Message-ID: <1617954715.86.0.698966656827.issue43746@roundup.psfhosted.org> Jo?l Larose added the comment: An easy workaround would be to alias your import or to import your class directly. ``` from ... import losses as l class A: losses: l.Losses = l.Losses() ``` or ``` from ...losses import Losses class A: losses: Losses = Losses() ``` ---------- nosy: +joel.larose _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 04:07:30 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 09 Apr 2021 08:07:30 +0000 Subject: [issue43785] Remove RLock from BZ2File In-Reply-To: <1617946936.07.0.338866506245.issue43785@roundup.psfhosted.org> Message-ID: <1617955650.07.0.471288320467.issue43785@roundup.psfhosted.org> Inada Naoki added the comment: I will create a separated issue for __iter__, because it is same to gzip and lzma. ---------- title: bz2 performance issue. -> Remove RLock from BZ2File _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 04:31:57 2021 From: report at bugs.python.org (Bill Collins) Date: Fri, 09 Apr 2021 08:31:57 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617957117.8.0.447983128657.issue43745@roundup.psfhosted.org> Bill Collins added the comment: Confirmed, thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 04:48:19 2021 From: report at bugs.python.org (=?utf-8?q?Nico_Schl=C3=B6mer?=) Date: Fri, 09 Apr 2021 08:48:19 +0000 Subject: [issue43786] slice(None) is slice(None) is False Message-ID: <1617958099.53.0.277889313543.issue43786@roundup.psfhosted.org> New submission from Nico Schl?mer : I stumbled upon this when dealing with NumPy arrays: ``` slice(None) is slice(None) ``` ``` False ``` This came up when trying to check if a variable `a` equals `slice(None)`. The comparison ``` a = slice(None) a == slice(None) ``` ``` True ``` works, but doesn't return a single Boolean if a is a NumPy array, for example. Perhaps there's another way of finding out if a variable is exactly `slice(None)`, but the failure of `is` seems like a bug. ---------- messages: 390598 nosy: nschloe priority: normal severity: normal status: open title: slice(None) is slice(None) is False _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 04:49:43 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 09 Apr 2021 08:49:43 +0000 Subject: [issue43787] Optimize BZ2File, GzipFile, and LZMAFile __iter__ method. Message-ID: <1617958183.01.0.290245206759.issue43787@roundup.psfhosted.org> New submission from Inada Naoki : __iter__ method of BZ2File, GzipFile, and LZMAFile is IOBase.__iter__. It calls `readline()` for each line. Since `readline()` is defined as Python function, it is slower than C iterator. Adding custom __iter__ method that delegates to underlying buffer __iter__ makes `for line in file` 2x faster. def __iter__(self): self._check_can_read() return self._buffer.__iter__() --- The original issue is reported here. https://discuss.python.org/t/non-optimal-bz2-reading-speed/6869 This issue is relating to #43785. ---------- components: Library (Lib) messages: 390599 nosy: methane priority: normal severity: normal status: open title: Optimize BZ2File, GzipFile, and LZMAFile __iter__ method. type: performance versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 05:30:39 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 09 Apr 2021 09:30:39 +0000 Subject: [issue43787] Optimize BZ2File, GzipFile, and LZMAFile __iter__ method. In-Reply-To: <1617958183.01.0.290245206759.issue43787@roundup.psfhosted.org> Message-ID: <1617960639.61.0.144434739753.issue43787@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 05:41:43 2021 From: report at bugs.python.org (Bartosz Kwitniewski) Date: Fri, 09 Apr 2021 09:41:43 +0000 Subject: [issue38963] multiprocessing processes seem to "bleed" user information (GID/UID/groups) In-Reply-To: <1575437643.58.0.600766236009.issue38963@roundup.psfhosted.org> Message-ID: <1617961303.8.0.685698081642.issue38963@roundup.psfhosted.org> Bartosz Kwitniewski added the comment: It works as intended - pool of 5 processes is being reused with new data: - First, 5 processes are created as root, - in first run of check_permission they drop their privileges to user, - when they finish processing check_permission function, they are not killed, but provided with new path for processing, therefore they retain their lower privileges, - when maxtasksperchild=1 is used, processes are killed after single run of check_permission and recreated with root permissions. ---------- nosy: +zerg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 05:57:38 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 09 Apr 2021 09:57:38 +0000 Subject: [issue43786] slice(None) is slice(None) is False In-Reply-To: <1617958099.53.0.277889313543.issue43786@roundup.psfhosted.org> Message-ID: <1617962258.69.0.0955993464129.issue43786@roundup.psfhosted.org> Steven D'Aprano added the comment: The behaviour of `is` is correct. The `is` operator tests for object identity, not equality. The reason that `slice(None) is slice(None)` returns False is that the two calls to the slice function return two different objects. You say that using the equals operator `==` "doesn't return a single Boolean if a is a NumPy array", that is a design flaw in numpy, and there is nothing we can do about it. You could try something like this: def equal(a, b): flag = (a == b) if isinstance(flag, bool): return flag else: return all(flag) ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 06:02:09 2021 From: report at bugs.python.org (=?utf-8?q?Nico_Schl=C3=B6mer?=) Date: Fri, 09 Apr 2021 10:02:09 +0000 Subject: [issue43786] slice(None) is slice(None) is False In-Reply-To: <1617958099.53.0.277889313543.issue43786@roundup.psfhosted.org> Message-ID: <1617962529.6.0.960281637547.issue43786@roundup.psfhosted.org> Nico Schl?mer added the comment: Thanks very much, Steven, for the feedback and the suggestion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 06:04:48 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 10:04:48 +0000 Subject: [issue43788] Make ssl_data.h version specific Message-ID: <1617962688.47.0.0760026042397.issue43788@roundup.psfhosted.org> New submission from Christian Heimes : _ssl_data.h contains static tables with OpenSSL error names and reasons. The stables are created by scrapping header files. The current approach has two issues: - error codes are version dependent. OpenSSL 1.1.1 uses different codes and has a different set of error reasons as 3.0.0. - parsing header files with regular expressions is err-prone. I'm going to introduce version-specific data tables and re-write the current make_ssl_data.py script to use OpenSSL's crypto/err/openssl.txt and crypto/err/openssl.ec. The text files exist since OpenSSL 1.1. ---------- assignee: christian.heimes components: SSL messages: 390603 nosy: christian.heimes priority: normal severity: normal status: open title: Make ssl_data.h version specific type: enhancement versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 06:12:02 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 10:12:02 +0000 Subject: [issue43788] Make ssl_data.h version specific In-Reply-To: <1617962688.47.0.0760026042397.issue43788@roundup.psfhosted.org> Message-ID: <1617963122.65.0.557549946847.issue43788@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +24032 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25300 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 06:21:20 2021 From: report at bugs.python.org (Ma Lin) Date: Fri, 09 Apr 2021 10:21:20 +0000 Subject: [issue43785] Remove RLock from BZ2File In-Reply-To: <1617946936.07.0.338866506245.issue43785@roundup.psfhosted.org> Message-ID: <1617963680.41.0.136390488201.issue43785@roundup.psfhosted.org> Ma Lin added the comment: This change is backwards incompatible, it may break some code silently. If someone really needs better performance, they can write a BZ2File class without RLock by themselves, it should be easy. FYI, zlib module was added in 1997, bz2 module was added in 2002, lzma module was added in 2011. (Just curious for these years) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 06:37:00 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 10:37:00 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1617964620.66.0.610451899216.issue43774@roundup.psfhosted.org> miss-islington added the comment: New changeset f7be26a8f2ed588df90959ae7c0fdcafe2091f76 by Victor Stinner in branch 'master': bpo-43774: Doc job of Azure Pipelines uses Doc/requirements.txt (GH-25296) https://github.com/python/cpython/commit/f7be26a8f2ed588df90959ae7c0fdcafe2091f76 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 06:46:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Apr 2021 10:46:07 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1617965167.94.0.053742585578.issue43774@roundup.psfhosted.org> STINNER Victor added the comment: Raymond: > Thanks for adding this. You're welcome :-) I plan to send an email to python-dev to ask for reviews. I hesitated to ask for a review on the PR, but honestly, it's painful to read plain text Sphinx. I prefer to read HTML ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 07:54:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Apr 2021 11:54:29 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1617969269.5.0.856568379934.issue43774@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24033 pull_request: https://github.com/python/cpython/pull/25302 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 08:01:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Apr 2021 12:01:20 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1617969680.68.0.403729743147.issue41486@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 08:02:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Apr 2021 12:02:37 +0000 Subject: [issue43682] Make static methods created by @staticmethod callable In-Reply-To: <1617201081.91.0.895015962683.issue43682@roundup.psfhosted.org> Message-ID: <1617969757.78.0.473185907699.issue43682@roundup.psfhosted.org> STINNER Victor added the comment: Serhiy: > I concur with Mark Shannon. The root problem is that Python functions and built-in functions have different behavior when assigned as class attribute. The former became an instance method, but the latter is not. Do you see a way to make C functions and Python functions behave the same? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 08:02:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Apr 2021 12:02:51 +0000 Subject: [issue43745] ssl.OPENSSL_VERSION still reporting 1.1.1i on windows 3.8.9/3.9.4 In-Reply-To: <1617704638.47.0.609458231691.issue43745@roundup.psfhosted.org> Message-ID: <1617969771.58.0.0710941899822.issue43745@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 08:06:06 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 12:06:06 +0000 Subject: [issue43789] OpenSSL 3.0.0: password callback called multiple times Message-ID: <1617969966.42.0.0501200395584.issue43789@roundup.psfhosted.org> New submission from Christian Heimes : OpenSSL 3.0.0 seems to invoke the password callback multiple times under some circumstances. This triggers a fatal error in Python when the first invocation sets an exception. test_load_cert_chain (test.test_ssl.ContextTests) ... Fatal Python error: _PyEval_EvalFrameDefault: a function returned a result with an exception set Python runtime state: initialized ValueError: password cannot be longer than 1023 bytes Current thread 0x00007fa88787f740 (most recent call first): File "/home/heimes/dev/python/cpython/Lib/test/test_ssl.py", line 1395 in getpass_huge File "/home/heimes/dev/python/cpython/Lib/test/test_ssl.py", line 1415 in test_load_cert_chain File "/home/heimes/dev/python/cpython/Lib/unittest/case.py", line 549 in _callTestMethod File "/home/heimes/dev/python/cpython/Lib/unittest/case.py", line 592 in run File "/home/heimes/dev/python/cpython/Lib/unittest/case.py", line 652 in __call__ File "/home/heimes/dev/python/cpython/Lib/unittest/suite.py", line 122 in run File "/home/heimes/dev/python/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/home/heimes/dev/python/cpython/Lib/unittest/suite.py", line 122 in run File "/home/heimes/dev/python/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/home/heimes/dev/python/cpython/Lib/unittest/runner.py", line 176 in run File "/home/heimes/dev/python/cpython/Lib/test/support/__init__.py", line 959 in _run_suite File "/home/heimes/dev/python/cpython/Lib/test/support/__init__.py", line 1082 in run_unittest File "/home/heimes/dev/python/cpython/Lib/test/test_ssl.py", line 4836 in test_main File "/home/heimes/dev/python/cpython/Lib/test/libregrtest/runtest.py", line 246 in _runtest_inner2 File "/home/heimes/dev/python/cpython/Lib/test/libregrtest/runtest.py", line 282 in _runtest_inner File "/home/heimes/dev/python/cpython/Lib/test/libregrtest/runtest.py", line 154 in _runtest File "/home/heimes/dev/python/cpython/Lib/test/libregrtest/runtest.py", line 194 in runtest File "/home/heimes/dev/python/cpython/Lib/test/libregrtest/main.py", line 321 in rerun_failed_tests File "/home/heimes/dev/python/cpython/Lib/test/libregrtest/main.py", line 698 in _main File "/home/heimes/dev/python/cpython/Lib/test/libregrtest/main.py", line 641 in main File "/home/heimes/dev/python/cpython/Lib/test/libregrtest/main.py", line 719 in main File "/home/heimes/dev/python/cpython/Lib/test/__main__.py", line 2 in File "/home/heimes/dev/python/cpython/Lib/runpy.py", line 86 in _run_code File "/home/heimes/dev/python/cpython/Lib/runpy.py", line 196 in _run_module_as_main Extension modules: _testcapi (total: 1) (gdb) bt #0 0x00007ffff7c5d9d5 in raise () from /lib64/libc.so.6 #1 0x00007ffff7c468a4 in abort () from /lib64/libc.so.6 #2 0x000000000051bb53 in fatal_error_exit (status=) at Python/pylifecycle.c:2522 #3 0x000000000051f97e in fatal_error (fd=2, header=header at entry=1, prefix=prefix at entry=0x6c2f60 <__func__.47> "_PyEval_EvalFrameDefault", msg=msg at entry=0x670aa8 "a function returned a result with an exception set", status=status at entry=-1) at Python/pylifecycle.c:2703 #4 0x000000000051f9df in _Py_FatalErrorFunc (func=func at entry=0x6c2f60 <__func__.47> "_PyEval_EvalFrameDefault", msg=msg at entry=0x670aa8 "a function returned a result with an exception set") at Python/pylifecycle.c:2719 #5 0x00000000004d930c in _PyEval_EvalFrameDefault (tstate=0x807060, f=Frame 0x7fffe950e5b0, for file /home/heimes/dev/python/cpython/Lib/test/test_ssl.py, line 1395, in getpass_huge (), throwflag=0) at Python/ceval.c:1733 #6 0x00000000004e640f in _PyEval_EvalFrame (throwflag=0, f=Frame 0x7fffe950e5b0, for file /home/heimes/dev/python/cpython/Lib/test/test_ssl.py, line 1395, in getpass_huge (), tstate=0x807060) at ./Include/internal/pycore_ceval.h:46 #7 _PyEval_Vector (tstate=0x807060, con=0x7fffe9377c30, locals=locals at entry=0x0, args=, argcount=, kwnames=) at Python/ceval.c:5109 #8 0x000000000042bf08 in _PyFunction_Vectorcall (func=, stack=, nargsf=, kwnames=) at Objects/call.c:342 #9 0x00007fffe9cf502c in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=0, args=0x0, callable=, tstate=0x807060) at ./Include/cpython/abstract.h:114 #10 _PyObject_CallNoArg (func=) at ./Include/cpython/abstract.h:168 #11 _password_callback (buf=0x7fffffff80c0 "p", size=1023, rwflag=, userdata=0x7fffffff9820) at /home/heimes/dev/python/cpython/Modules/_ssl.c:3935 #12 0x00007fffe9a3bcd2 in ui_read (ui=0xc22d70, uis=0xba6190) at crypto/ui/ui_util.c:111 #13 0x00007fffe9a3a4e0 in UI_process (ui=0xc22d70) at crypto/ui/ui_lib.c:516 #14 0x00007fffe99a3d49 in do_ui_passphrase (pass=0x7fffffff87b0 "", pass_size=1024, pass_len=0x7fffffff8bb8, prompt_info=0x0, verify=0, ui_method=0xc20050, ui_data=0x7fffffff9820) at crypto/passphrase.c:173 #15 0x00007fffe99a4143 in ossl_pw_get_passphrase (pass=0x7fffffff87b0 "", pass_size=1024, pass_len=0x7fffffff8bb8, params=0x0, verify=0, data=0xc21cc8) at crypto/passphrase.c:269 #16 0x00007fffe99a43ca in ossl_pw_passphrase_callback_dec (pass=0x7fffffff87b0 "", pass_size=1024, pass_len=0x7fffffff8bb8, params=0x0, arg=0xc21cc8) at crypto/passphrase.c:324 #17 0x00007fffe99a3f8a in ossl_pw_get_passphrase (pass=0x7fffffff87b0 "", pass_size=1024, pass_len=0x7fffffff8bb8, params=0x0, verify=0, data=0xc0d0c8) at crypto/passphrase.c:231 #18 0x00007fffe99a43ca in ossl_pw_passphrase_callback_dec (pass=0x7fffffff87b0 "", pass_size=1024, pass_len=0x7fffffff8bb8, params=0x0, arg=0xc0d0c8) at crypto/passphrase.c:324 #19 0x00007fffe9a9d5ca in der2key_decode_p8 (input_der=0x7fffffff8d50, input_der_len=1905, ctx=0xbb2c40, pw_cb=0x7fffe99a4389 , pw_cbarg=0xc0d0c8, key_from_pkcs8=0x7fffe99e8653 ) at providers/implementations/encode_decode/decode_der2key.c:150 #20 0x00007fffe9a9e432 in rsa_d2i_PKCS8 (key=0x0, der=0x7fffffff8d50, der_len=1905, ctx=0xbb2c40, pw_cb=0x7fffe99a4389 , pw_cbarg=0xc0d0c8) at providers/implementations/encode_decode/decode_der2key.c:580 #21 0x00007fffe9a9da9d in der2key_decode (vctx=0xbb2c40, cin=0xc4d0d0, selection=135, data_cb=0x7fffe9931e91 , data_cbarg=0x7fffffff8de0, pw_cb=0x7fffe99a4389 , pw_cbarg=0xc0d0c8) at providers/implementations/encode_decode/decode_der2key.c:295 #22 0x00007fffe993240b in decoder_process (params=0x0, arg=0x7fffffff8f00) at crypto/encode_decode/decoder_lib.c:750 #23 0x00007fffe9930f03 in OSSL_DECODER_from_bio (ctx=0xc0d090, in=0xc09700) at crypto/encode_decode/decoder_lib.c:58 #24 0x00007fffe99310b6 in OSSL_DECODER_from_data (ctx=0xc0d090, pdata=0x7fffffff8fc0, pdata_len=0x7fffffff8fb8) at crypto/encode_decode/decoder_lib.c:108 #25 0x00007fffe9a2fc77 in try_key_value (data=0x7fffffff9060, ctx=0xc21c80, cb=0x7fffe99a4389 , cbarg=0xc21cc8, libctx=0x7fffe9c1f880 , propq=0x0) at crypto/store/store_result.c:288 #26 0x00007fffe9a301cc in try_key (data=0x7fffffff9060, v=0x7fffffff96c0, ctx=0xc21c80, provider=0x97f7d0, libctx=0x7fffe9c1f880 , propq=0x0) at crypto/store/store_result.c:407 #27 0x00007fffe9a2f6e6 in ossl_store_handle_load_result (params=0x7fffffff92f0, arg=0x7fffffff96c0) at crypto/store/store_result.c:152 #28 0x00007fffe9ac4638 in file_load_construct (decoder_inst=0x88b0a0, params=0x7fffffff92f0, construct_data=0x7fffffff9640) at providers/implementations/storemgmt/file_store.c:402 #29 0x00007fffe9931fd6 in decoder_process (params=0x7fffffff92f0, arg=0x7fffffff94b0) at crypto/encode_decode/decoder_lib.c:566 #30 0x00007fffe9aa03a8 in pem2der_decode (vctx=0xbb6ef0, cin=0xc04d70, selection=0, data_cb=0x7fffe9931e91 , data_cbarg=0x7fffffff94b0, pw_cb=0x7fffe99a4389 , pw_cbarg=0xbc14f8) at providers/implementations/encode_decode/decode_pem2der.c:243 #31 0x00007fffe993240b in decoder_process (params=0x0, arg=0x7fffffff95d0) at crypto/encode_decode/decoder_lib.c:750 #32 0x00007fffe9930f03 in OSSL_DECODER_from_bio (ctx=0xbc14c0, in=0xc28ab0) at crypto/encode_decode/decoder_lib.c:58 #33 0x00007fffe9ac49db in file_load_file (ctx=0xc282b0, object_cb=0x7fffe9a2f3c2 , object_cbarg=0x7fffffff96c0, pw_cb=0x7fffe99a4389 , pw_cbarg=0xc21cc8) at providers/implementations/storemgmt/file_store.c:522 --Type for more, q to quit, c to continue without paging-- #34 0x00007fffe9ac4f6f in file_load (loaderctx=0xc282b0, object_cb=0x7fffe9a2f3c2 , object_cbarg=0x7fffffff96c0, pw_cb=0x7fffe99a4389 , pw_cbarg=0xc21cc8) at providers/implementations/storemgmt/file_store.c:682 #35 0x00007fffe9a2c3ff in OSSL_STORE_load (ctx=0xc21c80) at crypto/store/store_lib.c:386 #36 0x00007fffe99c48d0 in pem_read_bio_key (bp=0xbb6050, x=0x0, cb=0x7fffe9cf4f99 <_password_callback>, u=0x7fffffff9820, libctx=0x0, propq=0x0, expected_store_info_type=4, try_secure=1) at crypto/pem/pem_pkey.c:74 #37 0x00007fffe99c4b12 in PEM_read_bio_PrivateKey_ex (bp=0xbb6050, x=0x0, cb=0x7fffe9cf4f99 <_password_callback>, u=0x7fffffff9820, libctx=0x0, propq=0x0) at crypto/pem/pem_pkey.c:144 #38 0x00007fffe9c653e7 in SSL_CTX_use_PrivateKey_file (ctx=0xc28350, file=0x7fffea13a060 "/home/heimes/dev/python/cpython/Lib/test/keycert.passwd.pem", type=1) at ssl/ssl_rsa.c:372 #39 0x00007fffe9cf82ce in _ssl__SSLContext_load_cert_chain_impl (self=self at entry=0x7fffe94c9be0, certfile='/home/heimes/dev/python/cpython/Lib/test/keycert.passwd.pem', keyfile=0x0, password=) at /home/heimes/dev/python/cpython/Modules/_ssl.c:4032 ---------- assignee: christian.heimes components: SSL messages: 390608 nosy: christian.heimes priority: normal severity: normal status: open title: OpenSSL 3.0.0: password callback called multiple times type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 08:08:31 2021 From: report at bugs.python.org (Bob Kline) Date: Fri, 09 Apr 2021 12:08:31 +0000 Subject: [issue43777] Remove description of "pip search" command from tutorial In-Reply-To: <1617913394.59.0.105021549467.issue43777@roundup.psfhosted.org> Message-ID: <1617970111.65.0.146703517727.issue43777@roundup.psfhosted.org> Bob Kline added the comment: Thanks for the clarification. I submitted a PR, but I'm unable to remove the "CLA not signed" tag from it (even though I have signed the CLA) and form at https://check-python-cla.herokuapp.com/ ("You can check yourself to see if the CLA has been received.") blows up with a 500 ("Server got itself in trouble"). Submitting patches for the Python documentation never used to be this hard. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 08:11:31 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 12:11:31 +0000 Subject: [issue43789] OpenSSL 3.0.0: password callback called multiple times In-Reply-To: <1617969966.42.0.0501200395584.issue43789@roundup.psfhosted.org> Message-ID: <1617970291.2.0.807035452648.issue43789@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +24035 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 08:35:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Apr 2021 12:35:19 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1617971719.55.0.407279130731.issue43774@roundup.psfhosted.org> STINNER Victor added the comment: New changeset bd88ccb943c0ea672c14a87e76157fade4feae11 by Victor Stinner in branch 'master': bpo-43774: Document the Python Build System (GH-25302) https://github.com/python/cpython/commit/bd88ccb943c0ea672c14a87e76157fade4feae11 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 08:47:49 2021 From: report at bugs.python.org (Bob Kline) Date: Fri, 09 Apr 2021 12:47:49 +0000 Subject: [issue43790] CLA check fails with a 500 error Message-ID: <1617972469.44.0.813759160932.issue43790@roundup.psfhosted.org> New submission from Bob Kline : The tool to check whether the CLA has been received fails with a 500 error. Steps to reproduce: 1. Add your GitHub name to your b.p.o. record. 2. Navigate to https://check-python-cla.herokuapp.com/ 3. Enter your GitHub name and press the "Check" button 4. "500 Internal server error / Server got itself in trouble" ---------- components: Demos and Tools messages: 390612 nosy: bkline priority: normal severity: normal status: open title: CLA check fails with a 500 error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 08:48:01 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 09 Apr 2021 12:48:01 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617972481.4.0.395410270934.issue43753@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: I'd also prefer a Py_IsNotNone() because it's more explicit than !Py_IsNone(); the exclamation mark can be easily missed when reading/writing code, IMO. Just my 2 cents. ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 08:50:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Apr 2021 12:50:46 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617972646.79.0.421010323007.issue43753@roundup.psfhosted.org> STINNER Victor added the comment: > I'd also prefer a Py_IsNotNone() because it's more explicit than !Py_IsNone() I would prefer keep the C API small. I don't think that we need to duplicate all functions testing for something. We provide PyTuple_Check(obj) but we don't provide PyTuple_NotCheck(obj) for example. IMO !Py_IsNone(obj) makes perfectly sense in Python. Also, "x == Py_None" is more common than "x != Py_None". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 08:50:49 2021 From: report at bugs.python.org (Bob Kline) Date: Fri, 09 Apr 2021 12:50:49 +0000 Subject: [issue43777] Remove description of "pip search" command from tutorial In-Reply-To: <1617913394.59.0.105021549467.issue43777@roundup.psfhosted.org> Message-ID: <1617972649.45.0.200624761627.issue43777@roundup.psfhosted.org> Bob Kline added the comment: I have reported the failure of the CLA check tool. https://bugs.python.org/issue43790 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 08:55:45 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 09 Apr 2021 12:55:45 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617972945.16.0.953579906706.issue43753@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > I would prefer keep the C API small. Yes, I see the value of that as well. I tried applying this API on an extension, and I found the code to be slightly less readable for the "is not" cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:02:35 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 09 Apr 2021 13:02:35 +0000 Subject: [issue37712] Exception frames from unittest.TestCase.fail dependent on nesting In-Reply-To: <1564448224.13.0.206274970387.issue37712@roundup.psfhosted.org> Message-ID: <1617973355.53.0.926208719614.issue37712@roundup.psfhosted.org> Chris Jerdonek added the comment: > I think this is the same as issue37712. This issue was first reported as issue24959. It would be better to close the newer issues as duplicates of the first one, instead of keeping all the duplicates open. Otherwise, the history and discussion gets fragmented across multiple locations. ---------- nosy: +chris.jerdonek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:08:57 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 13:08:57 +0000 Subject: [issue43791] OpenSSL 3.0.0: TLS 1.0 / 1.1 connections fail with TLSV1_ALERT_INTERNAL_ERROR Message-ID: <1617973737.23.0.132771876709.issue43791@roundup.psfhosted.org> New submission from Christian Heimes : With OpenSSL 3.0.0-alpha14 several tests for TLS 1.0 and 1.1 connections are failing handshake with "[SSL: TLSV1_ALERT_INTERNAL_ERROR] tlsv1 alert internal error". OpenSSL is configured with default security level "1". Tests are only passing with @SECLEVEL=0. I think the security default callback refuses NID_sha1 and NID_sha1_md5 SSL_SECOP_SIGALG_SUPPORTED because their security bits are lower than minimum of 80 bits. ssl_security_default_callback (s=0x7fffdc001840, ctx=0x0, op=327691, bits=67, nid=114, other=0x7fffe8ab194a, ex=0x0) at ssl/ssl_cert.c:969 ssl_security_default_callback (s=0x7fffdc001840, ctx=0x0, op=327691, bits=64, nid=64, other=0x7fffe8ab188a, ex=0x0) at ssl/ssl_cert.c:969 #0 tls_choose_sigalg (s=0x7fffdc001840, fatalerrs=1) at ssl/t1_lib.c:3307 #1 0x00007fffe9cb00f4 in tls_post_process_client_hello (s=0x7fffdc001840, wst=WORK_MORE_B) at ssl/statem/statem_srvr.c:2223 #2 0x00007fffe9cad560 in ossl_statem_server_post_process_message (s=0x7fffdc001840, wst=WORK_MORE_A) at ssl/statem/statem_srvr.c:1236 #3 0x00007fffe9c97e3d in read_state_machine (s=0x7fffdc001840) at ssl/statem/statem.c:670 #4 0x00007fffe9c97723 in state_machine (s=0x7fffdc001840, server=1) at ssl/statem/statem.c:442 #5 0x00007fffe9c971db in ossl_statem_accept (s=0x7fffdc001840) at ssl/statem/statem.c:270 #6 0x00007fffe9c5f5ac in SSL_do_handshake (s=0x7fffdc001840) at ssl/ssl_lib.c:3852 if ((lu = tls1_get_legacy_sigalg(s, -1)) == NULL) { if (!fatalerrs) return 1; SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM); return 0; } ---------- assignee: christian.heimes components: SSL messages: 390618 nosy: christian.heimes priority: normal severity: normal status: open title: OpenSSL 3.0.0: TLS 1.0 / 1.1 connections fail with TLSV1_ALERT_INTERNAL_ERROR type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:21:28 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 13:21:28 +0000 Subject: [issue4379] Py_SAFE_DOWNCAST in FILE_TIME_to_time_t_nsec failing In-Reply-To: <1227288006.53.0.353699707167.issue4379@psf.upfronthosting.co.za> Message-ID: <1617974488.87.0.281564849836.issue4379@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: +christian.heimes nosy_count: 5.0 -> 6.0 pull_requests: +24036 pull_request: https://github.com/python/cpython/pull/25304 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:23:46 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 13:23:46 +0000 Subject: [issue43789] OpenSSL 3.0.0: password callback called multiple times In-Reply-To: <1617969966.42.0.0501200395584.issue43789@roundup.psfhosted.org> Message-ID: <1617974626.22.0.262127472742.issue43789@roundup.psfhosted.org> Christian Heimes added the comment: New changeset d3b73f32ef7c693a6ae8c54eb0e62df3b5315caf by Christian Heimes in branch 'master': bpo-43789: OpenSSL 3.0.0 Don't call passwd callback again in error case (GH-25303) https://github.com/python/cpython/commit/d3b73f32ef7c693a6ae8c54eb0e62df3b5315caf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:24:08 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 13:24:08 +0000 Subject: [issue43789] OpenSSL 3.0.0: password callback called multiple times In-Reply-To: <1617969966.42.0.0501200395584.issue43789@roundup.psfhosted.org> Message-ID: <1617974648.25.0.00930047098967.issue43789@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24038 pull_request: https://github.com/python/cpython/pull/25306 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:24:01 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 13:24:01 +0000 Subject: [issue43789] OpenSSL 3.0.0: password callback called multiple times In-Reply-To: <1617969966.42.0.0501200395584.issue43789@roundup.psfhosted.org> Message-ID: <1617974641.22.0.0453407547634.issue43789@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +24037 pull_request: https://github.com/python/cpython/pull/25305 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:26:49 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 09 Apr 2021 13:26:49 +0000 Subject: [issue37712] Exception frames from unittest.TestCase.fail dependent on nesting In-Reply-To: <1564448224.13.0.206274970387.issue37712@roundup.psfhosted.org> Message-ID: <1617974809.16.0.133760407821.issue37712@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> unittest swallows part of stack trace when raising AssertionError in a TestCase _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:28:23 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 13:28:23 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1617974903.95.0.878110847713.issue38820@roundup.psfhosted.org> Change by Christian Heimes : ---------- dependencies: +OpenSSL 3.0.0: TLS 1.0 / 1.1 connections fail with TLSV1_ALERT_INTERNAL_ERROR, OpenSSL 3.0.0: password callback called multiple times versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:31:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 09 Apr 2021 13:31:16 +0000 Subject: [issue24959] unittest swallows part of stack trace when raising AssertionError in a TestCase In-Reply-To: <1440864914.24.0.799928607113.issue24959@psf.upfronthosting.co.za> Message-ID: <1617975076.86.0.308178696629.issue24959@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +24039 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/23688 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:31:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 09 Apr 2021 13:31:56 +0000 Subject: [issue42247] unittest hides traceback frames in chained exceptions In-Reply-To: <1604341559.53.0.224869314437.issue42247@roundup.psfhosted.org> Message-ID: <1617975116.78.0.0139427922632.issue42247@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> unittest swallows part of stack trace when raising AssertionError in a TestCase _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:43:22 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 13:43:22 +0000 Subject: [issue4379] Py_SAFE_DOWNCAST in FILE_TIME_to_time_t_nsec failing In-Reply-To: <1227288006.53.0.353699707167.issue4379@psf.upfronthosting.co.za> Message-ID: <1617975802.83.0.352603949428.issue4379@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 5151d642004c59cce58d669be85d9a5e987f51d3 by Christian Heimes in branch 'master': bpo-4379: Skip TLS 1.0/1.1 tests under OpenSSL 3.0.0 (GH-25304) https://github.com/python/cpython/commit/5151d642004c59cce58d669be85d9a5e987f51d3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:43:19 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 13:43:19 +0000 Subject: [issue4379] Py_SAFE_DOWNCAST in FILE_TIME_to_time_t_nsec failing In-Reply-To: <1227288006.53.0.353699707167.issue4379@psf.upfronthosting.co.za> Message-ID: <1617975799.23.0.324846530428.issue4379@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24040 pull_request: https://github.com/python/cpython/pull/25307 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:43:25 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 13:43:25 +0000 Subject: [issue4379] Py_SAFE_DOWNCAST in FILE_TIME_to_time_t_nsec failing In-Reply-To: <1227288006.53.0.353699707167.issue4379@psf.upfronthosting.co.za> Message-ID: <1617975805.16.0.676975620776.issue4379@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24041 pull_request: https://github.com/python/cpython/pull/25308 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:44:32 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 13:44:32 +0000 Subject: [issue43791] OpenSSL 3.0.0: TLS 1.0 / 1.1 connections fail with TLSV1_ALERT_INTERNAL_ERROR In-Reply-To: <1617973737.23.0.132771876709.issue43791@roundup.psfhosted.org> Message-ID: <1617975872.7.0.568148836297.issue43791@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24043 pull_request: https://github.com/python/cpython/pull/25308 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:44:25 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 13:44:25 +0000 Subject: [issue43791] OpenSSL 3.0.0: TLS 1.0 / 1.1 connections fail with TLSV1_ALERT_INTERNAL_ERROR In-Reply-To: <1617973737.23.0.132771876709.issue43791@roundup.psfhosted.org> Message-ID: <1617975865.84.0.593729671631.issue43791@roundup.psfhosted.org> Change by miss-islington : ---------- keywords: +patch nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +24042 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25307 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:44:33 2021 From: report at bugs.python.org (Dmitry Marakasov) Date: Fri, 09 Apr 2021 13:44:33 +0000 Subject: [issue43792] "bad argument to internal function" in cython Message-ID: <1617975873.6.0.244911999729.issue43792@roundup.psfhosted.org> New submission from Dmitry Marakasov : I'm playing with adding python3.10a7 port to FreeBSD ports collection, and have run into similar problem with building multiple third party modules (for instance, yaml, yarl and pystemmer). Here's log from yaml: running build_ext cythoning yaml/_yaml.pyx to yaml/_yaml.c Traceback (most recent call last): File "", line 1, in File "setup.py", line 271, in setup( File "/usr/local/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup return distutils.core.setup(**attrs) File "/usr/local/lib/python3.10/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/local/lib/python3.10/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/local/lib/python3.10/distutils/dist.py", line 985, in run_command cmd_obj.run() File "setup.py", line 187, in run _build_ext.run(self) File "/usr/local/lib/python3.10/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run _build_ext.build_ext.run(self) File "/usr/local/lib/python3.10/distutils/command/build_ext.py", line 340, in run self.build_extensions() File "setup.py", line 229, in build_extensions ext.sources = self.cython_sources(ext.sources, ext) File "/usr/local/lib/python3.10/site-packages/Cython/Distutils/old_build_ext.py", line 346, in cython_sources result = cython_compile(source, options=options, File "/usr/local/lib/python3.10/site-packages/Cython/Compiler/Main.py", line 778, in compile return compile_single(source, options, full_module_name) File "/usr/local/lib/python3.10/site-packages/Cython/Compiler/Main.py", line 727, in compile_single return run_pipeline(source, options, full_module_name) File "/usr/local/lib/python3.10/site-packages/Cython/Compiler/Main.py", line 479, in run_pipeline context = options.create_context() File "/usr/local/lib/python3.10/site-packages/Cython/Compiler/Main.py", line 596, in create_context return Context(self.include_path, self.compiler_directives, File "/usr/local/lib/python3.10/site-packages/Cython/Compiler/Main.py", line 80, in __init__ from . import Builtin, CythonScope File "/usr/local/lib/python3.10/site-packages/Cython/Compiler/CythonScope.py", line 5, in from .UtilityCode import CythonUtilityCode File "/usr/local/lib/python3.10/site-packages/Cython/Compiler/UtilityCode.py", line 3, in from .TreeFragment import parse_from_strings, StringParseContext File "/usr/local/lib/python3.10/site-packages/Cython/Compiler/TreeFragment.py", line 17, in from .Visitor import VisitorTransform File "Cython/Compiler/Visitor.py", line 17, in init Cython.Compiler.Visitor File "/usr/local/lib/python3.10/site-packages/Cython/Compiler/ExprNodes.py", line 4742, in class SliceIndexNode(ExprNode): File "/usr/local/lib/python3.10/site-packages/Cython/Compiler/ExprNodes.py", line 4939, in SliceIndexNode get_slice_utility_code = TempitaUtilityCode.load( File "/usr/local/lib/python3.10/site-packages/Cython/Compiler/Code.py", line 404, in load return cls(**kwargs) File "/usr/local/lib/python3.10/site-packages/Cython/Compiler/Code.py", line 645, in __init__ proto = sub_tempita(proto, context, file, name) File "/usr/local/lib/python3.10/site-packages/Cython/Compiler/Code.py", line 638, in sub_tempita return sub(s, **context) File "Cython/Tempita/_tempita.py", line 376, in Cython.Tempita._tempita.sub File "Cython/Tempita/_tempita.py", line 137, in Cython.Tempita._tempita.Template.__init__ File "Cython/Tempita/_tempita.py", line 819, in Cython.Tempita._tempita.parse File "Cython/Tempita/_tempita.py", line 661, in Cython.Tempita._tempita.lex SystemError: Python/getargs.c:2038: bad argument to internal function *** Error code 1 ---------- components: Extension Modules, FreeBSD messages: 390621 nosy: AMDmi3, koobs priority: normal severity: normal status: open title: "bad argument to internal function" in cython versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:46:21 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 13:46:21 +0000 Subject: [issue43789] OpenSSL 3.0.0: password callback called multiple times In-Reply-To: <1617969966.42.0.0501200395584.issue43789@roundup.psfhosted.org> Message-ID: <1617975981.28.0.27703164847.issue43789@roundup.psfhosted.org> miss-islington added the comment: New changeset a188bd44ac3c54dc3bf927f1b10464ab80f37549 by Miss Islington (bot) in branch '3.9': bpo-43789: OpenSSL 3.0.0 Don't call passwd callback again in error case (GH-25303) https://github.com/python/cpython/commit/a188bd44ac3c54dc3bf927f1b10464ab80f37549 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:47:20 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 13:47:20 +0000 Subject: [issue43791] OpenSSL 3.0.0: TLS 1.0 / 1.1 connections fail with TLSV1_ALERT_INTERNAL_ERROR In-Reply-To: <1617973737.23.0.132771876709.issue43791@roundup.psfhosted.org> Message-ID: <1617976040.03.0.431267459976.issue43791@roundup.psfhosted.org> Christian Heimes added the comment: https://github.com/python/cpython/pull/25304 is merged PR to master. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:47:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Apr 2021 13:47:43 +0000 Subject: [issue43792] "bad argument to internal function" in cython In-Reply-To: <1617975873.6.0.244911999729.issue43792@roundup.psfhosted.org> Message-ID: <1617976063.46.0.737758536323.issue43792@roundup.psfhosted.org> STINNER Victor added the comment: Sadly, there is Cython release supporting Python 3.10 yet: https://github.com/cython/cython/issues/4046 By the way, I propose two PRs to fix Cython tests on Python 3.10: https://github.com/cython/cython/issues/4100 I suggest you waiting until there a new Cython release supporting Python 3.10. In Fedora, we have downstream patches on Cython, we backported the Python 3.10 fixes: https://src.fedoraproject.org/rpms/Cython/pull-request/28 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:48:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Apr 2021 13:48:11 +0000 Subject: [issue43792] Cython is not compatible with Python 3.10 yet: "SystemError: bad argument to internal function" In-Reply-To: <1617975873.6.0.244911999729.issue43792@roundup.psfhosted.org> Message-ID: <1617976091.92.0.394587571841.issue43792@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: "bad argument to internal function" in cython -> Cython is not compatible with Python 3.10 yet: "SystemError: bad argument to internal function" _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:50:12 2021 From: report at bugs.python.org (brenthuisman) Date: Fri, 09 Apr 2021 13:50:12 +0000 Subject: [issue39125] Type signature of @property not shown in help() In-Reply-To: <1577115600.68.0.0436692507171.issue39125@roundup.psfhosted.org> Message-ID: <1617976212.65.0.27287807168.issue39125@roundup.psfhosted.org> brenthuisman added the comment: Is there any activity on this issue? The way Pybind11 generates accessors for attributes makes (as properties with getter and setter) makes it currently impossible to view the type info, which Pybind does provide. Thanks for any update. ---------- nosy: +brenthuisman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:55:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Apr 2021 13:55:22 +0000 Subject: [issue43793] [C API] Py_NewInterpreter() cannot be called from a thread which has no Python thread state Message-ID: <1617976522.63.0.387381437279.issue43793@roundup.psfhosted.org> New submission from STINNER Victor : Build attached newinter.c C extension. Example: $ gcc -shared newinter.c $(pkg-config python-3.10 --cflags --libs) -o newinter.so -fPIC Trying to load the C extension crashs in various ways. Crashes on a Python debug build: (1) $ PYTHONPATH=$PWD ./python -c 'import newinter' create new thread Modules/gcmodule.c:113: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small Enable tracemalloc to get the memory block allocation traceback object address : 0x7f1a1163c8f0 object refcount : 1 object type : 0x871020 object type name: dict object repr : {} Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed Python runtime state: finalizing (tstate=0x0000000001e0d390) Current thread 0x00007f1a115a0640 (most recent call first): File "", line 241 in _call_with_frames_removed File "", line 855 in exec_module File Exception ignored deletion of interned string failed"", line 688 in _load_unlocked File "", line 1006 in _find_and_load_unlocked File "", line 1027 in _find_and_load File "", line 1207 in _install_external_importers Segmentation fault (core dumped) (2) $ PYTHONPATH=$PWD ./python -c 'import newinter' create new thread Objects/unicodeobject.c:15769: _Py_NegativeRefcount: Assertion failed: object has negative ref count Enable tracemalloc to get the memory block allocation traceback object address : 0x7fe124af08e0 object refcount : -1 object type : 0x8797e0 object type name: str object repr : Debug memory block at address p=0x7fe124af08e0: API 'o' 60 bytes originally requested The 7 pad bytes at p-7 are FORBIDDENBYTE, as expected. The 8 pad bytes at tail=0x7fe124af091c are not all FORBIDDENBYTE (0xfd): at tail+0: 0x72 *** OUCH at tail+1: 0x5f *** OUCH at tail+2: 0x63 *** OUCH at tail+3: 0x61 *** OUCH at tail+4: 0x63 *** OUCH at tail+5: 0x68 *** OUCH at tail+6: 0x65 *** OUCH at tail+7: 0xfd Data at p: ff ff ff ff ff ff ff ff ... 61 6b 72 65 66 5f 5f 65 Enable tracemalloc to get the memory block allocation traceback Fatal Python error: _PyMem_DebugRawFree: bad trailing pad byte Python runtime state: finalizing (tstate=0x0000000001564390) Current thread 0x00007fe1321ff740 (most recent call first): Extension modules: newinter (total: 1) Aborted (core dumped) (3) $ PYTHONPATH=$PWD ./python -c 'import newinter' create new thread Exception ignored deletion of interned string failedFatal Python error: _PyInterpreterState_GET: the function must be called with the GIL held, but the GIL is released (the current Python thread state is NULL) Python runtime state: finalizing (tstate=0x0000000000c51390) Current thread 0x00007f329308a640 (most recent call first): File "", line 241 in _call_with_frames_removed File "", line 855 in exec_module File "", line 688 in _load_unlocked File "", line 1006 in _find_and_load_unlocked File "", line 1027 in _find_and_load File "", line 1207 in _install_external_importers Aborted (core dumped) (4) $ PYTHONPATH=$PWD ./python -c 'import newinter' create new thread Fatal Python error: _Py_CheckSlotResult: Slot __setitem__ of type dict succeeded with an exception set Python runtime state: finalizing (tstate=0x0000000000f0e390) Thread 0xTraceback (most recent call last): 00007fb4a331b640 (most recent call first): Aborted (core dumped) ---------- components: C API files: newinter.c messages: 390626 nosy: vstinner priority: normal severity: normal status: open title: [C API] Py_NewInterpreter() cannot be called from a thread which has no Python thread state versions: Python 3.10 Added file: https://bugs.python.org/file49950/newinter.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:57:42 2021 From: report at bugs.python.org (conchylicultor) Date: Fri, 09 Apr 2021 13:57:42 +0000 Subject: [issue43746] Weird typing annotation closure behavior In-Reply-To: <1617705463.18.0.247710543326.issue43746@roundup.psfhosted.org> Message-ID: <1617976662.23.0.149884539152.issue43746@roundup.psfhosted.org> conchylicultor added the comment: Yes, I know I can rename the closure, or wrap the annotation in 'quote'. I just wanted to point this out as it felt confusing to me. For instance, it feels inconsistent with: ``` def fn(datetime: datetime.Time): # Works as expected ``` Or: ``` @dataclass class A: datetime: datetime.Time = field(default_factory=datetime.Time.now) ``` The `datetime.Time.now` and the `datetime.Time` of the same statement refer to different objects. This might be the expected behavior, but this is confusing nonetheless. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 09:59:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Apr 2021 13:59:56 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1617976796.54.0.692329409593.issue43753@roundup.psfhosted.org> STINNER Victor added the comment: > I tried applying this API on an extension, and I found the code to be slightly less readable for the "is not" cases. FYI you can try upgrade_pythoncapi.py on your project using the following PR to update code to use Py_IsNone/Py_IsTrue/Py_IsFalse: https://github.com/pythoncapi/pythoncapi_compat/pull/8 For example, use "upgrade_pythoncapi.py -o Py_Is directory/" or "upgrade_pythoncapi.py -o Py_Is file.c". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 10:02:12 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 14:02:12 +0000 Subject: [issue43791] OpenSSL 3.0.0: TLS 1.0 / 1.1 connections fail with TLSV1_ALERT_INTERNAL_ERROR In-Reply-To: <1617973737.23.0.132771876709.issue43791@roundup.psfhosted.org> Message-ID: <1617976932.96.0.974714294307.issue43791@roundup.psfhosted.org> miss-islington added the comment: New changeset 4e710d1c88cbebdb17578de00997457b3b26874d by Miss Islington (bot) in branch '3.8': [3.8] bpo-43791: Skip TLS 1.0/1.1 tests under OpenSSL 3.0.0 (GH-25304) (GH-25308) https://github.com/python/cpython/commit/4e710d1c88cbebdb17578de00997457b3b26874d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 10:07:08 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 09 Apr 2021 14:07:08 +0000 Subject: [issue43783] Make ParamSpec.args/kwargs more useful objects In-Reply-To: <1617933966.5.0.0238313977797.issue43783@roundup.psfhosted.org> Message-ID: <1617977228.01.0.90932284672.issue43783@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 10:08:39 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 14:08:39 +0000 Subject: [issue4379] Py_SAFE_DOWNCAST in FILE_TIME_to_time_t_nsec failing In-Reply-To: <1227288006.53.0.353699707167.issue4379@psf.upfronthosting.co.za> Message-ID: <1617977319.99.0.562085105869.issue4379@roundup.psfhosted.org> miss-islington added the comment: New changeset 4a5c101936900d11d723b59508464f73e4ab3a36 by Miss Islington (bot) in branch '3.9': bpo-4379: Skip TLS 1.0/1.1 tests under OpenSSL 3.0.0 (GH-25304) https://github.com/python/cpython/commit/4a5c101936900d11d723b59508464f73e4ab3a36 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 10:09:13 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 09 Apr 2021 14:09:13 +0000 Subject: [issue43746] Weird typing annotation closure behavior In-Reply-To: <1617705463.18.0.247710543326.issue43746@roundup.psfhosted.org> Message-ID: <1617977353.49.0.0583471802939.issue43746@roundup.psfhosted.org> Guido van Rossum added the comment: Just Don't Do This. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 10:13:11 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 14:13:11 +0000 Subject: [issue43794] OpenSSL 3.0.0: Handle UNEXPECTED_EOF_WHILE_READING / wrap SSL_OP_IGNORE_UNEXPECTED_EOF Message-ID: <1617977591.38.0.697961461689.issue43794@roundup.psfhosted.org> New submission from Christian Heimes : OpenSSL 3.0.0 state machine handles unexpected EOFs more strict and requires peers to properly shut down connections. The old OpenSSL 1.1.1 behavior can be get back with SSL_OP_IGNORE_UNEXPECTED_EOF. I propose to add the option by default until Python's ssl module has better ways to perform one-way shutdown of connections. https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_options.html > Some TLS implementations do not send the mandatory close_notify alert on shutdown. If the application tries to wait for the close_notify alert but the peer closes the connection without sending it, an error is generated. When this option is enabled the peer does not need to send the close_notify alert and a closed connection will be treated as if the close_notify alert was received. > You should only enable this option if the protocol running over TLS can detect a truncation attack itself, and that the application is checking for that truncation attack. ---------- assignee: christian.heimes components: SSL messages: 390632 nosy: christian.heimes priority: normal severity: normal status: open title: OpenSSL 3.0.0: Handle UNEXPECTED_EOF_WHILE_READING / wrap SSL_OP_IGNORE_UNEXPECTED_EOF type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 10:40:32 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 09 Apr 2021 14:40:32 +0000 Subject: [issue43772] Minor repr error in typing.TypeVar.__ror__() In-Reply-To: <1617880169.66.0.0347480943951.issue43772@roundup.psfhosted.org> Message-ID: <1617979232.72.0.00323420781455.issue43772@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 10:44:56 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 14:44:56 +0000 Subject: [issue43794] OpenSSL 3.0.0: Handle UNEXPECTED_EOF_WHILE_READING / wrap SSL_OP_IGNORE_UNEXPECTED_EOF In-Reply-To: <1617977591.38.0.697961461689.issue43794@roundup.psfhosted.org> Message-ID: <1617979496.31.0.0823606853957.issue43794@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +24044 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25309 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 10:51:33 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 14:51:33 +0000 Subject: [issue43789] OpenSSL 3.0.0: password callback called multiple times In-Reply-To: <1617969966.42.0.0501200395584.issue43789@roundup.psfhosted.org> Message-ID: <1617979893.19.0.282034786904.issue43789@roundup.psfhosted.org> Christian Heimes added the comment: New changeset a28398e9c60848fc291c83dac44e5212694fb0b2 by Miss Islington (bot) in branch '3.8': [3.8] bpo-43789: OpenSSL 3.0.0 Don't call passwd callback again in error case (GH-25303) (GH-25306) https://github.com/python/cpython/commit/a28398e9c60848fc291c83dac44e5212694fb0b2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 10:56:32 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 14:56:32 +0000 Subject: [issue43789] OpenSSL 3.0.0: password callback called multiple times In-Reply-To: <1617969966.42.0.0501200395584.issue43789@roundup.psfhosted.org> Message-ID: <1617980192.33.0.564118962685.issue43789@roundup.psfhosted.org> Christian Heimes added the comment: I'm keeping the bug open as a reminder to investigate the change of behavior more carefully. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 10:57:01 2021 From: report at bugs.python.org (Faidon Liambotis) Date: Fri, 09 Apr 2021 14:57:01 +0000 Subject: [issue40485] Provide an abstraction for a select-able Event In-Reply-To: <1588520007.12.0.424273214975.issue40485@roundup.psfhosted.org> Message-ID: <1617980221.33.0.0208013127535.issue40485@roundup.psfhosted.org> Faidon Liambotis added the comment: Thanks so much for all the work on os.eventfd(), it's exciting to see it come to fruition. An eventfd variant of Event (compatible with the threading & multiprocessing APIs) is now as simple as: class Event: _ONE = (1).to_bytes(8, byteorder=sys.byteorder) def __init__(self): self._event_fd = os.eventfd(0, os.EFD_NONBLOCK) self._selector = selectors.DefaultSelector() self._selector.register(self._event_fd, selectors.EVENT_READ) def is_set(self): return self.wait(timeout=0) def set(self): try: os.write(self._event_fd, self._ONE) except BlockingIOError: pass def clear(self): try: os.read(self._event_fd, 8) except BlockingIOError: pass def wait(self, timeout=None): return bool(self._selector.select(timeout=timeout)) def fileno(self): return self._event_fd Given this now has a fileno() method, it is now possible to wait for the event as part of a broader selector, among other events (e.g. a file or socket becoming available to read or write). I don't know where (or how) such a variant would fit into stdlib. It's simpler and more lightweight (less fds) than both threading's and multiprocessing's, and could be used from both threads and processes. I'd love some guidance here. (If a maintainer or anyone else reading this wants to use the above code in a PR, feel free -- no copyright claimed or expected for this trivial piece of code above) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 11:02:11 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 15:02:11 +0000 Subject: [issue43788] Make ssl_data.h version specific In-Reply-To: <1617962688.47.0.0760026042397.issue43788@roundup.psfhosted.org> Message-ID: <1617980531.22.0.750587072017.issue43788@roundup.psfhosted.org> miss-islington added the comment: New changeset 150af7543214e1541fa582374502ac1cd70e8eb4 by Christian Heimes in branch 'master': bpo-43788: Generate version specific _ssl_data.h (GH-25300) https://github.com/python/cpython/commit/150af7543214e1541fa582374502ac1cd70e8eb4 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 11:13:33 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 15:13:33 +0000 Subject: [issue43788] Make ssl_data.h version specific In-Reply-To: <1617962688.47.0.0760026042397.issue43788@roundup.psfhosted.org> Message-ID: <1617981213.27.0.806724618868.issue43788@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24045 pull_request: https://github.com/python/cpython/pull/25310 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 11:14:00 2021 From: report at bugs.python.org (Shane Harvey) Date: Fri, 09 Apr 2021 15:14:00 +0000 Subject: [issue43626] SIGSEV in PyErr_SetObject In-Reply-To: <1616699811.01.0.0992968553141.issue43626@roundup.psfhosted.org> Message-ID: <1617981240.93.0.61195778495.issue43626@roundup.psfhosted.org> Shane Harvey added the comment: This issue was resolved in https://jira.mongodb.org/browse/PYTHON-2621 The cause of the segfault was determined to be gevent 1.3.4 (2018) and/or greenlet 0.4.13 (2018). When the reporter upgraded to gevent==21.1.2 and greenlet==1.0 the segfault went away. ---------- nosy: +ShaneHarvey _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 11:15:30 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 15:15:30 +0000 Subject: [issue43788] Make ssl_data.h version specific In-Reply-To: <1617962688.47.0.0760026042397.issue43788@roundup.psfhosted.org> Message-ID: <1617981330.98.0.314249710051.issue43788@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24046 pull_request: https://github.com/python/cpython/pull/25311 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 11:16:12 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 15:16:12 +0000 Subject: [issue43788] OpenSSL 3.0.0: Make ssl_data.h version specific In-Reply-To: <1617962688.47.0.0760026042397.issue43788@roundup.psfhosted.org> Message-ID: <1617981372.86.0.590805762767.issue43788@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: Make ssl_data.h version specific -> OpenSSL 3.0.0: Make ssl_data.h version specific _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 11:19:17 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 15:19:17 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1617981557.76.0.805293616154.issue38820@roundup.psfhosted.org> Change by Christian Heimes : ---------- dependencies: +OpenSSL 3.0.0: Handle UNEXPECTED_EOF_WHILE_READING / wrap SSL_OP_IGNORE_UNEXPECTED_EOF, OpenSSL 3.0.0: Make ssl_data.h version specific _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 11:43:50 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 09 Apr 2021 15:43:50 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI Message-ID: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> New submission from Petr Viktorin : This issue tracks implementation of PEP 652. CPython's Limited C-API and Stable ABI, introduced in PEP 384, will be formalized in a single definitive file, tested, and documented. ---------- messages: 390638 nosy: petr.viktorin priority: normal severity: normal status: open title: Implement PEP 652 -- Maintaining the Stable ABI versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 11:47:40 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 09 Apr 2021 15:47:40 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1617983260.26.0.523373011971.issue43795@roundup.psfhosted.org> Change by Petr Viktorin : ---------- keywords: +patch pull_requests: +24047 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25312 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 11:51:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Apr 2021 15:51:29 +0000 Subject: [issue43682] Make static methods created by @staticmethod callable In-Reply-To: <1617201081.91.0.895015962683.issue43682@roundup.psfhosted.org> Message-ID: <1617983489.16.0.405754690977.issue43682@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 507a574de31a1bd7fed8ba4f04afa285d985109b by Victor Stinner in branch 'master': bpo-43682: @staticmethod inherits attributes (GH-25268) https://github.com/python/cpython/commit/507a574de31a1bd7fed8ba4f04afa285d985109b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 11:59:31 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 15:59:31 +0000 Subject: [issue43794] OpenSSL 3.0.0: Handle UNEXPECTED_EOF_WHILE_READING / wrap SSL_OP_IGNORE_UNEXPECTED_EOF In-Reply-To: <1617977591.38.0.697961461689.issue43794@roundup.psfhosted.org> Message-ID: <1617983971.73.0.010648926162.issue43794@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +24048 pull_request: https://github.com/python/cpython/pull/25313 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 11:59:36 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 15:59:36 +0000 Subject: [issue43794] OpenSSL 3.0.0: Handle UNEXPECTED_EOF_WHILE_READING / wrap SSL_OP_IGNORE_UNEXPECTED_EOF In-Reply-To: <1617977591.38.0.697961461689.issue43794@roundup.psfhosted.org> Message-ID: <1617983976.62.0.816195891638.issue43794@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 6f37ebc61e9e0d13bcb1a2ddb7fc9723c04b6372 by Christian Heimes in branch 'master': bpo-43794: OpenSSL 3.0.0: set OP_IGNORE_UNEXPECTED_EOF by default (GH-25309) https://github.com/python/cpython/commit/6f37ebc61e9e0d13bcb1a2ddb7fc9723c04b6372 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 11:59:39 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 15:59:39 +0000 Subject: [issue43794] OpenSSL 3.0.0: Handle UNEXPECTED_EOF_WHILE_READING / wrap SSL_OP_IGNORE_UNEXPECTED_EOF In-Reply-To: <1617977591.38.0.697961461689.issue43794@roundup.psfhosted.org> Message-ID: <1617983979.02.0.965040967891.issue43794@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24049 pull_request: https://github.com/python/cpython/pull/25314 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 12:11:06 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 09 Apr 2021 16:11:06 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1617984666.0.0.143462218579.issue43795@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +24050 pull_request: https://github.com/python/cpython/pull/25315 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 12:13:54 2021 From: report at bugs.python.org (Samuel Thibault) Date: Fri, 09 Apr 2021 16:13:54 +0000 Subject: [issue43793] [C API] Py_NewInterpreter() cannot be called from a thread which has no Python thread state In-Reply-To: <1617976522.63.0.387381437279.issue43793@roundup.psfhosted.org> Message-ID: <1617984834.55.0.272190821552.issue43793@roundup.psfhosted.org> Change by Samuel Thibault : ---------- nosy: +samuel-thibault _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 12:18:30 2021 From: report at bugs.python.org (Samuel Thibault) Date: Fri, 09 Apr 2021 16:18:30 +0000 Subject: [issue43747] Can't create new interpreter in multi thread In-Reply-To: <1617711734.82.0.851064276146.issue43747@roundup.psfhosted.org> Message-ID: <1617985110.63.0.608210416681.issue43747@roundup.psfhosted.org> Samuel Thibault added the comment: I don't see how to reopen this, we'd probably want to mark it as a duplicate of the newly-opened https://bugs.python.org/issue43793 , see https://mail.python.org/archives/list/capi-sig at python.org/thread/7FI6V2KFBFZIXC6LZLKHY4Z7TUJ6YWTX/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 12:21:13 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 16:21:13 +0000 Subject: [issue43794] OpenSSL 3.0.0: Handle UNEXPECTED_EOF_WHILE_READING / wrap SSL_OP_IGNORE_UNEXPECTED_EOF In-Reply-To: <1617977591.38.0.697961461689.issue43794@roundup.psfhosted.org> Message-ID: <1617985273.23.0.14614066188.issue43794@roundup.psfhosted.org> miss-islington added the comment: New changeset e18ebd9ec546a3647a57c282735350f60a26d66d by Miss Islington (bot) in branch '3.8': bpo-43794: OpenSSL 3.0.0: set OP_IGNORE_UNEXPECTED_EOF by default (GH-25309) https://github.com/python/cpython/commit/e18ebd9ec546a3647a57c282735350f60a26d66d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 12:21:59 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 16:21:59 +0000 Subject: [issue43794] OpenSSL 3.0.0: Handle UNEXPECTED_EOF_WHILE_READING / wrap SSL_OP_IGNORE_UNEXPECTED_EOF In-Reply-To: <1617977591.38.0.697961461689.issue43794@roundup.psfhosted.org> Message-ID: <1617985319.11.0.256780247603.issue43794@roundup.psfhosted.org> miss-islington added the comment: New changeset 54d89a33e0d1b854fd5a72889d6554aeeb4170f0 by Miss Islington (bot) in branch '3.9': bpo-43794: OpenSSL 3.0.0: set OP_IGNORE_UNEXPECTED_EOF by default (GH-25309) https://github.com/python/cpython/commit/54d89a33e0d1b854fd5a72889d6554aeeb4170f0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 12:33:53 2021 From: report at bugs.python.org (Faidon Liambotis) Date: Fri, 09 Apr 2021 16:33:53 +0000 Subject: [issue40485] Provide an abstraction for a select-able Event In-Reply-To: <1588520007.12.0.424273214975.issue40485@roundup.psfhosted.org> Message-ID: <1617986033.09.0.164804240463.issue40485@roundup.psfhosted.org> Faidon Liambotis added the comment: I missed that there is now also an os.eventfd_{write,read}(), so in the above os.write(self._event_fd, self._ONE) can become os.eventfd_write(self._event_fd, 1) and: os.read(self._event_fd, 8) can become: os.eventfd_read(self._event_fd) (the _ONE declaration will then be unnecessary and can be removed) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 12:34:49 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 16:34:49 +0000 Subject: [issue43788] OpenSSL 3.0.0: Make ssl_data.h version specific In-Reply-To: <1617962688.47.0.0760026042397.issue43788@roundup.psfhosted.org> Message-ID: <1617986089.22.0.46257492182.issue43788@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 299ae9c7a2a169d54921815b9bb41a8f9277a3aa by Christian Heimes in branch '3.9': [3.9] bpo-43788: Generate version specific _ssl_data.h (GH-25300) (GH-25310) https://github.com/python/cpython/commit/299ae9c7a2a169d54921815b9bb41a8f9277a3aa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 12:34:58 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 16:34:58 +0000 Subject: [issue43788] OpenSSL 3.0.0: Make ssl_data.h version specific In-Reply-To: <1617962688.47.0.0760026042397.issue43788@roundup.psfhosted.org> Message-ID: <1617986098.08.0.509029686339.issue43788@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 70f2ca7ea46ac15d05c7b422a10b18aa3fe4a140 by Christian Heimes in branch '3.8': [3.8] bpo-43788: Generate version specific _ssl_data.h (GH-25300) (GH-25311) https://github.com/python/cpython/commit/70f2ca7ea46ac15d05c7b422a10b18aa3fe4a140 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 12:50:34 2021 From: report at bugs.python.org (Jared Ondricek) Date: Fri, 09 Apr 2021 16:50:34 +0000 Subject: [issue43796] "install" package on PyPI Message-ID: <1617987034.78.0.497462487894.issue43796@roundup.psfhosted.org> New submission from Jared Ondricek : I recently accidentally typed "pip install pip install " and it installed a package called "install" that has 1 star on GitHub. It is also in use by 2.3k repositories according to the GitHub dependency graph view. I don't think it's malicious, but it does seem a bit sketchy. I just know this sort of thing has been in the news lately, and maybe this is that sort of thing that ought to be looked at by someone smarter than me about security stuff. The way Perl deals with this specific issue is by using a specific dummy module so no one can do this on accident. Is this worth the time to discuss? Or am I just being paranoid about a third party library called install? PyPI entry: https://pypi.org/project/install/ GitHub page: https://github.com/eugenekolo/pip-install GitHub projects that depend on it: https://github.com/eugenekolo/pip-install/network/dependents?package_id=UGFja2FnZS0xMjU0NTI3MDI5 Perl dummy install module: https://metacpan.org/pod/install ---------- messages: 390647 nosy: flamableconcrete priority: normal severity: normal status: open title: "install" package on PyPI type: security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 12:54:43 2021 From: report at bugs.python.org (Anthony Flury) Date: Fri, 09 Apr 2021 16:54:43 +0000 Subject: [issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative In-Reply-To: <1617659396.43.0.525762996462.issue43737@roundup.psfhosted.org> Message-ID: <1617987283.56.0.682357144113.issue43737@roundup.psfhosted.org> Anthony Flury added the comment: I fundamentally disagree with closing this - I know that this and many other 'quirks' catch beginners out, and the tutorial is what they use to learn.They don't look in the reference document - it is too dense in BNF definitions which turns a lot of people off from any other useful information - When I was researching this issue I didn't even think to look in the reference section. Looking in the library section for information about the built-in types is also non-obvious to beginners. If the tutorial doesn't contain the detail, and doesn't link to the detail then beginners are left entirely puzzled by the behavior. Given how difficult it is to search the documentation if you don't know exactly what you are looking for, then how beginners would know to look at the FAQ is beyond me. Having communicated with a number of beginners on a number of issues they had no idea that the FAQ even existed. The change didn't 'bury the tutorial in detail' - it added once sentence which linked to the FAQ. In fact all the change did was expand the FAQ entry by a few lines and link to the FAQ from the three places that are relevant. I think this is a small change and it should be the start of making the tutorial beginner friendly. ---------- resolution: not a bug -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 12:55:48 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 09 Apr 2021 16:55:48 +0000 Subject: [issue43790] CLA check fails with a 500 error In-Reply-To: <1617972469.44.0.813759160932.issue43790@roundup.psfhosted.org> Message-ID: <1617987348.1.0.879258643228.issue43790@roundup.psfhosted.org> Shreyan Avigyan added the comment: I agree with you. I've faced the same problem. The server sometimes fails with a 500 error and sometimes it works fine. I'm attaching a screenshot of the problem. ---------- nosy: +shreyanavigyan Added file: https://bugs.python.org/file49951/Server Error 500.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 13:19:52 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 17:19:52 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1617988792.69.0.244282772394.issue38820@roundup.psfhosted.org> Christian Heimes added the comment: Miro, I have pushed several fixes for OpenSSL 3.0.0 * bpo-43788 addresses wrong library and error reason codes (e.g. KRB5_S_TKT_NYV) * bpo-43789 fixes an issue with exception state in password callbacks (_PyEval_EvalFrameDefault returned a result with an exception set) * bpo-43791 disables TLS 1.0 and 1.1 testing with OpenSSL 3.0.0. I'll have to talk to upstream and figure out a better solution. * bpo-43794 adds OP_IGNORE_UNEXPECTED_EOF and sets it by default. This makes the code behave like OpenSSL 1.1.0 and 1.0.2. I'll look into the other issues next week. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 13:21:03 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 17:21:03 +0000 Subject: [issue40485] Provide an abstraction for a select-able Event In-Reply-To: <1588520007.12.0.424273214975.issue40485@roundup.psfhosted.org> Message-ID: <1617988863.9.0.808765312097.issue40485@roundup.psfhosted.org> Christian Heimes added the comment: Do you want to work on a feature for 3.10? Feature freeze is in less than 4 weeks. ---------- components: +Library (Lib) -Extension Modules stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 13:27:17 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 17:27:17 +0000 Subject: [issue43796] "install" package on PyPI In-Reply-To: <1617987034.78.0.497462487894.issue43796@roundup.psfhosted.org> Message-ID: <1617989237.35.0.0646810394002.issue43796@roundup.psfhosted.org> Christian Heimes added the comment: BPO is just for CPython bugs. Packaging and PyPI are handled by different teams and trackers. Please use https://github.com/pypa/pypi-support ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 13:46:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 09 Apr 2021 17:46:40 +0000 Subject: [issue43779] Fix possible parser/AST ref leaks In-Reply-To: <1617919681.12.0.940558119091.issue43779@roundup.psfhosted.org> Message-ID: <1617990400.11.0.19991397099.issue43779@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 76d270ec2b776cc5331935cc58c2d63622f1c0e9 by Erlend Egeberg Aasland in branch '3.9': [3.9] bpo-43779: Fix possible refleak involving _PyArena_AddPyObject (GH-25289). (GH-25294) https://github.com/python/cpython/commit/76d270ec2b776cc5331935cc58c2d63622f1c0e9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 13:47:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 09 Apr 2021 17:47:25 +0000 Subject: [issue43779] Fix possible parser/AST ref leaks In-Reply-To: <1617919681.12.0.940558119091.issue43779@roundup.psfhosted.org> Message-ID: <1617990445.02.0.215993050032.issue43779@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 13:51:33 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 09 Apr 2021 17:51:33 +0000 Subject: [issue43796] "install" package on PyPI In-Reply-To: <1617987034.78.0.497462487894.issue43796@roundup.psfhosted.org> Message-ID: <1617990693.75.0.689785110648.issue43796@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This seems to have been discussed : https://github.com/pypa/pypi-support/issues/451 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 13:54:41 2021 From: report at bugs.python.org (David Mandelberg) Date: Fri, 09 Apr 2021 17:54:41 +0000 Subject: [issue24959] unittest swallows part of stack trace when raising AssertionError in a TestCase In-Reply-To: <1440864914.24.0.799928607113.issue24959@psf.upfronthosting.co.za> Message-ID: <1617990881.64.0.93620014089.issue24959@roundup.psfhosted.org> Change by David Mandelberg : ---------- nosy: +dseomn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 13:58:00 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 09 Apr 2021 17:58:00 +0000 Subject: [issue37609] support "UNC" device paths in ntpath.splitdrive In-Reply-To: <1563362794.09.0.456380769613.issue37609@roundup.psfhosted.org> Message-ID: <1617991080.13.0.170567091591.issue37609@roundup.psfhosted.org> Change by Steve Dower : ---------- assignee: steve.dower -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 13:59:38 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 17:59:38 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1617991178.04.0.493388943658.issue38820@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24051 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25316 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 14:07:03 2021 From: report at bugs.python.org (Faidon Liambotis) Date: Fri, 09 Apr 2021 18:07:03 +0000 Subject: [issue40485] Provide an abstraction for a select-able Event In-Reply-To: <1588520007.12.0.424273214975.issue40485@roundup.psfhosted.org> Message-ID: <1617991623.03.0.683724627915.issue40485@roundup.psfhosted.org> Faidon Liambotis added the comment: Not sure if I understand the question! I'd like to see that happen, I don't particularly care if it makes to 3.10 or a later version, although of course the earlier the better :) As an idea of a path forward, would it make sense to take the code above and push it to multiprocessing as an alternative to Event with an if hasattr(os, "eventfd") guard? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 14:07:52 2021 From: report at bugs.python.org (Bob Kline) Date: Fri, 09 Apr 2021 18:07:52 +0000 Subject: [issue43790] CLA check fails with a 500 error In-Reply-To: <1617972469.44.0.813759160932.issue43790@roundup.psfhosted.org> Message-ID: <1617991672.77.0.225580023336.issue43790@roundup.psfhosted.org> Bob Kline added the comment: Apparently, it doesn't fail when you enter a name for which it can't find a b.p.o. account. So it knows how to say "beelzebub does not have bpo account" but fails when I put in "bkline" in the GitHub username field. It's tempting to suspect that the 500 error means "yes, I found a b.p.o account for that GitHub user but I just can't say so" but there's no guarantee that this would be a reliable assumption. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 14:11:34 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 09 Apr 2021 18:11:34 +0000 Subject: [issue43790] CLA check fails with a 500 error In-Reply-To: <1617972469.44.0.813759160932.issue43790@roundup.psfhosted.org> Message-ID: <1617991894.29.0.666092616004.issue43790@roundup.psfhosted.org> Shreyan Avigyan added the comment: I believe that maybe the Heroku server, the CLA Checking tool is deployed to, is facing an internal server problem or the server is down. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 14:27:24 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 09 Apr 2021 18:27:24 +0000 Subject: [issue43749] venv module does not copy the correct python exe In-Reply-To: <1617715625.46.0.74507922397.issue43749@roundup.psfhosted.org> Message-ID: <1617992844.76.0.457478071294.issue43749@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 14:28:19 2021 From: report at bugs.python.org (Kevin M) Date: Fri, 09 Apr 2021 18:28:19 +0000 Subject: [issue43784] starting a thread in __del__ hangs at interpreter shutdown In-Reply-To: <1617945949.93.0.237236734747.issue43784@roundup.psfhosted.org> Message-ID: <1617992899.68.0.498549345069.issue43784@roundup.psfhosted.org> Kevin M added the comment: eryksun, wow, that's speedy analysis, but there might be more to it. I went and tested a bunch of test cases. my subrocess code doesn't seem to hang on Linux where the thread example code does? Linux - Python 3.6.8 - your threading example DOESN'T hang Linux - Python 3.6.8 - My subprocess code also DOESN'T hang Linux - Python 3.8.5 - thread example HANGs Linux - Python 3.8.5 - My subprocess code also DOESN'T hang Windows - Python 3.9.1 - thread example HANGs Windows - Python 3.9.1 - subprocess code HANGs ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 15:11:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 09 Apr 2021 19:11:31 +0000 Subject: [issue43797] Improve syntax error for invalid comparisons Message-ID: <1617995491.91.0.835586864843.issue43797@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Improve syntax error for invalid comparisons such as: >>> if x = 3: File "", line 1 if x = 3: ^ SyntaxError: invalid syntax to print: >>> if x = 3: File "", line 1 if x = 3: ^ SyntaxError: cannot assign to name. Maybe you meant '==' or ':=' instead of '='? instead ---------- messages: 390659 nosy: pablogsal priority: normal severity: normal status: open title: Improve syntax error for invalid comparisons _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 15:13:27 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 09 Apr 2021 19:13:27 +0000 Subject: [issue43797] Improve syntax error for invalid comparisons In-Reply-To: <1617995491.91.0.835586864843.issue43797@roundup.psfhosted.org> Message-ID: <1617995607.74.0.773816424893.issue43797@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +24052 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25317 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 15:38:32 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 09 Apr 2021 19:38:32 +0000 Subject: [issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path In-Reply-To: <1612285380.24.0.495785451269.issue43105@roundup.psfhosted.org> Message-ID: <1617997112.24.0.995489905074.issue43105@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +24053 stage: backport needed -> patch review pull_request: https://github.com/python/cpython/pull/25318 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 15:45:35 2021 From: report at bugs.python.org (Andre Roberge) Date: Fri, 09 Apr 2021 19:45:35 +0000 Subject: [issue43797] Improve syntax error for invalid comparisons In-Reply-To: <1617995491.91.0.835586864843.issue43797@roundup.psfhosted.org> Message-ID: <1617997535.86.0.721370905175.issue43797@roundup.psfhosted.org> Change by Andre Roberge : ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 15:47:31 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 09 Apr 2021 19:47:31 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1617997651.29.0.350093261301.issue43725@roundup.psfhosted.org> Steve Dower added the comment: I got a false positive on my PR at https://github.com/python/cpython/pull/25318/checks?check_run_id=2308871807 1 Changed variable: [C]'const unsigned char[45154] const _Py_M__importlib_bootstrap_external' was changed to 'const unsigned char[43681] const _Py_M__importlib_bootstrap_external' at importlib_external.h:2:1: size of symbol changed from 45154 to 43681 type of variable changed: 'const unsigned char[45154] const' changed to 'const unsigned char[43681] const' Is there an option to exclude array lengths? Or to treat the API as just a pointer rather than an array? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 16:01:31 2021 From: report at bugs.python.org (Saiyang Gou) Date: Fri, 09 Apr 2021 20:01:31 +0000 Subject: [issue42737] PEP 563: drop annotations for complex assign targets In-Reply-To: <1608888770.02.0.483696766952.issue42737@roundup.psfhosted.org> Message-ID: <1617998491.22.0.531822600912.issue42737@roundup.psfhosted.org> Saiyang Gou added the comment: I think we can just skip evaluating annotations for complex targets when in module or class scope (they are not stored anyway). The point of PEP 563 is to suppress any evaluation of annotations (regardless of position) at definition time, while type checkers can still analyze them as usual. This is the current behavior (ever since 3.7, with `from __future__ import annotations`): Python 3.10.0a7 (default, Apr 6 2021, 17:59:12) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> x = 1 >>> x.y: print('evaluated in module') evaluated in module >>> class A: ... u = 2 ... u.v: print('evaluated in class') ... evaluated in class And I think they should become no-ops at run-time (as if the annotations were wrapped in string form). ---------- nosy: +gousaiyang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 16:07:23 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 20:07:23 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1617998843.77.0.178744705389.issue38820@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24054 pull_request: https://github.com/python/cpython/pull/25319 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 16:23:19 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 09 Apr 2021 20:23:19 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1617999799.83.0.241618532914.issue38820@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 2d7fdc90731e132f9d6b43852ee112f25831394b by Christian Heimes in branch 'master': bpo-38820: OpenSSL 3.0.0: Use supported hashing algos in doc test (GH-25319) https://github.com/python/cpython/commit/2d7fdc90731e132f9d6b43852ee112f25831394b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 16:23:40 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 20:23:40 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1617999820.81.0.808665233428.issue38820@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24055 pull_request: https://github.com/python/cpython/pull/25320 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 16:23:51 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 20:23:51 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1617999831.68.0.0536995885993.issue38820@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24056 pull_request: https://github.com/python/cpython/pull/25321 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 16:28:56 2021 From: report at bugs.python.org (Matthew Suozzo) Date: Fri, 09 Apr 2021 20:28:56 +0000 Subject: [issue43798] Add position metadata to alias AST type Message-ID: <1618000136.49.0.849749645286.issue43798@roundup.psfhosted.org> New submission from Matthew Suozzo : Given the increasing use of long `from typing import foo, bar, ...` import sequences, it's becoming more desirable to address individual components of the import node. Unfortunately, the ast.alias node doesn't contain source location metadata (e.g. lineno, col_offset). This metadata would be comparatively easy to add, backwards compatible, and would enable more precise diagnostics e.g. lints. ---------- components: Interpreter Core messages: 390663 nosy: matthew.suozzo priority: normal severity: normal status: open title: Add position metadata to alias AST type type: enhancement versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 16:33:36 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 20:33:36 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1618000416.88.0.714713543945.issue38820@roundup.psfhosted.org> miss-islington added the comment: New changeset ffb05bbb30fa82dbe887981bdabd65af7daffcd1 by Miss Islington (bot) in branch '3.8': bpo-38820: OpenSSL 3.0.0: Use supported hashing algos in doc test (GH-25319) https://github.com/python/cpython/commit/ffb05bbb30fa82dbe887981bdabd65af7daffcd1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 16:46:01 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 09 Apr 2021 20:46:01 +0000 Subject: [issue42737] PEP 563: drop annotations for complex assign targets In-Reply-To: <1608888770.02.0.483696766952.issue42737@roundup.psfhosted.org> Message-ID: <1618001161.97.0.63041493991.issue42737@roundup.psfhosted.org> Batuhan Taskaya added the comment: If there is enough interest, I'd like to propose to this before the beta cut ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 16:46:25 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 09 Apr 2021 20:46:25 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1618001185.11.0.733228122732.issue38820@roundup.psfhosted.org> miss-islington added the comment: New changeset 7c8796a750fb108be99e0bc50ca3dba000d77e54 by Miss Islington (bot) in branch '3.9': bpo-38820: OpenSSL 3.0.0: Use supported hashing algos in doc test (GH-25319) https://github.com/python/cpython/commit/7c8796a750fb108be99e0bc50ca3dba000d77e54 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 16:52:55 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 09 Apr 2021 20:52:55 +0000 Subject: [issue40107] pathlib: make `_Accessor.open()` return a file object and not a file descriptor In-Reply-To: <1585521459.52.0.94031195769.issue40107@roundup.psfhosted.org> Message-ID: <1618001575.99.0.932745333354.issue40107@roundup.psfhosted.org> Steve Dower added the comment: New changeset 11c3bd3f6d06649484b81a659c7bf02d6632e607 by Barney Gale in branch 'master': bpo-40107: Switch to using io.open() for pathlib.Path.open() (GH-25240) https://github.com/python/cpython/commit/11c3bd3f6d06649484b81a659c7bf02d6632e607 ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 17:20:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 09 Apr 2021 21:20:00 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1618003200.05.0.386894460464.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Is there an option to exclude array lengths? Or to treat the API as just a pointer rather than an array? Technically is not a false positive: https://developers.redhat.com/blog/2019/05/06/how-c-array-sizes-become-part-of-the-binary-interface-of-a-library/ But in this case I think it is. We can have a ignore file: https://sourceware.org/libabigail/manual/libabigail-concepts.html#suppr-spec-label We could ignore all functions that start with _Py. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 17:28:22 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 09 Apr 2021 21:28:22 +0000 Subject: [issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()` In-Reply-To: <1583643972.77.0.25342179601.issue39899@roundup.psfhosted.org> Message-ID: <1618003702.24.0.570022570035.issue39899@roundup.psfhosted.org> Steve Dower added the comment: New changeset ba1db571987c65672d9c06789e9852313ed2412a by Barney Gale in branch 'master': bpo-39899: Don't double-check directory name if we're requesting the current user's home directory in ntpath.expanduser() (GH-25277) https://github.com/python/cpython/commit/ba1db571987c65672d9c06789e9852313ed2412a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 17:45:07 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 09 Apr 2021 21:45:07 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1618004707.15.0.710488506562.issue43725@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24057 pull_request: https://github.com/python/cpython/pull/25322 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 17:49:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 09 Apr 2021 21:49:14 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1618004954.08.0.618923075278.issue43725@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24058 pull_request: https://github.com/python/cpython/pull/25323 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 18:03:35 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 09 Apr 2021 22:03:35 +0000 Subject: [issue40107] pathlib: make `_Accessor.open()` return a file object and not a file descriptor In-Reply-To: <1585521459.52.0.94031195769.issue40107@roundup.psfhosted.org> Message-ID: <1618005815.87.0.65414010337.issue40107@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 18:03:46 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 09 Apr 2021 22:03:46 +0000 Subject: [issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()` In-Reply-To: <1583643972.77.0.25342179601.issue39899@roundup.psfhosted.org> Message-ID: <1618005826.94.0.781302004782.issue39899@roundup.psfhosted.org> Change by Steve Dower : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 18:05:28 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 09 Apr 2021 22:05:28 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1618005928.52.0.369800391216.issue43725@roundup.psfhosted.org> Steve Dower added the comment: Oh wow, that's terrible... yet another good reason not to export data values. But yeah, filtering on the name prefix should be fine. These aren't meant to be publicly accessible anyway. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 18:06:16 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 09 Apr 2021 22:06:16 +0000 Subject: [issue43708] Tkinter theme settings object schema is missing In-Reply-To: <1617395408.51.0.908032380158.issue43708@roundup.psfhosted.org> Message-ID: <1618005976.8.0.372066562944.issue43708@roundup.psfhosted.org> Terry J. Reedy added the comment: You code as posted is buggy. 'settings' maps styles to dicts with possible keys ?configure?, ?map?, ?layout? and ?element create?. See https://docs.python.org/3/library/tkinter.ttk.html#tkinter.ttk.Style.theme_create I presume '.' refers to all styles, but [] is not a dict, let alone one with the allowed keys and values. Thus for me, in 3.8.9 and 3.10.0 on Win10, from tkinter import ttk style = ttk.Style() style.theme_settings('default', {'.': []}) results in a traceback ending with the true statement AttributeError: 'list' object has no attribute 'get' Your code does not match the error you reported, as the AttributeError is raised in tkinter.ttk._script_from_settings before calling tk. If you posted the wrong code, and you actually got the error you reported with other code, recheck to make sure it matches the doc and if you still get an error, repost with OS and full Python version (x.y.z). If you used an earlier version of 3.8, please try with the latest release or a later version, as there might have been a tkinter bug fix. ---------- nosy: +serhiy.storchaka, terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 18:06:27 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 09 Apr 2021 22:06:27 +0000 Subject: [issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path In-Reply-To: <1612285380.24.0.495785451269.issue43105@roundup.psfhosted.org> Message-ID: <1618005987.03.0.238739499723.issue43105@roundup.psfhosted.org> Steve Dower added the comment: New changeset eed7686e9fe22a3eb5e1a1fc7d27c27fca070bd1 by Steve Dower in branch '3.8': bpo-43105: Importlib now resolves relative paths when creating module spec objects from file locations (GH-25121) https://github.com/python/cpython/commit/eed7686e9fe22a3eb5e1a1fc7d27c27fca070bd1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 18:31:24 2021 From: report at bugs.python.org (Matthew Suozzo) Date: Fri, 09 Apr 2021 22:31:24 +0000 Subject: [issue43798] Add position metadata to alias AST type In-Reply-To: <1618000136.49.0.849749645286.issue43798@roundup.psfhosted.org> Message-ID: <1618007484.47.0.317397262513.issue43798@roundup.psfhosted.org> Change by Matthew Suozzo : ---------- keywords: +patch pull_requests: +24059 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25324 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 18:39:10 2021 From: report at bugs.python.org (Matthew Suozzo) Date: Fri, 09 Apr 2021 22:39:10 +0000 Subject: [issue43798] Add position metadata to alias AST type In-Reply-To: <1618000136.49.0.849749645286.issue43798@roundup.psfhosted.org> Message-ID: <1618007950.1.0.931712241699.issue43798@roundup.psfhosted.org> Matthew Suozzo added the comment: Ah and one other question: Is this normally the sort of thing that would get backported? It should be very straightforward to do so, at least for 3.9 given the support for the new parser. ---------- versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 18:55:52 2021 From: report at bugs.python.org (Adrian Freund) Date: Fri, 09 Apr 2021 22:55:52 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1618008952.56.0.1536142158.issue43764@roundup.psfhosted.org> Adrian Freund added the comment: > I assume the OP wants to have a class that doesn't allow positional patterns. The right way to spell that is indeed to add > > __match_args__ = () > >to the class, there's no need to add another flag to @dataclass. The same however is also true for all the other stuff generated by @dataclass. You can for example disable generation of the init method using def __init__(self): pass and dataclass still has a parameter to disable it. I agree that a new parameter isn't strictly required to achieve functionality, however I would still argue that it should be added for consistency with the rest of the dataclass api. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 18:58:28 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Fri, 09 Apr 2021 22:58:28 +0000 Subject: [issue43798] Add position metadata to alias AST type In-Reply-To: <1618000136.49.0.849749645286.issue43798@roundup.psfhosted.org> Message-ID: <1618009108.34.0.479431344429.issue43798@roundup.psfhosted.org> Lysandros Nikolaou added the comment: I'm okay with this, unless someone has any input on why the alias node should not have line/column info (and did not have it in the first place). ---------- nosy: +BTaskaya, gvanrossum, lys.nikolaou, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 19:09:15 2021 From: report at bugs.python.org (Adrian Freund) Date: Fri, 09 Apr 2021 23:09:15 +0000 Subject: [issue43761] Documenting dataclass and namedtuple changes for structural pattern matching In-Reply-To: <1617792027.47.0.961772614464.issue43761@roundup.psfhosted.org> Message-ID: <1618009755.56.0.658416993825.issue43761@roundup.psfhosted.org> Adrian Freund added the comment: I agree that __match_args__ shouldn't have to be added to the documentation of any class that supports it, however dataclass and (maybe to a lesser extend) NamedTuple aren't themselves classes, but aid in creating own classes. Their effects on classes generated by them should be documented. The documentation also mentions other fields/methods generated by dataclass and NamedTyple. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 19:24:23 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 09 Apr 2021 23:24:23 +0000 Subject: [issue43761] Documenting dataclass and namedtuple changes for structural pattern matching In-Reply-To: <1617792027.47.0.961772614464.issue43761@roundup.psfhosted.org> Message-ID: <1618010663.54.0.457111527141.issue43761@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: -rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 19:26:04 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 09 Apr 2021 23:26:04 +0000 Subject: [issue43798] Add position metadata to alias AST type In-Reply-To: <1618000136.49.0.849749645286.issue43798@roundup.psfhosted.org> Message-ID: <1618010764.54.0.811158089004.issue43798@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Ah and one other question: Is this normally the sort of thing that would get backported? It should be very straightforward to do so, at least for 3.9 given the support for the new parser. Unfortunately no, is technically a new feature. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 19:28:13 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 09 Apr 2021 23:28:13 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1618010893.02.0.651361121283.issue43764@roundup.psfhosted.org> Eric V. Smith added the comment: init=False is used to make sure there's no __init__ defined, because there's a difference between a class with an __init__ and one without. If there was a difference between __match_args__ being not present and __match_args__=(), then I'd support a matchargs=False argument. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 19:30:25 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 09 Apr 2021 23:30:25 +0000 Subject: [issue43761] Documenting dataclass and namedtuple changes for structural pattern matching In-Reply-To: <1617792027.47.0.961772614464.issue43761@roundup.psfhosted.org> Message-ID: <1618011025.09.0.264509267324.issue43761@roundup.psfhosted.org> Eric V. Smith added the comment: I do think it's worth mentioning that __match_args__ is automatically generated by @dataclass (if the class doesn't already define __match_args__). That seems like behavior that's very specific to @dataclass. Where else would you find out that defining your own __match_args__ prevents @dataclass from adding it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 19:55:19 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 09 Apr 2021 23:55:19 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1618012519.83.0.360100556398.issue43764@roundup.psfhosted.org> Brandt Bucher added the comment: > init=False is used to make sure there's no __init__ defined, because there's a difference between a class with an __init__ and one without. If there was a difference between __match_args__ being not present and __match_args__=(), then I'd support a matchargs=False argument. Ah, I see now how this might possibly be useful. If you want to inherit a parent's __match_args__ in a dataclass, it currently must be as spelled something like: @dataclass class Child(Parent): __match_args__ = Parent.__match_args__ ... It's even uglier when you're unsure if Parent defines __match_args__ at all, or if multiple-inheritance is involved: @dataclass class Child(Parent, Mixin): __match_args__ = () ... del Child.__match_args__ I'm not sure how likely it is that code out in the wild may need to look like this. As I understand it, though, the fact that dataclasses allow for "normal" inheritance is one of their big selling-points. So it could be a valid reason to include this option. If it seems like the above code might become reasonably common, I agree that the proposed solution is much cleaner: @dataclass(match_args=False) class Child(Parent): ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 20:05:48 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 10 Apr 2021 00:05:48 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1618013148.73.0.410139072449.issue43764@roundup.psfhosted.org> Brandt Bucher added the comment: I just realized that in my first two examples, all that's really needed is a "del Child.__match_args__" following each class definition. The main point still stands though: this may be a more common issue than I previously thought. If it is, then a dedicated kwarg to the dataclass decorator probably makes more sense than requiring users to "del" the generated attribute. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 20:20:55 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 10 Apr 2021 00:20:55 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1618014055.75.0.82527325937.issue43764@roundup.psfhosted.org> Eric V. Smith added the comment: Hmm, good point on the inheritance case. I'd forgotten that this is where init=False and others would come in handy. Although I'm having a hard time figuring out why you'd want a derived class that adds fields but wants to use the parent's __match_args__ (or __init__, for that matter), but I guess it's possible. I don't like del Child.__match_args__. The same pattern could be used for init=False, after all, but there's a parameter for that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 21:07:14 2021 From: report at bugs.python.org (Leonardo Rick) Date: Sat, 10 Apr 2021 01:07:14 +0000 Subject: [issue38263] [Windows] multiprocessing: DupHandle.detach() race condition on DuplicateHandle(DUPLICATE_CLOSE_SOURCE) In-Reply-To: <1569321399.19.0.207011593125.issue38263@roundup.psfhosted.org> Message-ID: <1618016834.77.0.29579903821.issue38263@roundup.psfhosted.org> Leonardo Rick added the comment: Traceback (most recent call last): File "", line 1, in File "C:\Program Files\Python39\lib\multiprocessing\spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "C:\Program Files\Python39\lib\multiprocessing\spawn.py", line 126, in _main self = reduction.pickle.load(from_parent) File "C:\Program Files\Python39\lib\multiprocessing\connection.py", line 967, in rebuild_pipe_connection handle = dh.detach() File "C:\Program Files\Python39\lib\multiprocessing\reduction.py", line 131, in detach return _winapi.DuplicateHandle( PermissionError: [WinError 5] Acesso negado ---------- nosy: +leonardo2 versions: +Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 21:17:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 10 Apr 2021 01:17:01 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1618017421.53.0.536261362806.issue43770@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24060 pull_request: https://github.com/python/cpython/pull/25325 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 21:27:18 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 10 Apr 2021 01:27:18 +0000 Subject: [issue40701] tempfile mixes str and bytes in an inconsistent manner In-Reply-To: <1590002424.23.0.821521735552.issue40701@roundup.psfhosted.org> Message-ID: <1618018038.56.0.722870886561.issue40701@roundup.psfhosted.org> Gregory P. Smith added the comment: Fixed for 3.10. Marking as a release blocker for 3.9 and assigning for a release manager decision on if they accept this change (the PR) as a bugfix in 3.9 or not. (see the PR) It is late enough in 3.8's lifetime I wouldn't touch that one. ---------- assignee: gregory.p.smith -> lukasz.langa nosy: +lukasz.langa priority: normal -> release blocker versions: -Python 3.10, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 21:57:35 2021 From: report at bugs.python.org (Matthew Suozzo) Date: Sat, 10 Apr 2021 01:57:35 +0000 Subject: [issue43478] Disallow Mock spec arguments from being Mocks In-Reply-To: <1615514023.14.0.0477922265442.issue43478@roundup.psfhosted.org> Message-ID: <1618019855.64.0.224104565556.issue43478@roundup.psfhosted.org> Change by Matthew Suozzo : ---------- keywords: +patch nosy: +matthew.suozzo nosy_count: 7.0 -> 8.0 pull_requests: +24061 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25326 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 22:02:04 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 10 Apr 2021 02:02:04 +0000 Subject: [issue43761] Documenting dataclass and namedtuple changes for structural pattern matching In-Reply-To: <1617792027.47.0.961772614464.issue43761@roundup.psfhosted.org> Message-ID: <1618020124.28.0.446766240884.issue43761@roundup.psfhosted.org> Brandt Bucher added the comment: If we end up adding a ?match_args=False? option to the dataclass decorator (issue 43764), then the docs for that option would probably be sufficient for this purpose. I?m imagining something like the docs for the ?init? option, just substituting ?__match_args__? for ?__init__()?. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 22:54:20 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 10 Apr 2021 02:54:20 +0000 Subject: [issue43714] re.findall: '\Z' must consume end of string if it matched In-Reply-To: <1617454993.35.0.466919552737.issue43714@roundup.psfhosted.org> Message-ID: <1618023260.12.0.433889907062.issue43714@roundup.psfhosted.org> Terry J. Reedy added the comment: Python regexes match slices of a Python string s. The latter include the len(s)+1 empty slices of s. An re Match gives both the slice itself as match attribute and its slice coordinates (span) in the searched string. https://docs.python.org/3/library/re.html says "\Z Matches only at the end of the string." There are two possible interpretations: 1. '\Z', by itself, matches the final empty slice s[n:n] of search string s, where n = len(s). 2. '\Z' modifies the (preceding) re to match "only at the end of the string", where the preceding re can be empty. For a single left to right search, I believe there is no difference. (I use '$' instead of '\Z', which I believe is the same without the re.MULTILINE flag.) >>> re.search(r'', 'a') >>> re.search(r'$', 'a') Either interpretation explains and is consistent with the second result. The issue is functions that look for multiple sequential matches. re.sub and re.split are based on re.finditer, which listed by re.findall. The latter two return all non-overlapping matches (slices), including empty slices. Hence, with an an regex that matches final '/' or '', >>> re.findall(r'/?$', '/') ['/', ''] I believe Alexander proposes that the 2nd member should not be there, but it is a match starting after '/' and does not overlap. The word 'consume' only appears in the current doc once -- "(?=...) Matches if ... matches next, but doesn?t consume any of the string." If we consider 'end of string' to be the final null slice, it does seem to be 'consumed' in that the final empty slice is only matched and added to the list once. I think that this should be closed as 'not a bub'. As for the desired results for the examples, they involve manipulating the result of deleting a final '/' if there is one (and re is not even needed that). >>> [re.sub('/$', '', 'a/b/c/d/'), ''] ['a/b/c/d', ''] >>> re.sub('/$', '', 'a/b/c/d/') + '-' 'a/b/c/d-' ---------- nosy: +ezio.melotti, serhiy.storchaka, terry.reedy title: re.split(), re.sub(): '\Z' must consume end of string if it matched -> re.findall: '\Z' must consume end of string if it matched versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 23:02:35 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 10 Apr 2021 03:02:35 +0000 Subject: [issue43792] Cython is not compatible with Python 3.10 yet: "SystemError: bad argument to internal function" In-Reply-To: <1617975873.6.0.244911999729.issue43792@roundup.psfhosted.org> Message-ID: <1618023755.54.0.959078279445.issue43792@roundup.psfhosted.org> Terry J. Reedy added the comment: Does this issue propose a patch to python/cpython? If not, it should be closed (and should have been posted to pydev list). ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 23:06:47 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 10 Apr 2021 03:06:47 +0000 Subject: [issue43796] "install" package on PyPI In-Reply-To: <1617987034.78.0.497462487894.issue43796@roundup.psfhosted.org> Message-ID: <1618024007.0.0.70632383924.issue43796@roundup.psfhosted.org> Terry J. Reedy added the comment: And maybe discuss with pip people why 'pip install pip install zyx' is not caught as an error. ---------- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 23:22:54 2021 From: report at bugs.python.org (Matthew Suozzo) Date: Sat, 10 Apr 2021 03:22:54 +0000 Subject: [issue37251] Mocking a MagicMock with a function spec results in an AsyncMock In-Reply-To: <1560348018.57.0.546920052201.issue37251@roundup.psfhosted.org> Message-ID: <1618024974.3.0.164702790866.issue37251@roundup.psfhosted.org> Matthew Suozzo added the comment: I don't think this was actually fixed for the create_autospec case. create_autospec still uses the only is_async_func check to enable use of AsyncMock and that still does a __code__ check. There was a test submitted to check this case but the test itself was bugged and discovered in the process of implementing https://bugs.python.org/issue43478. ---------- nosy: +matthew.suozzo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 9 23:45:57 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 10 Apr 2021 03:45:57 +0000 Subject: [issue43478] Disallow Mock spec arguments from being Mocks In-Reply-To: <1615514023.14.0.0477922265442.issue43478@roundup.psfhosted.org> Message-ID: <1618026357.44.0.838033437851.issue43478@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset dccdc500f9b5dab0a20407ae0178d393796a8828 by Matthew Suozzo in branch 'master': bpo-43478: Restrict use of Mock objects as specs (GH-25326) https://github.com/python/cpython/commit/dccdc500f9b5dab0a20407ae0178d393796a8828 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 00:50:40 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Apr 2021 04:50:40 +0000 Subject: [issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative In-Reply-To: <1617659396.43.0.525762996462.issue43737@roundup.psfhosted.org> Message-ID: <1618030240.13.0.784589707978.issue43737@roundup.psfhosted.org> Raymond Hettinger added the comment: Negative modulo divisors is not a "beginner friendly" topic or even remotely relevant to most users. It is also trivially discoverable with a few seconds of experimentation at the interactive prompt. FWIW, I've read dozens of Python tutorials and don't recall a single one covering this case. We need a better reason to do this other than you insisting on it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 00:52:53 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Apr 2021 04:52:53 +0000 Subject: [issue43761] Documenting dataclass and namedtuple changes for structural pattern matching In-Reply-To: <1617792027.47.0.961772614464.issue43761@roundup.psfhosted.org> Message-ID: <1618030373.43.0.52982694541.issue43761@roundup.psfhosted.org> Raymond Hettinger added the comment: For named tuples, there isn't an include/exclude option, so no extra mention is warranted. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 00:54:26 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Apr 2021 04:54:26 +0000 Subject: [issue43790] CLA check fails with a 500 error In-Reply-To: <1617972469.44.0.813759160932.issue43790@roundup.psfhosted.org> Message-ID: <1618030466.61.0.374345524149.issue43790@roundup.psfhosted.org> Raymond Hettinger added the comment: Mariatta, do you know who to refer this to? ---------- nosy: +Mariatta, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 00:55:21 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Apr 2021 04:55:21 +0000 Subject: [issue43784] starting a thread in __del__ hangs at interpreter shutdown In-Reply-To: <1617945949.93.0.237236734747.issue43784@roundup.psfhosted.org> Message-ID: <1618030521.0.0.863983786517.issue43784@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 01:36:41 2021 From: report at bugs.python.org (Miki Tebeka) Date: Sat, 10 Apr 2021 05:36:41 +0000 Subject: [issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative In-Reply-To: <1617659396.43.0.525762996462.issue43737@roundup.psfhosted.org> Message-ID: <1618033001.3.0.254925580226.issue43737@roundup.psfhosted.org> Miki Tebeka added the comment: I agree with Raymond, this is not "beginner friendly". I've been using Python for 25 year and teaching it for about 10 and this topic never came up. ---------- nosy: +tebeka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 02:05:35 2021 From: report at bugs.python.org (Eryk Sun) Date: Sat, 10 Apr 2021 06:05:35 +0000 Subject: [issue43784] starting a thread in __del__ hangs at interpreter shutdown In-Reply-To: <1617945949.93.0.237236734747.issue43784@roundup.psfhosted.org> Message-ID: <1618034735.59.0.703389585502.issue43784@roundup.psfhosted.org> Eryk Sun added the comment: > my subrocess code doesn't seem to hang on Linux where the > thread example code does? Reader threads for stdout and stderr are only used in Windows, since there's no equivalent to select/poll for synchronous pipes in Windows. Without using threads, I/O with synchronous pipes requires a busy loop. It has to poll PeekNamedPipe() to get the number of bytes available to read without blocking. For stdin, on the other hand, the Windows API does not allow getting the WriteQuotaAvailable from the PipeLocalInformation [1]. Without knowing how much can be written without blocking, the input pipe would have to be made non-blocking, which in turn requires an inner loop that tries to write a successively smaller chunk size to stdin until either it succeeds or the size is reduced to 0. If we wanted to change communicate() in Windows to not use threads and not require a busy loop, we'd have to switch to using named pipes opened in asynchronous (overlapped) mode on our side of each pipe. But that's an integration problem. For normal use as proc.stdout, etc, we would need an adapter or a new raw file type that implements a synchronous interface by waiting for I/O completion and maintaining its own file pointer. Such files would return the Windows file handle for fileno(), like sockets do, since a C file descriptor requires a synchronous-mode file. --- [1] https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_file_pipe_local_information ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 02:15:01 2021 From: report at bugs.python.org (Peter J. Farley III) Date: Sat, 10 Apr 2021 06:15:01 +0000 Subject: [issue43716] curses.pair_number() function incorrect value under Windows In-Reply-To: <1617814631.31.0.47167564758.issue43716@roundup.psfhosted.org> Message-ID: Peter J. Farley III added the comment: Thank you for responding. I will pursue the issue with the windows-curses and/or PDCurses team. Peter On Wed, Apr 7, 2021 at 12:57 PM Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > The curses module is not supported on Windows. windows-curses is a > third-party library. Use the corresponding bug tracker to report an issue > with windows-curses. > > ---------- > > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 02:22:50 2021 From: report at bugs.python.org (Peter J. Farley III) Date: Sat, 10 Apr 2021 06:22:50 +0000 Subject: [issue43715] curses inch() and scrbkgd() documentation ommissions In-Reply-To: <1617891485.67.0.570318087155.issue43715@roundup.psfhosted.org> Message-ID: Peter J. Farley III added the comment: Sorry, this was not meant as a patch. I have no experience with git or pulls and would not know where to start to do as you have asked. The text I provided was intended as model text for the python documentation maintainer to type into whatever piece of python is used to describe those two functions. If I knew where to pull a source archive or zip and knew the place or source member where that documentation is stored, I could generate a "diff -u" style of patch, but that is the limit of my skill in that area. Peter On Thu, Apr 8, 2021 at 10:18 AM Mariatta wrote: > > Mariatta added the comment: > > Thanks for the patch, but I find it difficult to read in plain text. Can > you create a pull request with the your suggested changes? > > ---------- > nosy: +Mariatta > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 03:14:42 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Apr 2021 07:14:42 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1618038882.89.0.154882927505.issue43475@roundup.psfhosted.org> Raymond Hettinger added the comment: Mark, is there any reason hash(float('NaN')) and hash(Decimal('NaN')) have to be a constant? Since NaNs don't compare equal, the hash homomorphism has no restrictions. Why not have hash() return the id() like we do for instances of object? I understand that sys.hash_info.nan would be invalidated, but that was likely useless anyway. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 03:33:07 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 10 Apr 2021 07:33:07 +0000 Subject: [issue43714] re.findall: '\Z' must consume end of string if it matched In-Reply-To: <1617454993.35.0.466919552737.issue43714@roundup.psfhosted.org> Message-ID: <1618039987.81.0.716061416086.issue43714@roundup.psfhosted.org> Serhiy Storchaka added the comment: I concur with Matthew. I tested several implementations in different programming languages. Perl, PHP and Java behave the same way as Python. Sed, awk and Go behave other way. We can argue that one or other way is "better", but it looks subjective, and in any case such change is breaking. It is better to keep the current behavior until we have very good reasons to break things. Old versions of Python had different behavior, but the implementation contained a bug which caused skipping some characters (see issue25054). It also prevented support of zero-width patterns in re.split() and the behavior was inconsistent between different re functions. The simplest way of fixing that bug lead to behavior consistent with Perl and Java. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 03:49:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 10 Apr 2021 07:49:27 +0000 Subject: [issue43797] Improve syntax error for invalid comparisons In-Reply-To: <1617995491.91.0.835586864843.issue43797@roundup.psfhosted.org> Message-ID: <1618040967.98.0.96623757684.issue43797@roundup.psfhosted.org> Serhiy Storchaka added the comment: "cannot assign to name" looks wrong. Usually we can assign to name, unless it is a keyword. And the problem is not that we cannot assign to name (we can), but that is is an invalid syntax, assignment is a statement, not an expression. Seems it handles only simplest cases with "=" in "if". It does not handle "while x = 3" and "if y and x = 3". Could it be possible to make it more general. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 03:52:32 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 10 Apr 2021 07:52:32 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1618041152.37.0.439070296881.issue43475@roundup.psfhosted.org> Mark Dickinson added the comment: > Why not have hash() return the id() like we do for instances of object? I think that's fine, and IIUC that's what Cong Ma was proposing. It seems like the least invasive potential fix. In principle I find the idea of making NaN a singleton rather attractive - the performance hit is likely negligible, and it solves a bunch of subtle NaN-related issues. (For example, there's still a proposal to provide an IEEE 754 total_ordering key so that lists of floats can be ordered sanely in the presence of nans, but even if you use that you don't know whether your nans will end up at the start or the end of the list, and you could potentially have nans in both places; fixing a single nan and its sign bit would fix that.) But there are bound to be some people somewhere making use of the NaN payload and sign bit, however inadvisedly, and Serhiy's right that this couldn't be extended to Decimal, where the sign bit and payload of the NaN are mandated by the standard. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 04:16:15 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 10 Apr 2021 08:16:15 +0000 Subject: [issue40701] tempfile mixes str and bytes in an inconsistent manner In-Reply-To: <1590002424.23.0.821521735552.issue40701@roundup.psfhosted.org> Message-ID: <1618042575.41.0.742967044511.issue40701@roundup.psfhosted.org> ?ukasz Langa added the comment: Sorry, I decided not to take this. We're four bugfix releases into 3.9 and there is non-zero chance somebody relies on existing behavior somehow. Marking this as changing with 3.10.0 is cleaner from an end user standpoint. ---------- priority: release blocker -> normal resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 04:31:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 10 Apr 2021 08:31:22 +0000 Subject: [issue43797] Improve syntax error for invalid comparisons In-Reply-To: <1617995491.91.0.835586864843.issue43797@roundup.psfhosted.org> Message-ID: <1618043482.07.0.297857720474.issue43797@roundup.psfhosted.org> Serhiy Storchaka added the comment: I tried to add | a=NAME '=' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION( a, "invalid syntax. Maybe you meant '==' or ':=' instead of '='?") } | a=bitwise_or '=' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION( a, "invalid syntax. Maybe you meant '==' instead of '='?") } in invalid_named_expression, but it does not have any effect. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 04:39:05 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 10 Apr 2021 08:39:05 +0000 Subject: [issue43682] Make static methods created by @staticmethod callable In-Reply-To: <1617201081.91.0.895015962683.issue43682@roundup.psfhosted.org> Message-ID: <1618043945.13.0.507380585413.issue43682@roundup.psfhosted.org> Serhiy Storchaka added the comment: > Do you see a way to make C functions and Python functions behave the same? Implement __get__ for C functions. Of course it is breaking change so we should first emit a warning. It will force all users to use staticmethod explicitly if they set a C function as a class attribute. We can also start emitting warnings for all callable non-descriptor class attributes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 04:55:34 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 10 Apr 2021 08:55:34 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1618044934.5.0.0419760382844.issue43739@roundup.psfhosted.org> Shreyan Avigyan added the comment: I've signed the PSF CLA (as it is required) now. Please have a review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 05:34:20 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 10 Apr 2021 09:34:20 +0000 Subject: [issue43799] OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1 Message-ID: <1618047260.96.0.943530034595.issue43799@roundup.psfhosted.org> New submission from Christian Heimes : OpenSSL 1.1 introduced the macro OPENSSL_API_COMPAT to select which APIs are exposed and which deprecation warnings are shown. https://www.openssl.org/docs/manmaster/man7/OPENSSL_API_COMPAT.html "#define OPENSSL_API_COMPAT 0x10101000L" suppresses warnings for APIs that are available in 1.1.1 and deprecated in 3.0.0. ---------- assignee: christian.heimes components: SSL messages: 390706 nosy: christian.heimes priority: normal severity: normal status: open title: OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1 type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 05:38:19 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 10 Apr 2021 09:38:19 +0000 Subject: [issue43799] OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1 In-Reply-To: <1618047260.96.0.943530034595.issue43799@roundup.psfhosted.org> Message-ID: <1618047499.57.0.685063528053.issue43799@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +24062 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25329 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 05:53:20 2021 From: report at bugs.python.org (Adrian Freund) Date: Sat, 10 Apr 2021 09:53:20 +0000 Subject: [issue43761] Documenting dataclass and namedtuple changes for structural pattern matching In-Reply-To: <1617792027.47.0.961772614464.issue43761@roundup.psfhosted.org> Message-ID: <1618048400.45.0.377024404046.issue43761@roundup.psfhosted.org> Adrian Freund added the comment: I think for namedtuple a short mention in the opening paragraph, where it also mentions the generation of a docstring and __repr__ method should be enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 05:57:34 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 10 Apr 2021 09:57:34 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1618048654.4.0.703404212641.issue43739@roundup.psfhosted.org> Shreyan Avigyan added the comment: I've managed to overcome the "HEAD Detached" problem I was facing when switching to the 3.9, 3.8, 3.7 and 3.6 branches. So I'm also submitting the PRs for those documentation versions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 05:57:54 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 10 Apr 2021 09:57:54 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1618048674.09.0.546366329995.issue43739@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- pull_requests: +24063 pull_request: https://github.com/python/cpython/pull/25330 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 06:26:49 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 10 Apr 2021 10:26:49 +0000 Subject: [issue43478] Disallow Mock spec arguments from being Mocks In-Reply-To: <1615514023.14.0.0477922265442.issue43478@roundup.psfhosted.org> Message-ID: <1618050409.54.0.571618228431.issue43478@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: +shreyanavigyan nosy_count: 8.0 -> 9.0 pull_requests: +24064 pull_request: https://github.com/python/cpython/pull/25207 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 06:29:14 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 10 Apr 2021 10:29:14 +0000 Subject: [issue43478] Disallow Mock spec arguments from being Mocks In-Reply-To: <1615514023.14.0.0477922265442.issue43478@roundup.psfhosted.org> Message-ID: <1618050554.9.0.729558094953.issue43478@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- pull_requests: -24064 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 06:29:35 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 10 Apr 2021 10:29:35 +0000 Subject: [issue43478] Disallow Mock spec arguments from being Mocks In-Reply-To: <1615514023.14.0.0477922265442.issue43478@roundup.psfhosted.org> Message-ID: <1618050575.56.0.405593891584.issue43478@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: -shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 06:56:01 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 10 Apr 2021 10:56:01 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1618052161.49.0.670453863644.issue43739@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- pull_requests: +24065 pull_request: https://github.com/python/cpython/pull/25331 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 08:48:21 2021 From: report at bugs.python.org (Mariatta) Date: Sat, 10 Apr 2021 12:48:21 +0000 Subject: [issue43790] CLA check fails with a 500 error In-Reply-To: <1617972469.44.0.813759160932.issue43790@roundup.psfhosted.org> Message-ID: <1618058901.56.0.908735048722.issue43790@roundup.psfhosted.org> Mariatta added the comment: Thanks for the report. I've identified the problem and fixed it. It should be working now. Further issues with it can be filed at https://github.com/Mariatta/check_python_cla/issues Thanks. ---------- assignee: -> Mariatta components: -Demos and Tools resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 09:08:28 2021 From: report at bugs.python.org (ntninja) Date: Sat, 10 Apr 2021 13:08:28 +0000 Subject: [issue43800] os.fwalk is not exposed on macOS Message-ID: <1618060108.26.0.358127537113.issue43800@roundup.psfhosted.org> New submission from ntninja : Is has come to my attention that the `os.fwalk` function has been missing from the standard library on Python for macOS since 3.6, even though macOS should support the necessary OS-interfaces (as specified in POSIX.1-2008) to support that function it just doesn't appear to exist. Due to lack of the required hardware I can unfortunately not even test this myself. ---------- components: Library (Lib) messages: 390710 nosy: ntninja priority: normal severity: normal status: open title: os.fwalk is not exposed on macOS type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 09:10:20 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 10 Apr 2021 13:10:20 +0000 Subject: [issue43800] os.fwalk is not exposed on macOS In-Reply-To: <1618060108.26.0.358127537113.issue43800@roundup.psfhosted.org> Message-ID: <1618060220.87.0.834453199381.issue43800@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 09:27:44 2021 From: report at bugs.python.org (Bob Kline) Date: Sat, 10 Apr 2021 13:27:44 +0000 Subject: [issue43790] CLA check fails with a 500 error In-Reply-To: <1617972469.44.0.813759160932.issue43790@roundup.psfhosted.org> Message-ID: <1618061264.79.0.0168502851445.issue43790@roundup.psfhosted.org> Bob Kline added the comment: Super, thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 09:28:54 2021 From: report at bugs.python.org (Bob Kline) Date: Sat, 10 Apr 2021 13:28:54 +0000 Subject: [issue43790] CLA check fails with a 500 error In-Reply-To: <1617972469.44.0.813759160932.issue43790@roundup.psfhosted.org> Message-ID: <1618061334.13.0.24045927586.issue43790@roundup.psfhosted.org> Bob Kline added the comment: Sorry, it's still failing with the same error message. ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 09:31:20 2021 From: report at bugs.python.org (Bob Kline) Date: Sat, 10 Apr 2021 13:31:20 +0000 Subject: [issue43790] CLA check fails with a 500 error In-Reply-To: <1617972469.44.0.813759160932.issue43790@roundup.psfhosted.org> Message-ID: <1618061480.32.0.106629849968.issue43790@roundup.psfhosted.org> Bob Kline added the comment: To reproduce, enter "bkline" in the GitHub username field and press Check. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 09:32:49 2021 From: report at bugs.python.org (Santosh Kumbhar) Date: Sat, 10 Apr 2021 13:32:49 +0000 Subject: [issue43801] Carriage Return problem in version v3.9.0:9cf6752 Message-ID: <1618061569.38.0.494837003994.issue43801@roundup.psfhosted.org> New submission from Santosh Kumbhar : Carriage return \r provide incorrect result ---------- components: Interpreter Core files: CarriageReturn_Issue.JPG messages: 390714 nosy: skumbhar priority: normal severity: normal status: open title: Carriage Return problem in version v3.9.0:9cf6752 type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file49952/CarriageReturn_Issue.JPG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 09:33:13 2021 From: report at bugs.python.org (Bob Kline) Date: Sat, 10 Apr 2021 13:33:13 +0000 Subject: [issue43790] CLA check fails with a 500 error In-Reply-To: <1617972469.44.0.813759160932.issue43790@roundup.psfhosted.org> Message-ID: <1618061593.64.0.727124008627.issue43790@roundup.psfhosted.org> Bob Kline added the comment: I can, if you prefer, close this ticket and create a new one on GitHub (even though this is the same issue, not a different "further" issue). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 10:28:24 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 10 Apr 2021 14:28:24 +0000 Subject: [issue43790] CLA check fails with a 500 error In-Reply-To: <1617972469.44.0.813759160932.issue43790@roundup.psfhosted.org> Message-ID: <1618064904.92.0.629622768468.issue43790@roundup.psfhosted.org> Shreyan Avigyan added the comment: Thanks Mariatta. It works now. I'm able to check if I've signed the CLA now. Thanks a lot. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 10:34:19 2021 From: report at bugs.python.org (Bob Kline) Date: Sat, 10 Apr 2021 14:34:19 +0000 Subject: [issue43790] CLA check fails with a 500 error In-Reply-To: <1617972469.44.0.813759160932.issue43790@roundup.psfhosted.org> Message-ID: <1618065259.54.0.865873460724.issue43790@roundup.psfhosted.org> Bob Kline added the comment: And now it's working for me as well. Thanks, @Mariatta. ---------- resolution: third party -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 11:00:21 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 10 Apr 2021 15:00:21 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1618066821.3.0.721731617634.issue43739@roundup.psfhosted.org> Shreyan Avigyan added the comment: Documentation versions older than 3.8 describes a different approach to import the module. Therefore those documentation versions are not to be messed with. I've attached the PRs for documentation versions 3.10, 3.9 and 3.8. Please anyone have a review of my PR as soon as possible. Thanking you, With Regards ---------- versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 11:36:55 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Apr 2021 15:36:55 +0000 Subject: [issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative In-Reply-To: <1617659396.43.0.525762996462.issue43737@roundup.psfhosted.org> Message-ID: <1618069015.42.0.54477948986.issue43737@roundup.psfhosted.org> Raymond Hettinger added the comment: I just checked with another Python expert who reported: """ I have never once in my whole life seen or used a negative modulo. And that says a lot given that 6 years of it was spent studying math. Including a few years in a math PhD program. Perhaps my only "surprise" on negative modulo is finding out that the classic gcd algorithm works fine if you give it negative integers. """ The reviewer inputs a unanimous. Marking this as closed. Please do not be rude and reopen again. ---------- resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 11:54:43 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Apr 2021 15:54:43 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1618070083.96.0.245840711013.issue43739@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset ea9b2d631902238acf69e51af6e3d308567b5dfd by Shreyan Avigyan in branch 'master': bpo-43739: Add type declaration Doc/extending/extending.rst example https://github.com/python/cpython/commit/ea9b2d631902238acf69e51af6e3d308567b5dfd ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 11:55:11 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 10 Apr 2021 15:55:11 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1618070111.39.0.460859362936.issue43739@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24066 pull_request: https://github.com/python/cpython/pull/25332 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 11:55:17 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 10 Apr 2021 15:55:17 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1618070117.69.0.61104304364.issue43739@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24067 pull_request: https://github.com/python/cpython/pull/25333 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 11:56:32 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Apr 2021 15:56:32 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1618070192.53.0.962244611035.issue43739@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 12:17:02 2021 From: report at bugs.python.org (Jacob Walls) Date: Sat, 10 Apr 2021 16:17:02 +0000 Subject: [issue43802] Seg fault on macOS using multiprocessing.JoinableQueue Message-ID: <1618071422.03.0.709836796295.issue43802@roundup.psfhosted.org> New submission from Jacob Walls : macOS 10.13.6 Python 3.9.2 I can consistently reproduce a seg fault while using multiprocessing.JoinableQueue in Python 3.9.2. My use case is the sheet music processing library music21. My fork includes a folder of 209 files I use to reproduce, running 3 cores, shown in the script below. (This is a subset of the over 1,000 files found here: https://github.com/MarkGotham/When-in-Rome/tree/master/Corpus/OpenScore-LiederCorpus Using this set of 1,000 files reproduces nearly every time; using the 209 files I committed to my fork was enough to reproduce about 75% of the time.) I'm a contributor to music21, so if this is an overwhelming amount of information to debug, I will gladly pare this down as much as I can or create some methods to access the multiprocessing functionality more directly. Many thanks for any assistance. pip3 install git+https://github.com/jacobtylerwalls/music21.git at bpo-investigation from music21 import corpus # suggest using a unique name each attempt lc = corpus.corpora.LocalCorpus(name='bpo-investigation') # point to the directory of files I committed to my fork for this investigation lc.addPath('/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/music21/bpo-files') # parse the files using multiprocessing # calls music21.metadata.bundles.MetadataBundle.addFromPaths() # which calls music21.metadata.caching.process_parallel() lc.save() # CTRL-C to recover from seg fault # then, wipe out the entries in .music21rc so that you can cleanly reproduce again from music21 import environment us = environment.UserSettings() us['localCorporaSettings'] = {} quit() Process: Python [31677] Path: /Library/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python Identifier: Python Version: 3.9.2 (3.9.2) Code Type: X86-64 (Native) Parent Process: Python [31674] Responsible: Python [31677] User ID: 501 Date/Time: 2021-04-10 11:21:19.294 -0400 OS Version: Mac OS X 10.13.6 (17G14042) Report Version: 12 Anonymous UUID: E7B0208A-19D6-ABDF-B3EA-3910A56B3E72 Sleep/Wake UUID: C4B83F57-6AD1-469E-82AE-88214FAA6283 Time Awake Since Boot: 140000 seconds Time Since Wake: 5900 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000100b3acd8 Exception Note: EXC_CORPSE_NOTIFY Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler [0] VM Regions Near 0x100b3acd8: --> __TEXT 00000001068bb000-00000001068bc000 [ 4K] r-x/rwx SM=COW  [/Library/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python] Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 org.python.python 0x0000000106944072 PyObject_RichCompare + 258 1 org.python.python 0x0000000106943e9b PyObject_RichCompareBool + 43 2 org.python.python 0x00000001069ce3c0 min_max + 624 3 org.python.python 0x0000000106940bab cfunction_call + 59 4 org.python.python 0x0000000106901cad _PyObject_MakeTpCall + 365 5 org.python.python 0x00000001069d865c call_function + 876 6 org.python.python 0x00000001069d5b8b _PyEval_EvalFrameDefault + 25371 7 org.python.python 0x0000000106902478 function_code_fastcall + 104 8 org.python.python 0x00000001069d85cc call_function + 732 9 org.python.python 0x00000001069d5ad2 _PyEval_EvalFrameDefault + 25186 10 org.python.python 0x00000001069d92c3 _PyEval_EvalCode + 2611 11 org.python.python 0x0000000106902401 _PyFunction_Vectorcall + 289 12 org.python.python 0x00000001069d85cc call_function + 732 13 org.python.python 0x00000001069d5ad2 _PyEval_EvalFrameDefault + 25186 14 org.python.python 0x00000001069d92c3 _PyEval_EvalCode + 2611 15 org.python.python 0x0000000106902401 _PyFunction_Vectorcall + 289 16 org.python.python 0x0000000106901b05 _PyObject_FastCallDictTstate + 293 17 org.python.python 0x00000001069026e8 _PyObject_Call_Prepend + 152 18 org.python.python 0x000000010695be85 slot_tp_init + 165 19 org.python.python 0x00000001069573d9 type_call + 345 20 org.python.python 0x0000000106901cad _PyObject_MakeTpCall + 365 21 org.python.python 0x00000001069d865c call_function + 876 22 org.python.python 0x00000001069d5af3 _PyEval_EvalFrameDefault + 25219 23 org.python.python 0x0000000106902478 function_code_fastcall + 104 24 org.python.python 0x00000001069044ba method_vectorcall + 202 25 org.python.python 0x00000001069d85cc call_function + 732 26 org.python.python 0x00000001069d5af3 _PyEval_EvalFrameDefault + 25219 27 org.python.python 0x0000000106902478 function_code_fastcall + 104 28 org.python.python 0x00000001069d85cc call_function + 732 29 org.python.python 0x00000001069d5ad2 _PyEval_EvalFrameDefault + 25186 30 org.python.python 0x0000000106902478 function_code_fastcall + 104 31 org.python.python 0x00000001069d85cc call_function + 732 32 org.python.python 0x00000001069d5ad2 _PyEval_EvalFrameDefault + 25186 33 org.python.python 0x0000000106902478 function_code_fastcall + 104 34 org.python.python 0x00000001069d85cc call_function + 732 35 org.python.python 0x00000001069d5ad2 _PyEval_EvalFrameDefault + 25186 36 org.python.python 0x00000001069d92c3 _PyEval_EvalCode + 2611 37 org.python.python 0x0000000106902401 _PyFunction_Vectorcall + 289 38 org.python.python 0x00000001069d85cc call_function + 732 39 org.python.python 0x00000001069d5ad2 _PyEval_EvalFrameDefault + 25186 40 org.python.python 0x0000000106902478 function_code_fastcall + 104 41 org.python.python 0x00000001069d85cc call_function + 732 42 org.python.python 0x00000001069d5b8b _PyEval_EvalFrameDefault + 25371 43 org.python.python 0x00000001069d92c3 _PyEval_EvalCode + 2611 44 org.python.python 0x0000000106902401 _PyFunction_Vectorcall + 289 45 org.python.python 0x00000001069d85cc call_function + 732 46 org.python.python 0x00000001069d5c21 _PyEval_EvalFrameDefault + 25521 47 org.python.python 0x00000001069d92c3 _PyEval_EvalCode + 2611 48 org.python.python 0x00000001069cf74b PyEval_EvalCode + 139 49 org.python.python 0x0000000106a21fc4 PyRun_StringFlags + 356 50 org.python.python 0x0000000106a21e15 PyRun_SimpleStringFlags + 69 51 org.python.python 0x0000000106a3e367 Py_RunMain + 1047 52 org.python.python 0x0000000106a3eaef pymain_main + 223 53 org.python.python 0x0000000106a3eceb Py_BytesMain + 43 54 libdyld.dylib 0x00007fff5a148015 start + 1 ---------- components: macOS messages: 390721 nosy: jacobtylerwalls, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Seg fault on macOS using multiprocessing.JoinableQueue type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 12:19:18 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Apr 2021 16:19:18 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1618071558.51.0.804017859136.issue43739@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 3a3c0464bd719a8cac6e52b02a3479b2834b88a4 by Miss Islington (bot) in branch '3.8': bpo-43739: Add type declaration Doc/extending/extending.rst example (GH-25332) https://github.com/python/cpython/commit/3a3c0464bd719a8cac6e52b02a3479b2834b88a4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 12:19:53 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Apr 2021 16:19:53 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1618071593.08.0.864220972766.issue43739@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 28fb2d1c4dbf16b05acfb20d457b08e049a7c83f by Miss Islington (bot) in branch '3.9': bpo-43739: Add type declaration Doc/extending/extending.rst example (GH-25333) https://github.com/python/cpython/commit/28fb2d1c4dbf16b05acfb20d457b08e049a7c83f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 12:25:49 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Apr 2021 16:25:49 +0000 Subject: [issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. In-Reply-To: <1617691036.34.0.606106237271.issue43739@roundup.psfhosted.org> Message-ID: <1618071949.33.0.629187495263.issue43739@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for the PR ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 13:24:49 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 10 Apr 2021 17:24:49 +0000 Subject: [issue43761] Documenting dataclass and namedtuple changes for structural pattern matching In-Reply-To: <1617792027.47.0.961772614464.issue43761@roundup.psfhosted.org> Message-ID: <1618075489.69.0.818920590021.issue43761@roundup.psfhosted.org> Guido van Rossum added the comment: Do you need anything from me here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 13:34:26 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 10 Apr 2021 17:34:26 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1618076066.97.0.597500478965.issue43764@roundup.psfhosted.org> Guido van Rossum added the comment: So, should we reopen this ad add the flag to suppress __match_args__ generation after all? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 13:46:38 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 10 Apr 2021 17:46:38 +0000 Subject: [issue37251] Mocking a MagicMock with a function spec results in an AsyncMock In-Reply-To: <1560348018.57.0.546920052201.issue37251@roundup.psfhosted.org> Message-ID: <1618076798.0.0.680440705031.issue37251@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 13:53:49 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 10 Apr 2021 17:53:49 +0000 Subject: [issue40701] tempfile mixes str and bytes in an inconsistent manner In-Reply-To: <1590002424.23.0.821521735552.issue40701@roundup.psfhosted.org> Message-ID: <1618077229.0.0.762512365223.issue40701@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: +24068 pull_request: https://github.com/python/cpython/pull/25334 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 13:55:21 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 10 Apr 2021 17:55:21 +0000 Subject: [issue40701] tempfile mixes str and bytes in an inconsistent manner In-Reply-To: <1590002424.23.0.821521735552.issue40701@roundup.psfhosted.org> Message-ID: <1618077321.16.0.595156655717.issue40701@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset e05a703848473b0365886dcc593cbddc46609f29 by Gregory P. Smith in branch 'master': bpo-40701: doc typo historcal -> historical (GH-25334) https://github.com/python/cpython/commit/e05a703848473b0365886dcc593cbddc46609f29 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 14:04:33 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 10 Apr 2021 18:04:33 +0000 Subject: [issue43797] Improve syntax error for invalid comparisons In-Reply-To: <1617995491.91.0.835586864843.issue43797@roundup.psfhosted.org> Message-ID: <1618077873.3.0.301820999876.issue43797@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: These are good points, let me investigate a bit ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 14:08:48 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 10 Apr 2021 18:08:48 +0000 Subject: [issue43797] Improve syntax error for invalid comparisons In-Reply-To: <1617995491.91.0.835586864843.issue43797@roundup.psfhosted.org> Message-ID: <1618078128.71.0.996510090352.issue43797@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > in invalid_named_expression, but it does not have any effect. That is because the rule for named_expressions are: named_expression[expr_ty]: | a=NAME ':=' ~ b=expression | expression !':=' | invalid_named_expression and the second alternative (| expression !':=') succeeds with an assignment, not letting the invalid_named_expression run ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 14:24:33 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 10 Apr 2021 18:24:33 +0000 Subject: [issue43797] Improve syntax error for invalid comparisons In-Reply-To: <1617995491.91.0.835586864843.issue43797@roundup.psfhosted.org> Message-ID: <1618079073.78.0.916150373202.issue43797@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I have updated the PR with: * Works for while statements (we can make it work for other kinds of statements but is a bit tricky because those have different grammar paths. We could do this in other PRs. * I changed the error message for when the LHS is a name. In other cases we still want the special error message. For example: >>> f() = 1 File "", line 1 f() = 1 ^ SyntaxError: cannot assign to function call. Maybe you meant '==' instead of '='? If we still want something different we could say: "cannot assign to ... here". The "here" makes it clear that in other places could be possible to do an assignment (for instance with names or attributes). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 14:41:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 10 Apr 2021 18:41:46 +0000 Subject: [issue43797] Improve syntax error for invalid comparisons In-Reply-To: <1617995491.91.0.835586864843.issue43797@roundup.psfhosted.org> Message-ID: <1618080106.29.0.201550909887.issue43797@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +lys.nikolaou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 14:50:47 2021 From: report at bugs.python.org (Mikhail) Date: Sat, 10 Apr 2021 18:50:47 +0000 Subject: [issue43654] IDLE: Applying settings disables tab completion In-Reply-To: <1617007235.89.0.0831829954955.issue43654@roundup.psfhosted.org> Message-ID: <1618080647.42.0.590241304556.issue43654@roundup.psfhosted.org> Mikhail added the comment: Hello again! I found another kind of bug, where the autosupplement window doesn't show up. In order for the bug to occur, you need to put a non-string value into `locals()`. Example: ``` locals()['arg'] = 123 # or locals().setdefault('arg', 123) # ^ it's okay locals()[123] = 123 # or locals().setdefault(123, 123) # ^ completion window is not shown ``` Of course, I know that "Whether or not updates to this dictionary will affect name lookups in the local scope and vice-versa not covered by any backwards compatibility guarantees" , but take a little bug :) Here is the traceback of the error ``` Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3.9/tkinter/__init__.py", line 1885, in __call__ return self.func(*args) File "/usr/lib/python3.9/idlelib/multicall.py", line 176, in handler r = l[i](event) File "/usr/lib/python3.9/idlelib/autocomplete.py", line 74, in autocomplete_event opened = self.open_completions(TAB) File "/usr/lib/python3.9/idlelib/autocomplete.py", line 146, in open_completions comp_lists = self.fetch_completions(comp_what, mode) File "/usr/lib/python3.9/idlelib/autocomplete.py", line 171, in fetch_completions return rpcclt.remotecall("exec", "get_the_completion_list", File "/usr/lib/python3.9/idlelib/rpc.py", line 219, in remotecall return self.asyncreturn(seq) File "/usr/lib/python3.9/idlelib/rpc.py", line 250, in asyncreturn return self.decoderesponse(response) File "/usr/lib/python3.9/idlelib/rpc.py", line 270, in decoderesponse raise what TypeError: '<' not supported between instances of 'int' and 'str' ``` ---------- versions: +Python 3.9 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 15:05:53 2021 From: report at bugs.python.org (Mikhail) Date: Sat, 10 Apr 2021 19:05:53 +0000 Subject: [issue43654] IDLE: Applying settings disables tab completion In-Reply-To: <1617007235.89.0.0831829954955.issue43654@roundup.psfhosted.org> Message-ID: <1618081553.95.0.118756093089.issue43654@roundup.psfhosted.org> Mikhail added the comment: I did a little experiment, and it turned out that the problem is not in the IDLE, but inside Python itself. With this case, the same behavior remains inside the terminal version of Python, and IPython also produces a similar error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 15:16:18 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 10 Apr 2021 19:16:18 +0000 Subject: [issue43761] Documenting dataclass and namedtuple changes for structural pattern matching In-Reply-To: <1617792027.47.0.961772614464.issue43761@roundup.psfhosted.org> Message-ID: <1618082178.21.0.617019619449.issue43761@roundup.psfhosted.org> Eric V. Smith added the comment: > Do you need anything from me here? No, I don't think so. Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 15:17:45 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 10 Apr 2021 19:17:45 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1618082265.14.0.594803457435.issue43764@roundup.psfhosted.org> Eric V. Smith added the comment: > So, should we reopen this ad add the flag to suppress __match_args__ generation after all? I think so, although I'm still contemplating it. I can't decide if we should also add match_arg=False to field(). Or is it good enough to just tell the user to manually set __match_args__ if they want that level of control? I think this is different enough from repr, init, etc. that we don't need to allow the per-field control, although maybe doing so would make the code more robust in terms of re-ordering or adding fields at a later date. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 15:22:58 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 10 Apr 2021 19:22:58 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1618082265.14.0.594803457435.issue43764@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: I don't think we need control at the field level here. Omitting one field is just going to cause confusion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 15:33:44 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 10 Apr 2021 19:33:44 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1618083224.49.0.387856737466.issue43764@roundup.psfhosted.org> Eric V. Smith added the comment: Okay, I'll re-open this to just add @dataclass(match_args=False). ---------- resolution: rejected -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 15:54:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 10 Apr 2021 19:54:40 +0000 Subject: [issue43792] Cython is not compatible with Python 3.10 yet: "SystemError: bad argument to internal function" In-Reply-To: <1617975873.6.0.244911999729.issue43792@roundup.psfhosted.org> Message-ID: <1618084480.47.0.26012993244.issue43792@roundup.psfhosted.org> STINNER Victor added the comment: This issue is a bug in Cython, not in Python. I close it. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 16:02:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 10 Apr 2021 20:02:12 +0000 Subject: [issue43682] Make static methods created by @staticmethod callable In-Reply-To: <1617201081.91.0.895015962683.issue43682@roundup.psfhosted.org> Message-ID: <1618084932.97.0.451159197014.issue43682@roundup.psfhosted.org> STINNER Victor added the comment: > Implement __get__ for C functions. Of course it is breaking change so we should first emit a warning. It will force all users to use staticmethod explicitly if they set a C function as a class attribute. We can also start emitting warnings for all callable non-descriptor class attributes. Well... such change would impact way more code and sounds to require a painful migration plan. Also, it doesn't prevent to make static methods callable, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 16:12:21 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 10 Apr 2021 20:12:21 +0000 Subject: [issue42737] PEP 563: drop annotations for complex assign targets In-Reply-To: <1608888770.02.0.483696766952.issue42737@roundup.psfhosted.org> Message-ID: <1618085541.15.0.682917077757.issue42737@roundup.psfhosted.org> Guido van Rossum added the comment: Hm, reading the thread it's not 100% clear to me what you are proposing to do in your patch, since different people seem to have proposed different things. I think I'd be okay if `foo[bar]: baz` and `foo.bar: baz` (etc.) didn't generate any bytecode at all. Is that what you're proposing here? If so, and assuming the code is reasonably straightforward, I'd say go ahead and make a PR (and close the old OR). In case it's relevant, I don't peronally expect Larry's clever alternative to PEP 563 to make it past the SC, and I don't care much about it (too many tricky edge cases), but it's out of my control, so don't count on that being dead just yet. And FWIW changing how annotations are represented in the AST is out of scope for this issue. (There are tricky edge cases there too.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 16:23:54 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sat, 10 Apr 2021 20:23:54 +0000 Subject: [issue43800] os.fwalk is not exposed on macOS In-Reply-To: <1618060108.26.0.358127537113.issue43800@roundup.psfhosted.org> Message-ID: <1618086234.64.0.880071203035.issue43800@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 16:26:50 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sat, 10 Apr 2021 20:26:50 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1618086410.26.0.593601937402.issue43795@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 16:56:34 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Sat, 10 Apr 2021 20:56:34 +0000 Subject: [issue43798] Add position metadata to alias AST type In-Reply-To: <1618000136.49.0.849749645286.issue43798@roundup.psfhosted.org> Message-ID: <1618088194.63.0.423146622203.issue43798@roundup.psfhosted.org> Lysandros Nikolaou added the comment: New changeset 75a06f067bd0a2687312e5f8e78f9075be76ad3a by Matthew Suozzo in branch 'master': bpo-43798: Add source location attributes to alias (GH-25324) https://github.com/python/cpython/commit/75a06f067bd0a2687312e5f8e78f9075be76ad3a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 16:57:20 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Sat, 10 Apr 2021 20:57:20 +0000 Subject: [issue43798] Add position metadata to alias AST type In-Reply-To: <1618000136.49.0.849749645286.issue43798@roundup.psfhosted.org> Message-ID: <1618088240.72.0.0279354901604.issue43798@roundup.psfhosted.org> Change by Lysandros Nikolaou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 17:00:23 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 10 Apr 2021 21:00:23 +0000 Subject: [issue43800] os.fwalk is not exposed on macOS In-Reply-To: <1618060108.26.0.358127537113.issue43800@roundup.psfhosted.org> Message-ID: <1618088423.09.0.353482960918.issue43800@roundup.psfhosted.org> Ned Deily added the comment: Thank you for the report. The issue is that the necessary operating system support for opening with a file descriptor, openat, was only first implemented in macOS 10.10 (see man 2 openat) and, up until recently, all python.org macOS binaries were built on 10.9 (or earlier) systems for compatibility across multiple operating system versions. As of Python 3.9.1, we now support "weak-linking", that is, building on newer systems but still able to run on older systems. The python.org macOS universal2 installer variant, introduced in 3.9.1, does support os.fwalk() on macOS 10.10+. (The legacy 10.9 Intel-64 only variant is still built on 10.9 but will be phased out by the release of Python 3.10.) If you build recent Python versions from source with a deployment target of 10.10 or later, you should also find a working os.fwalk(). ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 17:13:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 10 Apr 2021 21:13:36 +0000 Subject: [issue43478] Disallow Mock spec arguments from being Mocks In-Reply-To: <1615514023.14.0.0477922265442.issue43478@roundup.psfhosted.org> Message-ID: <1618089216.67.0.583381002619.issue43478@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 8.0 -> 9.0 pull_requests: +24069 pull_request: https://github.com/python/cpython/pull/25335 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 17:15:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 10 Apr 2021 21:15:35 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1618089335.76.0.404949531168.issue43770@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ecf14e6557c6e4f7af9c0d6460d31fe121c22553 by Victor Stinner in branch 'master': bpo-43770: Refactor type_new() function (GH-25325) https://github.com/python/cpython/commit/ecf14e6557c6e4f7af9c0d6460d31fe121c22553 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 17:19:05 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 10 Apr 2021 21:19:05 +0000 Subject: [issue43478] Disallow Mock spec arguments from being Mocks In-Reply-To: <1615514023.14.0.0477922265442.issue43478@roundup.psfhosted.org> Message-ID: <1618089545.97.0.321811468809.issue43478@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 6e468cb16bde483ad73c1eb13b20a08d74e30846 by Pablo Galindo in branch 'master': bpo-43478: Fix formatting of NEWS entry (GH-25335) https://github.com/python/cpython/commit/6e468cb16bde483ad73c1eb13b20a08d74e30846 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 17:32:01 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 10 Apr 2021 21:32:01 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1618090321.65.0.17312162443.issue43764@roundup.psfhosted.org> Eric V. Smith added the comment: Here's a question. If __init__ is not being generated, either because the user supplied one to this class, or if init=False is specified, should __match_args__ be generated? I think the answer should be no, since the code has no idea what the parameters to __init__ will be. But I'd like to hear from people more familiar with pattern matching. I'm working on a patch, and this is my last issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 17:36:27 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 10 Apr 2021 21:36:27 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1618090321.65.0.17312162443.issue43764@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Are there other cases where suppressing one thing affects others? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 17:42:51 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 10 Apr 2021 21:42:51 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1618090971.43.0.153384635846.issue43764@roundup.psfhosted.org> Eric V. Smith added the comment: > Are there other cases where suppressing one thing affects others? Only the complex interactions among the unsafe_hash, eq, and frozen parameters. It feels like if __init__ is not being generated, then the @dataclass code would have no idea what it should set __match_args__ to. Not that this problem isn't strictly related to the match_args=False case, it just occurred to me that it's related while I was writing the documentation. Perhaps this should be a separate issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 18:08:39 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 10 Apr 2021 22:08:39 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1618090971.43.0.153384635846.issue43764@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: There may be other reasons why `__init__` is not desired, and there's no absolute requirement that `__match_args__` must match the constructor -- only a convention. I'd say don't tie them together. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 18:09:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 10 Apr 2021 22:09:41 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1618092581.92.0.196478832761.issue43770@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24070 pull_request: https://github.com/python/cpython/pull/25336 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 18:14:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 10 Apr 2021 22:14:04 +0000 Subject: [issue43478] Disallow Mock spec arguments from being Mocks In-Reply-To: <1615514023.14.0.0477922265442.issue43478@roundup.psfhosted.org> Message-ID: <1618092844.65.0.65632772495.issue43478@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner nosy_count: 9.0 -> 10.0 pull_requests: +24071 pull_request: https://github.com/python/cpython/pull/25227 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 18:15:05 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 10 Apr 2021 22:15:05 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1618092905.38.0.988727625874.issue43764@roundup.psfhosted.org> Eric V. Smith added the comment: I can go either way. It's easy enough for the user to add their own __match_args__, so I won't link them. Here's what I have for the documentation, which is why the issue came up: - ``match_args``: If true (the default is ``True``), the ``__match_args__`` tuple will be created from the list of parameters to the generated :meth:`__init__` method (even if :meth:`__init__` is not generated, see above). If false, or if ``__match_args__`` is already defined in the class, then ``__match_args__`` will not be generated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 18:17:39 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 10 Apr 2021 22:17:39 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1618092905.38.0.988727625874.issue43764@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: LGTM ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 18:17:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 10 Apr 2021 22:17:46 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1618093066.43.0.652186601212.issue43753@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 09bbebea163fe7303264cf4069c51d4d2f22fde4 by Victor Stinner in branch 'master': bpo-43753: Add Py_Is() and Py_IsNone() functions (GH-25227) https://github.com/python/cpython/commit/09bbebea163fe7303264cf4069c51d4d2f22fde4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 18:19:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 10 Apr 2021 22:19:22 +0000 Subject: [issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions In-Reply-To: <1617734338.35.0.565380301548.issue43753@roundup.psfhosted.org> Message-ID: <1618093162.5.0.141089901199.issue43753@roundup.psfhosted.org> STINNER Victor added the comment: Carl: > Just chiming in to say that for PyPy this API would be extremely useful, because PyPy's "is" is not implementable with a pointer comparison on the C level (due to unboxing we need to compare integers, floats, etc by value). Right now, C extension code that compares pointers is subtly broken and cannot be fixed by us. Can you come with a sentence that I can put in the documentation to explain that Py_Is() is written for interoperability with other Python implementations? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 18:29:30 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 10 Apr 2021 22:29:30 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1618093770.12.0.666839637157.issue43764@roundup.psfhosted.org> Change by Eric V. Smith : ---------- keywords: +patch pull_requests: +24072 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25337 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 18:36:47 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 10 Apr 2021 22:36:47 +0000 Subject: [issue41974] Remove complex.__float__, complex.__floordiv__, etc In-Reply-To: <1602140125.13.0.506221233573.issue41974@roundup.psfhosted.org> Message-ID: <1618094207.14.0.453796016324.issue41974@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset ac05f82ad4983e3d3653ae7494c1ff62c4a265fc by DevilXD in branch 'master': bpo-41974: Remove part of the note regarding complex.__float__ (GH-25197) https://github.com/python/cpython/commit/ac05f82ad4983e3d3653ae7494c1ff62c4a265fc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 18:45:59 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 10 Apr 2021 22:45:59 +0000 Subject: [issue43802] Seg fault on macOS using multiprocessing.JoinableQueue In-Reply-To: <1618071422.03.0.709836796295.issue43802@roundup.psfhosted.org> Message-ID: <1618094759.64.0.0510786409117.issue43802@roundup.psfhosted.org> Ned Deily added the comment: Thanks for providing a detailed and relatively simple-to-run test case for such a complicated failure. Not totally surprising for what appears to likely be a race condition, I have been unable to reproduce it under several macOS environments including in a 10.13.6 VM with multiple cores and under 11.2.3. I'm not sure if this would be expected to affect the results but I did receive multiple "WARNING: Could not import wedge: Error in getting DynamicWedges" messages when running the test case. Doing a quick exam of the installed set up, it appears that there is no attempt to use multiprocessing's "fork" method which is known to be problematic on macOS so that's a plus. And there don't appear to be any extension modules so the test case is pure Python, eliminating other likely suspects. One question that does come to mind is exactly which version of Python 3.9.2 you are testing with; can you provide the results of: /path/to/python3.9 -c 'import sys;print(sys.version)' ? Searching bugs.python.org, I see a few open issues with segfaults in PyObject_RichCompare but nothing that leaps out as being obviously similar. If it were possible to reproduce the segfault in other environments, like with 3.9.4 or on newer versions of macOS or on a current Linux platform, that would help to confirm the issue. Even better would be to be able to reproduce the issue while running a current Python 3.9 built with --with-pydebug on; unfortunately, we don't normally provide pre-built debug binaries on python.org. And, of course, running in debug mode could affect the rece condition, if that is indeed the issue. ---------- nosy: +davin, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 19:58:13 2021 From: report at bugs.python.org (mkocher) Date: Sat, 10 Apr 2021 23:58:13 +0000 Subject: [issue43776] Popen with shell=True yield mangled repr output In-Reply-To: <1617907343.84.0.247878991461.issue43776@roundup.psfhosted.org> Message-ID: <1618099093.38.0.0908874521983.issue43776@roundup.psfhosted.org> Change by mkocher : ---------- keywords: +patch pull_requests: +24073 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25338 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 20:19:47 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 11 Apr 2021 00:19:47 +0000 Subject: [issue39125] Type signature of @property not shown in help() In-Reply-To: <1577115600.68.0.0436692507171.issue39125@roundup.psfhosted.org> Message-ID: <1618100387.17.0.807892327737.issue39125@roundup.psfhosted.org> Raymond Hettinger added the comment: > Currently there is no way to tell if the *attribute* > is read-only, read-write or write-only. Read-only is segregated in the help() output. >>> class A: @property def computed_field(self): 'An example property' >>> help(A) Help on class A in module __main__: class A(builtins.object) | Readonly properties defined here: | | computed_field | An example property | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 20:22:36 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 11 Apr 2021 00:22:36 +0000 Subject: [issue43654] IDLE: Applying settings disables tab completion In-Reply-To: <1617007235.89.0.0831829954955.issue43654@roundup.psfhosted.org> Message-ID: <1618100556.18.0.258317109683.issue43654@roundup.psfhosted.org> Terry J. Reedy added the comment: I presume '^' means 'hit Tab'. The underlying Python problem is that namespaces are conceptually mappings of names (identifiers), a subset of strings, to objects. Python specifies that the global namespace is a dict, which I believe could mean a dict subclass restricting keys to strings or maybe even identifier strings. But CPython, at least, uses built-in dicts, allowing any hashable as a key. Ditto for attribute dicts and locals. At toplevel, locals() is globals(). (There are a few semi-same uses to non-identifier string completions. >>> globals()["3.1459"] = None >>> 3.1459 # 3 and >>> globals()['itertools.permutations'] = None >>> itertools.permutations # itert But not recommended or, I believe, guaranteed.) Completion lists are sorted. In original Python, sorting was universal. That was broken for a few types by 2.7. In 3.x, comparisons and hence sorting were restricted. Decoding the traceback. Completion requests are handled in the IDLE interface process. The remotecall in autocomplete.fetch_completions tries to execute fetch_completions in the user execution process. That fails trying to sort the list of globals. The exception is returned with the tag "CALLEXC". In rpc, decoderesponse filters out various failures and raises the returned exception. IDLE could filter out non-strings from global and attribute dicts or display a special message. Or do nothing on the basis that putting non-strings in namespaces and making them unsortable is either a user bug or a consenting adults, do at your own risk and deal with the consequences operation. Built-in dir() sorts keys and hence it and anything using it fails. >>> globals()[1]=None >>> dir() Traceback (most recent call last): File "", line 1, in dir() TypeError: '<' not supported between instances of 'int' and 'str' Indeed, fetch_completions uses dir(), and this is where it fails. Vars() does not sort, allowing one to see the full contents. >>> vars() {'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': , '__spec__': None, '__annotations__': {}, '__builtins__': , 1: None} If one edits a file after putting a non-string in globals, the TypeError is not displayed. Instead, tab completion is silently disabled and spaces are inserted, just as after applying settings. This is not good and so a point in favor of doing something. ---------- versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 20:31:57 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 11 Apr 2021 00:31:57 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1618101117.31.0.480492142642.issue43475@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 20:55:03 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 11 Apr 2021 00:55:03 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1618102503.63.0.2766344633.issue40137@roundup.psfhosted.org> Raymond Hettinger added the comment: State lookups and indirections were added to most performance sensitive code part of the _functools_state *state; state = get_functools_state_by_type(Py_TYPE(self)); if (state == NULL) { return NULL; } key = lru_cache_make_key(state, args, kwds, self->typed); I think it should be removed for Python3.10. Right now, it is of zero value to users (actually, negative value). ---------- nosy: +pablogsal, rhettinger, serhiy.storchaka priority: normal -> high resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 20:57:41 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 11 Apr 2021 00:57:41 +0000 Subject: [issue43801] Carriage Return problem in version v3.9.0:9cf6752 In-Reply-To: <1618061569.38.0.494837003994.issue43801@roundup.psfhosted.org> Message-ID: <1618102661.13.0.0197339235288.issue43801@roundup.psfhosted.org> Steven D'Aprano added the comment: Hello Santosh, In future, please don't post images or screen shots of text, please copy and paste the text of your code. You have something similar to this: >>> text = "short line\rvery long line of text" >>> print(text) very long line of text but you haven't told us what you expected to see instead or why you think it is a bug. It isn't a bug, it is working correctly. Consider this version: >>> text = "a very long line of text\rshort line" >>> print(text) short lineg line of text Printing a carriage return returns the print location to the start of the line. To start a new line, you need a newline \n. This is most commonly used for updating the display in place. Try running this code: import time def demo(): for i in range(1, 101): print("\rUpdating record %d" % i, end='', flush=True) time.sleep(0.1) print() ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 21:20:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 11 Apr 2021 01:20:14 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1618104014.27.0.574774269911.issue40137@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Here are some benchmarks of using lru_cache in 3.9 and 3.10 (PGO/LTO/CPU isol): ? ./python -m pyperf timeit "from functools import lru_cache; f = lru_cache(lambda: 42)" "f()" --compare-to ../3.9/python /home/pablogsal/github/3.9/python: ..................... 2.60 us +- 0.05 us /home/pablogsal/github/cpython/python: ..................... 2.74 us +- 0.06 us Mean +- std dev: [/home/pablogsal/github/3.9/python] 2.60 us +- 0.05 us -> [/home/pablogsal/github/cpython/python] 2.74 us +- 0.06 us: 1.06x slower Given that lru_cache is normally used to seek speed, this is a bit unfortunate :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 21:22:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 11 Apr 2021 01:22:34 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1618104154.45.0.568349425823.issue40137@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: As a Release Manager, I am not very happy with a 6% reduction in speed, especially in these functions. Can someone take a look to see if we can get the performance closer to Python 3.9? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 21:28:45 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 11 Apr 2021 01:28:45 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1618104525.16.0.365367966288.issue43764@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 750f484752763fe9ac1d6455780aabcb67f25508 by Eric V. Smith in branch 'master': bpo-43764: Add match_args=False parameter to dataclass decorator and to make_dataclasses function. (GH-25337) https://github.com/python/cpython/commit/750f484752763fe9ac1d6455780aabcb67f25508 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 21:29:17 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 11 Apr 2021 01:29:17 +0000 Subject: [issue43764] Turning off generation of __match_args__ for dataclasses In-Reply-To: <1617800841.7.0.162045441395.issue43764@roundup.psfhosted.org> Message-ID: <1618104557.98.0.289140678619.issue43764@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 21:54:33 2021 From: report at bugs.python.org (Tal Hayon) Date: Sun, 11 Apr 2021 01:54:33 +0000 Subject: [issue43803] ctypes string_at/wstring_at Message-ID: <1618106073.56.0.0553736134144.issue43803@roundup.psfhosted.org> New submission from Tal Hayon : string_at and wstring_at first argument in docs in address but actually in code is ptr. See https://github.com/python/cpython/blob/750f484752763fe9ac1d6455780aabcb67f25508/Lib/ctypes/__init__.py#L513 https://github.com/python/cpython/blob/750f484752763fe9ac1d6455780aabcb67f25508/Lib/ctypes/__init__.py#L525 Noticed this when going over stubtest errors in typeshed. See pull request https://github.com/python/typeshed/pull/5204 ---------- components: ctypes messages: 390761 nosy: talhayon1 priority: normal severity: normal status: open title: ctypes string_at/wstring_at type: behavior versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 21:55:15 2021 From: report at bugs.python.org (Tal Hayon) Date: Sun, 11 Apr 2021 01:55:15 +0000 Subject: [issue43803] ctypes string_at/wstring_at bad argument name In-Reply-To: <1618106073.56.0.0553736134144.issue43803@roundup.psfhosted.org> Message-ID: <1618106115.17.0.878569182724.issue43803@roundup.psfhosted.org> Change by Tal Hayon : ---------- title: ctypes string_at/wstring_at -> ctypes string_at/wstring_at bad argument name _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 21:59:52 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 11 Apr 2021 01:59:52 +0000 Subject: [issue43803] ctypes string_at/wstring_at bad argument name In-Reply-To: <1618106073.56.0.0553736134144.issue43803@roundup.psfhosted.org> Message-ID: <1618106392.75.0.65955768609.issue43803@roundup.psfhosted.org> Jelle Zijlstra added the comment: It's a bit worse: the actual name is "ptr", the function docstrings say "addr", and the documentation (https://docs.python.org/3.9/library/ctypes.html#ctypes.string_at) has "address". I'd favor updating them all to say "ptr", because changing the name of the runtime parameter would risk breaking users' code. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 22:17:09 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Sun, 11 Apr 2021 02:17:09 +0000 Subject: [issue43772] Minor repr error in typing.TypeVar.__ror__() In-Reply-To: <1617880169.66.0.0347480943951.issue43772@roundup.psfhosted.org> Message-ID: <1618107429.73.0.582820581351.issue43772@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- keywords: +patch nosy: +Jelle Zijlstra nosy_count: 4.0 -> 5.0 pull_requests: +24074 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/25339 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 22:57:11 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 11 Apr 2021 02:57:11 +0000 Subject: [issue43783] Make ParamSpec.args/kwargs more useful objects In-Reply-To: <1617933966.5.0.0238313977797.issue43783@roundup.psfhosted.org> Message-ID: <1618109831.65.0.397444696109.issue43783@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 522433601a5c64603dab3d733f41a5db39d237eb by Jelle Zijlstra in branch 'master': bpo-43783: Add ParamSpecArgs/Kwargs (GH-25298) https://github.com/python/cpython/commit/522433601a5c64603dab3d733f41a5db39d237eb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 22:57:21 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 11 Apr 2021 02:57:21 +0000 Subject: [issue43783] Make ParamSpec.args/kwargs more useful objects In-Reply-To: <1617933966.5.0.0238313977797.issue43783@roundup.psfhosted.org> Message-ID: <1618109841.73.0.00714832695269.issue43783@roundup.psfhosted.org> Change by Guido van Rossum : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 23:00:09 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 11 Apr 2021 03:00:09 +0000 Subject: [issue43772] Minor repr error in typing.TypeVar.__ror__() In-Reply-To: <1617880169.66.0.0347480943951.issue43772@roundup.psfhosted.org> Message-ID: <1618110009.06.0.678631394108.issue43772@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 9045919bfa820379a66ea67219f79ef6d9ecab49 by Jelle Zijlstra in branch 'master': bpo-43772: Fix TypeVar.__ror__ (GH-25339) https://github.com/python/cpython/commit/9045919bfa820379a66ea67219f79ef6d9ecab49 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 23:00:19 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 11 Apr 2021 03:00:19 +0000 Subject: [issue43772] Minor repr error in typing.TypeVar.__ror__() In-Reply-To: <1617880169.66.0.0347480943951.issue43772@roundup.psfhosted.org> Message-ID: <1618110019.3.0.437613337145.issue43772@roundup.psfhosted.org> Change by Guido van Rossum : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 10 23:38:25 2021 From: report at bugs.python.org (Jacob Walls) Date: Sun, 11 Apr 2021 03:38:25 +0000 Subject: [issue43802] Seg fault on macOS using multiprocessing.JoinableQueue In-Reply-To: <1618071422.03.0.709836796295.issue43802@roundup.psfhosted.org> Message-ID: <1618112305.84.0.887262394137.issue43802@roundup.psfhosted.org> Jacob Walls added the comment: Thanks for this detailed reply. I reproduced on Python 3.9.4 on the same iMac from my original report running macOS 10.13.6, but with much lesser frequency (I wouldn't use the word "consistently" anymore). I tried on a MacBook Pro with worn-out hardware running a newer OS (10.15.4) and could not reproduce the issue there. I also built cPython (Python 3.10.0a7+ (heads/master:ac05f82ad4, Apr 10 2021, 20:16:36) [Clang 10.0.0 (clang-1000.10.44.4)] on darwin) using --with-pydebug and ran the test case a few times on the good-hardware iMac, and observed the file parsing (predictably) slow to a crawl, but no reproduction of the segfault. This leads me to believe that, yes, this is a race condition I'm encountering on fast hardware. Possibly related to issue-25769, since music21 makes heavy use of weakrefs and since music21.metadata.caching.MetadataCachingJob.run() calls gc.collect(). Perhaps I can look into engineering a minimal test case based on that discussion, involving a deliberately expensive __eq__() call. To answer your original question: my first report on 3.9.2 was on this specific version: 3.9.2 (v3.9.2:1a79785e3e, Feb 19 2021, 09:06:10) \n[Clang 6.0 (clang-600.0.57)] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 00:51:42 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 11 Apr 2021 04:51:42 +0000 Subject: [issue43751] await anext() returns None when default is given In-Reply-To: <1617724814.14.0.517501509303.issue43751@roundup.psfhosted.org> Message-ID: <1618116702.14.0.568852221823.issue43751@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset dfb45323ce8a543ca844c311e32c994ec9554c1b by Dennis Sweeney in branch 'master': bpo-43751: Fix anext() bug where it erroneously returned None (GH-25238) https://github.com/python/cpython/commit/dfb45323ce8a543ca844c311e32c994ec9554c1b ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 00:52:03 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 11 Apr 2021 04:52:03 +0000 Subject: [issue43751] await anext() returns None when default is given In-Reply-To: <1617724814.14.0.517501509303.issue43751@roundup.psfhosted.org> Message-ID: <1618116723.78.0.526145103523.issue43751@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 00:55:50 2021 From: report at bugs.python.org (Tim Peters) Date: Sun, 11 Apr 2021 04:55:50 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1618116950.87.0.676555684184.issue43475@roundup.psfhosted.org> Tim Peters added the comment: I agree hashing a NaN acting like the generic object hash (return rotated address) is a fine workaround, although I'm not convinced it addresses a real-world problem ;-) But why not? It might. But that's for CPython. I'm loathe to guarantee anything about this in the language itself. If an implementation wants `__contains__()` tests to treat all NaNs as equal instead, or consider them equal only if "is" holds, or never considers them equal, or resolves equality as bitwise representation equality ... all are fine by me. There's no truly compelling case to made for any of them, although "never considers them equal" is least "surprising" given the insane requirement that NaNs never compare equal under IEEE rules, and that Python-the-language doesn't formally support different notions of equality in different contexts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 01:01:51 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 11 Apr 2021 05:01:51 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1618117311.81.0.366782696998.issue40137@roundup.psfhosted.org> Raymond Hettinger added the comment: Serhiy, do you think we could substitute the "self" instance of functools._lru_cache_wrapper object for the kw_mark? It already compares on identity, so it should be just a fast as the instance of object(). AFAICT, kwd_mark doesn't have to be unique across instances. To avoid creating a GC only circular reference, we could skip the INCREF, leaving the object weakly referencing itself. In bounded_lru_cache_wrapper(), the other state reference reference is in creating a new lru_list_elem. There are several things we can do about this. 1) move the expensive get_functools_state_by_type() inside the code block that creates new links, so that it won't affect a full cache. 2) create a per-instance variable that references the per-type lru_list_elem. This has the downside of making each lru_cache instance slightly larger. 3) prepopulate the lru_cache with maxsize links. This simplifies the code and makes it slightly faster but will waste spaces for use cases that never actually fill-up the cache lazily, also it slows down start-up time. Ideally, these PRs should be reverted for Python 3.10. AFAICT, no user of functools will benefit in any way from these changes. Presumably, that is why there are no tests. It is all cost and no benefit. BTW, the 6% timing is likely understated because the loop is executed entirely in L1 cache or the CPU's recent write cache rather than real world conditions where there is fierce competition of the limited 32kb L1 data cache. Just looking at the total number of sequentially dependent memory accesses, I expect that the actual cost is more than a third. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 01:08:39 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 11 Apr 2021 05:08:39 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1618117719.18.0.473869674983.issue40137@roundup.psfhosted.org> Raymond Hettinger added the comment: FWIW, I've only looked at the lru_cache() code. Someone should go through all the PyModule_GetState calls to see if they are on a critical path. AFAICT a huge number of these changes were applied without regard to whether or not they occurred on an existing fast path. This is a considerable number of clock cycles for a type lookup that used to be almost cost free. Whether it is high or low impact greatly depends on whether the surrounding code was doing a lot of work or very little work. In thin functions, the incremental costs will be higher. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 01:27:17 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 11 Apr 2021 05:27:17 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1618118837.6.0.0949170636892.issue43475@roundup.psfhosted.org> Raymond Hettinger added the comment: > I'm loathe to guarantee anything about this in the language itself. There aren't language any guarantees being proposed. Letting the hash depend on the object id just helps avoid quadratic behavior. Making float('NaN') a singleton is also perfectly reasonable behavior for an immutable type. Neither is a guaranteed behavior, just a convenient one. > I'm not convinced it addresses a real-world problem Maybe yes, maybe no. I would hope that NaNs arising from bogus calculations would be rare. OTOH, they are commonly used for missing values in Pandas where internal dict/set operations abound. Either way, I would like to close off a trivially easy way to invoke quadratic behavior unexpectedly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 01:38:41 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Sun, 11 Apr 2021 05:38:41 +0000 Subject: [issue32466] Fix missing test coverage for fractions.Fraction.__new__ In-Reply-To: <1514732035.0.0.467229070634.issue32466@psf.upfronthosting.co.za> Message-ID: <1618119521.7.0.190144626855.issue32466@roundup.psfhosted.org> Sergey B Kirpichev added the comment: Mark, I think the Lib/fractions.py now is covered by tests in the test_fractions.py. $ ./python -m venv ~/venv/cpython $ . ~/venv/cpython/bin/activate $ pip install coverage Collecting coverage Using cached coverage-5.5-cp310-cp310-manylinux1_x86_64.whl (238 kB) Installing collected packages: coverage Successfully installed coverage-5.5 $ python -m coverage run --source=fractions --branch Lib/test/test_fractions.py ............................... ---------------------------------------------------------------------- Ran 31 tests in 0.040s OK $ ~/venv/cpython/bin/python -m coverage report Name Stmts Miss Branch BrPart Cover ---------------------------------------------------- Lib/fractions.py 299 0 126 0 100% ---------------------------------------------------- TOTAL 299 0 126 0 100% My guess: this issue can be closed. ---------- nosy: +Sergey.Kirpichev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 01:47:36 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 11 Apr 2021 05:47:36 +0000 Subject: [issue43776] Popen with shell=True yield mangled repr output In-Reply-To: <1617907343.84.0.247878991461.issue43776@roundup.psfhosted.org> Message-ID: <1618120056.76.0.872536951962.issue43776@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith nosy: +gregory.p.smith versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 04:05:16 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 11 Apr 2021 08:05:16 +0000 Subject: [issue32466] Fix missing test coverage for fractions.Fraction.__new__ In-Reply-To: <1514732035.0.0.467229070634.issue32466@psf.upfronthosting.co.za> Message-ID: <1618128316.99.0.993487231442.issue32466@roundup.psfhosted.org> Mark Dickinson added the comment: Thanks, Sergey! Agreed that this can be closed. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 04:10:00 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 11 Apr 2021 08:10:00 +0000 Subject: [issue43776] Popen with shell=True yield mangled repr output In-Reply-To: <1617907343.84.0.247878991461.issue43776@roundup.psfhosted.org> Message-ID: <1618128600.94.0.594547881313.issue43776@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 04:48:49 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Apr 2021 08:48:49 +0000 Subject: [issue43002] Exception chaining accepts exception classes In-Reply-To: <1611323561.1.0.365445213907.issue43002@roundup.psfhosted.org> Message-ID: <1618130929.12.0.997405665126.issue43002@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24075 pull_request: https://github.com/python/cpython/pull/25341 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 04:49:04 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Apr 2021 08:49:04 +0000 Subject: [issue43002] Exception chaining accepts exception classes In-Reply-To: <1611323561.1.0.365445213907.issue43002@roundup.psfhosted.org> Message-ID: <1618130944.1.0.319987542324.issue43002@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24076 pull_request: https://github.com/python/cpython/pull/25342 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 06:51:41 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 11 Apr 2021 10:51:41 +0000 Subject: [issue43804] Add more info about building C/C++ Extensions on Windows using MSVC Message-ID: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> New submission from Shreyan Avigyan : In the context of Docs/extending/windows.rst, the command provided, for compiling the source code and linking the libraries to create a DLL, only works for Python 32-bit versions. But the documentation doesn't inform anything about that. The PR linked with this issue adds a note section with the text :- """ The above commands are only applicable for Python 32-bit versions. """ This PR is against the master branch and if accepted, it needs to be backported to all the previous supported versions. Kindly have a review of my PR. Thanking you, With Regards ---------- assignee: docs at python components: Documentation messages: 390773 nosy: docs at python, shreyanavigyan priority: normal severity: normal status: open title: Add more info about building C/C++ Extensions on Windows using MSVC versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 07:28:56 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 11 Apr 2021 11:28:56 +0000 Subject: [issue43804] Add more info about building C/C++ Extensions on Windows using MSVC In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1618140536.53.0.600998009608.issue43804@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- keywords: +patch pull_requests: +24077 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25343 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 07:52:50 2021 From: report at bugs.python.org (Marko) Date: Sun, 11 Apr 2021 11:52:50 +0000 Subject: [issue43805] multiprocessing.Queue hangs when process on other side dies Message-ID: <1618141970.93.0.19986621438.issue43805@roundup.psfhosted.org> New submission from Marko : When child process dies unexpectedly Queue.get waits indefinitely. Here is example: import os import signal import multiprocessing def child_func(qa, qb): input = qa.get() print('Child received: ', input) os.kill(os.getpid(), signal.SIGTERM) qb.put('B') exit(0) qa = multiprocessing.Queue() qb = multiprocessing.Queue() process = multiprocessing.Process(target=child_func, args=(qa, qb)) process.start() qa.put('A') try: input = qb.get() print('Parent received: ', input) except Exception as ex: print(ex) process.join() exit(0) ---------- components: Library (Lib) messages: 390774 nosy: kormang priority: normal severity: normal status: open title: multiprocessing.Queue hangs when process on other side dies versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 07:57:23 2021 From: report at bugs.python.org (Marko) Date: Sun, 11 Apr 2021 11:57:23 +0000 Subject: [issue22393] multiprocessing.Pool shouldn't hang forever if a worker process dies unexpectedly In-Reply-To: <1410474786.78.0.264797717105.issue22393@psf.upfronthosting.co.za> Message-ID: <1618142243.26.0.676059407755.issue22393@roundup.psfhosted.org> Marko added the comment: I've created issue43805. I think it would be better to have universal solution. And not specific ones, like in issue9205. Haven't checked the PRs, though. ---------- nosy: +kormang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 08:00:51 2021 From: report at bugs.python.org (PEW's Corner) Date: Sun, 11 Apr 2021 12:00:51 +0000 Subject: [issue43751] await anext() returns None when default is given In-Reply-To: <1617724814.14.0.517501509303.issue43751@roundup.psfhosted.org> Message-ID: <1618142451.78.0.0159611382192.issue43751@roundup.psfhosted.org> PEW's Corner added the comment: Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 08:03:48 2021 From: report at bugs.python.org (Marko) Date: Sun, 11 Apr 2021 12:03:48 +0000 Subject: [issue43805] multiprocessing.Queue hangs when process on other side dies In-Reply-To: <1618141970.93.0.19986621438.issue43805@roundup.psfhosted.org> Message-ID: <1618142628.34.0.998115132691.issue43805@roundup.psfhosted.org> Marko added the comment: Possible duplicate of issue22393 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 08:17:49 2021 From: report at bugs.python.org (Marko) Date: Sun, 11 Apr 2021 12:17:49 +0000 Subject: [issue43806] asyncio.StreamReader hangs when reading from pipe and other process exits unexpectedly Message-ID: <1618143469.5.0.154132734242.issue43806@roundup.psfhosted.org> New submission from Marko : When using asyncio to read from pipe, if process on the other side of pipe crashes read operation hangs indefinitely. Example: import asyncio import contextlib import os import signal import time prx, ctx = os.pipe() read_transport = None read_stream = None async def _connect_read(loop): global read_transport global read_stream stream_reader = asyncio.StreamReader() def protocol_factory(): return asyncio.StreamReaderProtocol(stream_reader) rpipe = os.fdopen(prx, mode='r') transport, _ = await loop.connect_read_pipe(protocol_factory, rpipe) read_transport = transport read_stream = stream_reader def close(): read_transport.close() @contextlib.asynccontextmanager async def connect(): try: loop = asyncio.get_event_loop() await _connect_read(loop) yield finally: close() cpid = os.fork() if cpid == 0: os.kill(os.getpid(), signal.SIGKILL) os.write(ctx, b'A') time.sleep(10.0) else: async def read_from_child(): async with connect(): input = await read_stream.read(1) print('Parent received: ', input) asyncio.run(read_from_child()) ---------- components: Library (Lib) messages: 390778 nosy: kormang priority: normal severity: normal status: open title: asyncio.StreamReader hangs when reading from pipe and other process exits unexpectedly versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 08:18:32 2021 From: report at bugs.python.org (Marko) Date: Sun, 11 Apr 2021 12:18:32 +0000 Subject: [issue43805] multiprocessing.Queue hangs when process on other side dies In-Reply-To: <1618141970.93.0.19986621438.issue43805@roundup.psfhosted.org> Message-ID: <1618143512.19.0.156880744825.issue43805@roundup.psfhosted.org> Marko added the comment: Somewhat related issue43806 with asyncio.StreamReader ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 08:18:48 2021 From: report at bugs.python.org (Marko) Date: Sun, 11 Apr 2021 12:18:48 +0000 Subject: [issue22393] multiprocessing.Pool shouldn't hang forever if a worker process dies unexpectedly In-Reply-To: <1410474786.78.0.264797717105.issue22393@psf.upfronthosting.co.za> Message-ID: <1618143528.72.0.342094933009.issue22393@roundup.psfhosted.org> Marko added the comment: Somewhat related issue43806 with asyncio.StreamReader ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 08:25:48 2021 From: report at bugs.python.org (Unknown Retired Guy) Date: Sun, 11 Apr 2021 12:25:48 +0000 Subject: [issue43807] JSONDecodeError: Extra Data Raised on Long Valid JSON Message-ID: <1618143948.32.0.607083588761.issue43807@roundup.psfhosted.org> New submission from Unknown Retired Guy : https://i.ibb.co/tYqBsQ8/pico-hard.png That JSONDecodeError: Extra Data is raised when the Valid JSON is too long or over than 25000 bytes, I don't know what caused this, can you fix it? The code and the traceback is in that picture/link above in this comment and the long valid JSON is provided here. The Below picture/link proof that it's a valid JSON: https://i.ibb.co/fGytRFC/946.png ---------- components: Library (Lib) files: pico-hard.json messages: 390781 nosy: filipetaleshipolitosoares73 priority: normal severity: normal status: open title: JSONDecodeError: Extra Data Raised on Long Valid JSON type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file49953/pico-hard.json _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 09:26:15 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 11 Apr 2021 13:26:15 +0000 Subject: [issue42967] [CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator In-Reply-To: <1611068809.96.0.58823274544.issue42967@roundup.psfhosted.org> Message-ID: <1618147575.56.0.884012803383.issue42967@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset b38601d49675d90e1ee6faa47f7adaeca992d02d by Ken Jin in branch 'master': bpo-42967: coerce bytes separator to string in urllib.parse_qs(l) (#24818) https://github.com/python/cpython/commit/b38601d49675d90e1ee6faa47f7adaeca992d02d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 09:26:50 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Apr 2021 13:26:50 +0000 Subject: [issue42967] [CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator In-Reply-To: <1611068809.96.0.58823274544.issue42967@roundup.psfhosted.org> Message-ID: <1618147610.86.0.306196375062.issue42967@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 13.0 -> 14.0 pull_requests: +24078 pull_request: https://github.com/python/cpython/pull/25344 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 09:26:58 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Apr 2021 13:26:58 +0000 Subject: [issue42967] [CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator In-Reply-To: <1611068809.96.0.58823274544.issue42967@roundup.psfhosted.org> Message-ID: <1618147618.15.0.293016127401.issue42967@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24079 pull_request: https://github.com/python/cpython/pull/25345 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 09:37:45 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 11 Apr 2021 13:37:45 +0000 Subject: [issue43807] JSONDecodeError: Extra Data Raised on Long Valid JSON In-Reply-To: <1618143948.32.0.607083588761.issue43807@roundup.psfhosted.org> Message-ID: <1618148265.69.0.612039287072.issue43807@roundup.psfhosted.org> Ronald Oussoren added the comment: There is a block of NUL bytes at the end of the JSON data structure The output of "od -c pico-hard.json" ends with: 0046340 s e c t i o n N o t e s " : [ ] 0046360 , " t y p e O f S e c t i o n " 0046400 : 0 } ] } \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 0046420 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 * 0071600 \0 \0 \0 \0 \0 \0 \0 \0 \0 0071611 Note that there is a block of "\0" entries after the closing "}". The file can be parsed correctly after stripping these NUL bytes. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 09:49:42 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Apr 2021 13:49:42 +0000 Subject: [issue42967] [CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator In-Reply-To: <1611068809.96.0.58823274544.issue42967@roundup.psfhosted.org> Message-ID: <1618148982.22.0.691343945764.issue42967@roundup.psfhosted.org> miss-islington added the comment: New changeset 6ec2fb42f93660810952388e5c4018c197c17c8c by Miss Islington (bot) in branch '3.9': bpo-42967: coerce bytes separator to string in urllib.parse_qs(l) (GH-24818) https://github.com/python/cpython/commit/6ec2fb42f93660810952388e5c4018c197c17c8c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 10:29:44 2021 From: report at bugs.python.org (Zackery Spytz) Date: Sun, 11 Apr 2021 14:29:44 +0000 Subject: [issue41661] os.path.relpath does not document ValueError on Windows with different drives In-Reply-To: <1598681705.55.0.359436315051.issue41661@roundup.psfhosted.org> Message-ID: <1618151384.67.0.241346694827.issue41661@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 7.0 -> 8.0 pull_requests: +24080 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25346 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 10:53:35 2021 From: report at bugs.python.org (JimmyCarlos) Date: Sun, 11 Apr 2021 14:53:35 +0000 Subject: [issue43808] Add .isfloat() method to str Message-ID: <1618152815.46.0.189413617211.issue43808@roundup.psfhosted.org> New submission from JimmyCarlos : Hello Python Community! One feature I think would be helpful would be a method to see if a str can be safely converted into a float. Currently, this is not doable without a long regex or a try-except block, as numbers like "-3.52" contain non-numeric symbols. My suggestion is to make a new boolean method on the str class. Code-wise, it would behave quite similarly to this code: def isfloat(s:str) -> bool: try: float(s) return True except: return False I appreciate your feedback, so what do you all think? ---------- messages: 390785 nosy: JimmyCarlos priority: normal severity: normal status: open title: Add .isfloat() method to str type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 11:03:27 2021 From: report at bugs.python.org (Ethan Furman) Date: Sun, 11 Apr 2021 15:03:27 +0000 Subject: [issue43430] Exception raised when attempting to create Enum via functional API In-Reply-To: <1615165107.75.0.80264384575.issue43430@roundup.psfhosted.org> Message-ID: <1618153407.89.0.957990054992.issue43430@roundup.psfhosted.org> Ethan Furman added the comment: Looking at your example I see that you are using an enum as the `type` parameter -- the purpose of `type` is to provide a mixin data type, such as `int` or `str`, not another enum. What is your use-case? Typically, subclassing EnumMeta is not needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 11:38:55 2021 From: report at bugs.python.org (Dmitry Marakasov) Date: Sun, 11 Apr 2021 15:38:55 +0000 Subject: [issue43792] Cython is not compatible with Python 3.10 yet: "SystemError: bad argument to internal function" In-Reply-To: <1617975873.6.0.244911999729.issue43792@roundup.psfhosted.org> Message-ID: <1618155535.29.0.67801572801.issue43792@roundup.psfhosted.org> Dmitry Marakasov added the comment: > This issue is a bug in Cython, not in Python. I close it. This is correct, thanks! The problem is gone with git master version of cython. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 11:41:25 2021 From: report at bugs.python.org (Ethan Furman) Date: Sun, 11 Apr 2021 15:41:25 +0000 Subject: [issue39102] Increase Enum performance In-Reply-To: <1576810108.88.0.911071266859.issue39102@roundup.psfhosted.org> Message-ID: <1618155685.88.0.0504884771791.issue39102@roundup.psfhosted.org> Change by Ethan Furman : ---------- stage: patch review -> needs patch versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 13:18:34 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 11 Apr 2021 17:18:34 +0000 Subject: [issue42737] PEP 563: drop annotations for complex assign targets In-Reply-To: <1608888770.02.0.483696766952.issue42737@roundup.psfhosted.org> Message-ID: <1618161514.67.0.819080313809.issue42737@roundup.psfhosted.org> Batuhan Taskaya added the comment: > I think I'd be okay if `foo[bar]: baz` and `foo.bar: baz` (etc.) didn't generate any bytecode at all. Is that what you're proposing here? If so, and assuming the code is reasonably straightforward, I'd say go ahead and make a PR (and close the old OR). The thread raised some concerns regarding the verification of the lhs (the target), so the PR 23952 generates code for the lhs but omits the annotation part. > And FWIW changing how annotations are represented in the AST is out of scope for this issue. (There are tricky edge cases there too.) Agreed, it already has a separate issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 13:20:48 2021 From: report at bugs.python.org (Matthew Suozzo) Date: Sun, 11 Apr 2021 17:20:48 +0000 Subject: [issue37251] Mocking a MagicMock with a function spec results in an AsyncMock In-Reply-To: <1560348018.57.0.546920052201.issue37251@roundup.psfhosted.org> Message-ID: <1618161648.98.0.660460314751.issue37251@roundup.psfhosted.org> Change by Matthew Suozzo : ---------- pull_requests: +24081 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25347 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 13:24:54 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 11 Apr 2021 17:24:54 +0000 Subject: [issue43808] Add .isfloat() method to str In-Reply-To: <1618152815.46.0.189413617211.issue43808@roundup.psfhosted.org> Message-ID: <1618161894.97.0.570422067374.issue43808@roundup.psfhosted.org> Eric V. Smith added the comment: Wouldn't the next thing you do be to convert it to a float, so you'd call float() twice? I think you'd be better off just catching the exception yourself, and using the result of float(). I'm opposed to such a simple function being a member of str or in the stdlib. In all of my years using Python with plenty of floats, I've never needed this function. The usual suggestion with such short functions it to just add them to your own utility library. ---------- components: +Interpreter Core nosy: +eric.smith versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 13:46:54 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 11 Apr 2021 17:46:54 +0000 Subject: [issue43808] Add .isfloat() method to str In-Reply-To: <1618152815.46.0.189413617211.issue43808@roundup.psfhosted.org> Message-ID: <1618163214.56.0.427016186349.issue43808@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 15:14:37 2021 From: report at bugs.python.org (Matej Cepl) Date: Sun, 11 Apr 2021 19:14:37 +0000 Subject: [issue42967] [CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator In-Reply-To: <1611068809.96.0.58823274544.issue42967@roundup.psfhosted.org> Message-ID: <1618168477.54.0.0880673798052.issue42967@roundup.psfhosted.org> Matej Cepl added the comment: > Did you upstream fixes for those packages? Of course we did. Upstream first! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 15:19:38 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 11 Apr 2021 19:19:38 +0000 Subject: [issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring In-Reply-To: <1618106073.56.0.0553736134144.issue43803@roundup.psfhosted.org> Message-ID: <1618168778.22.0.471032842483.issue43803@roundup.psfhosted.org> Shreyan Avigyan added the comment: > I'd favor updating them all to say "ptr", because changing the name of the runtime parameter would risk breaking users' code. I also certainly agree with that. Moreover, the documentation and docstring uses the name "address" and "addr" respectively which are misleading because it is asking for ctypes.c_char_p or ctypes.c_wchar_p which are C pointer types, it is not asking for the address of instances of ctypes.c_char_p or ctypes.c_wchar_p. Therefore a change in the documentation and docstring is required. Note - If this issue is confirmed then I'll submit a PR to apply the change as described in this issue. ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python, shreyanavigyan title: ctypes string_at/wstring_at bad argument name -> ctypes string_at/wstring_at - bad argument name used in docs and in docstring _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 15:23:52 2021 From: report at bugs.python.org (Pierre-Alain Moret) Date: Sun, 11 Apr 2021 19:23:52 +0000 Subject: [issue42916] Support for DICOM image file format in imghdr module In-Reply-To: <1610497726.98.0.199039272928.issue42916@roundup.psfhosted.org> Message-ID: <1618169032.86.0.668627717653.issue42916@roundup.psfhosted.org> Pierre-Alain Moret added the comment: The DICOM format is indeed very widely used in the medical field and for me it deserves to be added in stdlib. I do not see why it is more specific than rast format which is included. Moreover it should be easy to add because even if the complete format is very complex with all the medical modalities, its enough to test the first 132 bytes of image that should be: b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00DICM' Of course, its not enough to test that we have a valid DICOM image, but it is also not the case with other formats. For example, with this simple corrupted jpeg image : imghdr.what('dummy', h= b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01\xff\xd9') 'jpeg' is returned. That is why I strongly advocate in favor of adding DICOM format in imghdr. Pierre-Alain Moret ---------- nosy: +pam _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 15:57:56 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 11 Apr 2021 19:57:56 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1618171076.35.0.163574951646.issue41486@roundup.psfhosted.org> Gregory P. Smith added the comment: I left some review comments on the PR. I like the algorithm being used. I don't really _like_ that this is a .h file acting as a C template to inject effectively the same static code into each module that wants to use it... Which I think is the concern Victor is expressing in a comment above. I could live with this PR as is because it is at least easy to maintain. But I anticipate we'll want to refactor it in the future to be shared code instead of a copy compiled per module. This is the kind of thing that also makes sense to be usable outside of just these modules. Compression modules for the other popular compression algorithms currently not in the stdlib but available on PyPI shouldn't need to reinvent this wheel on their own without reason. (lzo, brotli, zstandard, no doubt others...) It is also worth looking at those to see if they've already implemented something like this and how it differs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 16:03:38 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 11 Apr 2021 20:03:38 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1618171418.82.0.468772812074.issue41486@roundup.psfhosted.org> Gregory P. Smith added the comment: looking around it appears you've proposed an independent implementation of this for the thir party brotli module? https://github.com/google/brotli/pull/856 that is what i mean about making this reusable :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 17:16:08 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 11 Apr 2021 21:16:08 +0000 Subject: [issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring In-Reply-To: <1618106073.56.0.0553736134144.issue43803@roundup.psfhosted.org> Message-ID: <1618175768.97.0.746342683311.issue43803@roundup.psfhosted.org> Eryk Sun added the comment: > the name "address" and "addr" respectively which are misleading > because it is asking for ctypes.c_char_p or ctypes.c_wchar_p which > are C pointer types string_at() and wstring_at() take a c_void_p value. This can be initialized by an integer (i.e. an address), bytes, str, or any ctypes pointer, array, or byref() reference. Additionally it works with an object that has a compatible _as_parameter_ attribute, e.g.: >>> class A: ... _as_parameter_ = b'spam' ... >>> ctypes.string_at(A) b'spam' If the docstring is change to use "ptr", for string_at() it can succinctly say the following: "Return the byte string at void *ptr." For wstring_at(), replace "byte string" with "wide-character string" or "wchar_t string". Specifying the type matters because it depends on the platform. Windows uses a 16-bit wchar_t, and the memory will be interpreted as UTF-16 (e.g. surrogate pairs), whereas other platforms use a 32-bit wchar_t, and the memory will be interpreted as UTF-32. For example: Windows: >>> ascii(ctypes.wstring_at(b'\x00\xd8\x00\xdc')) "'\\U00010000'" Linux: >>> try: ctypes.wstring_at(b'\x00\xd8\x00\xdc') ... except Exception as e: print(e) ... character U+dc00d800 is not in range [U+0000; U+10ffff] ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 17:32:40 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 11 Apr 2021 21:32:40 +0000 Subject: [issue43785] Remove RLock from BZ2File In-Reply-To: <1617946936.07.0.338866506245.issue43785@roundup.psfhosted.org> Message-ID: <1618176760.94.0.838419135783.issue43785@roundup.psfhosted.org> Gregory P. Smith added the comment: I'm not worried about compatibility on this for 3.10. Nobody realistically expects to be able to have multiple readers from a single BZ2File stream. They don't for the gzip or lzma equivalents. That isn't even a normal thing to do on an actual file. Lets go forward with this for 3.10betas and see if anyone even notices. I doubt they will. But the addition of __iter__ deferring to iter(self._buffer) belongs in its own PR and issue and should be done for all of bz2, gzip, and lzma all at once. I've edited the PR branch to remove __iter__ and cleanup a couple of minor nits. ---------- assignee: -> gregory.p.smith nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 17:35:59 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 11 Apr 2021 21:35:59 +0000 Subject: [issue43785] Remove RLock from BZ2File In-Reply-To: <1617946936.07.0.338866506245.issue43785@roundup.psfhosted.org> Message-ID: <1618176959.14.0.771191827099.issue43785@roundup.psfhosted.org> Gregory P. Smith added the comment: I see you're already tracking __iter__ in https://bugs.python.org/issue43787, perfect! :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 17:36:32 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 11 Apr 2021 21:36:32 +0000 Subject: [issue43787] Optimize BZ2File, GzipFile, and LZMAFile __iter__ method. In-Reply-To: <1617958183.01.0.290245206759.issue43787@roundup.psfhosted.org> Message-ID: <1618176992.05.0.212432859145.issue43787@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 17:36:27 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 11 Apr 2021 21:36:27 +0000 Subject: [issue43787] Optimize BZ2File, GzipFile, and LZMAFile __iter__ method. In-Reply-To: <1617958183.01.0.290245206759.issue43787@roundup.psfhosted.org> Message-ID: <1618176987.7.0.12513768438.issue43787@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 17:39:01 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 11 Apr 2021 21:39:01 +0000 Subject: [issue43574] Regression in overallocation for literal list initialization in v3.9+ In-Reply-To: <1616293914.75.0.599644741052.issue43574@roundup.psfhosted.org> Message-ID: <1618177141.81.0.725827028934.issue43574@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 17:49:23 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 11 Apr 2021 21:49:23 +0000 Subject: [issue43809] Improve mismatching parentheses error Message-ID: <1618177763.07.0.220270371715.issue43809@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Consider the following program: ( a + b + c ] ) The current error is: >>> ( a + b + c ] ) File "", line 1 ( a + b + c ] ) ^ SyntaxError: closing parenthesis ']' does not match opening parenthesis '(' Which is not bad, but the problem is not that the "(" is not closed (it is) but that the "]" was never opened. An improvement would be: >>> ( a + b + c ] ) File "", line 1 ( a + b + c ] ) ^ SyntaxError: closing parenthesis ']' was never opened ---------- messages: 390798 nosy: pablogsal priority: normal severity: normal status: open title: Improve mismatching parentheses error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 17:56:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 11 Apr 2021 21:56:00 +0000 Subject: [issue43809] Improve mismatching parentheses error In-Reply-To: <1618177763.07.0.220270371715.issue43809@roundup.psfhosted.org> Message-ID: <1618178160.66.0.963031240942.issue43809@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +24082 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25348 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 17:57:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 11 Apr 2021 21:57:12 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1618178232.05.0.514700564431.issue43770@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 53114ffef1d4facf9aa5545e711abbbda66f672a by Victor Stinner in branch 'master': bpo-43770: Refactor PyType_Ready() function (GH-25336) https://github.com/python/cpython/commit/53114ffef1d4facf9aa5545e711abbbda66f672a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 18:15:11 2021 From: report at bugs.python.org (Shantanu) Date: Sun, 11 Apr 2021 22:15:11 +0000 Subject: [issue43798] Add position metadata to alias AST type In-Reply-To: <1618000136.49.0.849749645286.issue43798@roundup.psfhosted.org> Message-ID: <1618179311.02.0.0444975007804.issue43798@roundup.psfhosted.org> Shantanu added the comment: FYI, probably unavoidable, but this appears to have broken pytest https://github.com/pytest-dev/pytest/issues/8539 ---------- nosy: +hauntsaninja _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 18:17:47 2021 From: report at bugs.python.org (Eli Schwartz) Date: Sun, 11 Apr 2021 22:17:47 +0000 Subject: [issue43282] Add split install targets to install tests separately from lib In-Reply-To: <1613882945.82.0.411428525027.issue43282@roundup.psfhosted.org> Message-ID: <1618179467.5.0.363263751601.issue43282@roundup.psfhosted.org> Eli Schwartz added the comment: I started to look into this, but it seems like I'd need a bit of duplication to handle byte compiling the installed files in two different Makefile targets. The alternatives are templating, automake style, or GNU make'isms like the $(call) function, or possibly running `$(MAKE) bytecompile` to do all byte-compilation in a shareable submake. Do any of these sound good? Any other thoughts? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 18:21:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 11 Apr 2021 22:21:28 +0000 Subject: [issue43682] Make static methods created by @staticmethod callable In-Reply-To: <1617201081.91.0.895015962683.issue43682@roundup.psfhosted.org> Message-ID: <1618179688.16.0.691459134549.issue43682@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 553ee2781a37ac9d2068da3e1325a780ca79e21e by Victor Stinner in branch 'master': bpo-43682: Make staticmethod objects callable (GH-25117) https://github.com/python/cpython/commit/553ee2781a37ac9d2068da3e1325a780ca79e21e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 18:23:03 2021 From: report at bugs.python.org (Eli Schwartz) Date: Sun, 11 Apr 2021 22:23:03 +0000 Subject: [issue43617] Missing definition in configure.ac causing autoreconf to create damaged configure script In-Reply-To: <1616597538.33.0.0386305243834.issue43617@roundup.psfhosted.org> Message-ID: <1618179783.33.0.761411058307.issue43617@roundup.psfhosted.org> Eli Schwartz added the comment: Hmm, I've seen this accomplished elsewhere using m4_pattern_forbid, which would make autoreconf fail with the following message: ``` configure.ac:17: error: possibly undefined macro: AX_C_FLOAT_WORDS_BIGENDIAN If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure.ac:5586: error: possibly undefined macro: AX_CHECK_OPENSSL autoreconf: error: /usr/bin/autoconf failed with exit status: 1 ``` Example patch attached. ---------- nosy: +eschwartz Added file: https://bugs.python.org/file49954/0001-configure-use-m4-forbidden-patterns-to-ensure-autore.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 18:27:08 2021 From: report at bugs.python.org (Evgeny) Date: Sun, 11 Apr 2021 22:27:08 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1618180028.42.0.416129379865.issue14243@roundup.psfhosted.org> Evgeny added the comment: Dear all, how can we realistically move this forward? This issue is 9 years old by now. Everybody from the discussion agrees, this is an issue. There were several proposals made, all of them slightly different. 7 months ago I have implemented solution, pretty much similar to the one, proposed by eryksun is the https://bugs.python.org/msg376656 https://github.com/python/cpython/pull/22431 So far I received no comments. I am not quite familiar with the decision making in Python development. Who can take a decision which way to go? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 18:51:08 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 11 Apr 2021 22:51:08 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1618181468.46.0.658470761745.issue14243@roundup.psfhosted.org> Jason R. Coombs added the comment: At least I and Ethan and Martin have expressed a desire for the default, preferred usage work well in a portable environment. Requiring `delete_on_close=False` violates that expectation. How about something like this instead: - Add an `delete_when=None`, also accepting "close" and "exit". - "close" means delete on close. - "exit" means delete when the context manager exits. - When `delete_when` is None, the default behavior is selected (currently `close`). - At some point (now or in the future), raise a deprecation warning if `delete_when=None` is passed (require it to be explicit) and explain that the default in the future will be `delete_when="exit"`. - Document that passing an explicit `None` for `delete_when` is not supported (don't do it). - In a release after the deprecation has been released, change the default to `delete_when="exit"` and drop support for `None`. Note, this deprecation approach could be enacted with "delete_on_close" and boolean values, but I prefer more explicit values for shorter-named variables. This approach would allow a user to opt in to the future behavior which has the desired effect of preferring the default behavior (in as little as two releases). I might be tempted to create a `backports` package for users of earlier Python versions to get the future behavior sooner. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 19:00:33 2021 From: report at bugs.python.org (Julian Berman) Date: Sun, 11 Apr 2021 23:00:33 +0000 Subject: [issue22282] ipaddress module accepts octal formatted IPv4 addresses in IPv6 addresses In-Reply-To: <1409132006.4.0.222962839937.issue22282@psf.upfronthosting.co.za> Message-ID: <1618182033.22.0.497181670465.issue22282@roundup.psfhosted.org> Change by Julian Berman : ---------- nosy: +Julian _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 19:01:03 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 11 Apr 2021 23:01:03 +0000 Subject: [issue43798] Add position metadata to alias AST type In-Reply-To: <1618000136.49.0.849749645286.issue43798@roundup.psfhosted.org> Message-ID: <1618182063.17.0.833808516816.issue43798@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > FYI, probably unavoidable, but this appears to have broken pytest https://github.com/pytest-dev/pytest/issues/8539 What's the problem? alias objects *have* lineno argument: >>> print(ast.dump(ast.parse("from x import y"), include_attributes=True, indent=4)) Module( body=[ ImportFrom( module='x', names=[ alias( name='y', lineno=1, col_offset=14, end_lineno=1, end_col_offset=15)], level=0, lineno=1, col_offset=0, end_lineno=1, end_col_offset=15)], type_ignores=[]) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 19:01:06 2021 From: report at bugs.python.org (Julian Berman) Date: Sun, 11 Apr 2021 23:01:06 +0000 Subject: [issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1618182066.38.0.303593761872.issue36384@roundup.psfhosted.org> Change by Julian Berman : ---------- nosy: +Julian _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 21:41:22 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 12 Apr 2021 01:41:22 +0000 Subject: [issue1662581] the re module can perform poorly: O(2**n) versus O(n**2) Message-ID: <1618191682.51.0.0940800178704.issue1662581@roundup.psfhosted.org> Gregory P. Smith added the comment: https://pypi.org/project/pyre2/ seems to be a maintained version of that for use on modern Python interpreters. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 21:45:43 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 12 Apr 2021 01:45:43 +0000 Subject: [issue43686] re.match appears to hang with certain combinations of pattern and string In-Reply-To: <1617246696.22.0.947636964181.issue43686@roundup.psfhosted.org> Message-ID: <1618191943.11.0.594601744026.issue43686@roundup.psfhosted.org> Gregory P. Smith added the comment: Try something like https://pypi.org/project/pyre2/ or _maybe_ https://pypi.org/project/regex/ (I didn't think that one tried to do a breadth first approach though so maybe not) I'm marking this a duplicate of the age old issue around degenerate patterns in re. ---------- nosy: +gregory.p.smith resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> the re module can perform poorly: O(2**n) versus O(n**2) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 21:49:02 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 12 Apr 2021 01:49:02 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1618181468.46.0.658470761745.issue14243@roundup.psfhosted.org> Message-ID: Ethan Furman added the comment: On 4/11/2021 3:51 PM, Jason R. Coombs wrote: > Jason R. Coombs added the comment: > > At least I and Ethan and Martin have expressed a desire for the default, preferred usage work well in a portable environment. Requiring `delete_on_close=False` violates that expectation. My opinion is that no extra flags are necessary. The default of deleting on close is fine, unless a context manager is active -- in which case delete on CM exit. Note that an internal flag will be needed to track the status of being in a context manager, but nothing besides behavior in that edge case would change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 22:22:57 2021 From: report at bugs.python.org (Shakeeb Alireza) Date: Mon, 12 Apr 2021 02:22:57 +0000 Subject: [issue34309] Trouble when reloading extension modules. In-Reply-To: <1533144973.44.0.56676864532.issue34309@psf.upfronthosting.co.za> Message-ID: <1618194177.59.0.407117836588.issue34309@roundup.psfhosted.org> Shakeeb Alireza added the comment: In my project (https://github.com/shakfu/py-js), which provides an embedded python3 interpreter to Max/MSP in the form of an 'external' plugin, I have faced similar issues of being unable to reload extension modules, namely numpy, without reliably crashing the host application, in this case Max. Being able to reload extension modules cleanly is absolutely critical especially in case when python is embedded. Since Numpy is one of the key reasons why people would want to use Python, such a constraint, in this embedded context, becomes a sufficient reason not to use Python at all. For example, I have recently taken note of similar frustration with this exact same issue from the VCV project (https://community.vcvrack.com/t/blowing-the-dust-off-python-in-prototype/12909). I quote: "I should add that CPython and more notably numpy do not support nor advise a complete restart of the interpreter in embedded scenarios without restarting the host process which kind of defeats our purpose in Prototype. At that point I think I can safely take a step back and turn to the dev community looking for suggestions. Should we throw away numpy, or even python, altogether?" ---------- nosy: +shakfu versions: +Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 22:26:19 2021 From: report at bugs.python.org (Ma Lin) Date: Mon, 12 Apr 2021 02:26:19 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1618194379.51.0.29002140315.issue41486@roundup.psfhosted.org> Ma Lin added the comment: > I don't really _like_ that this is a .h file acting as a C template to inject > effectively the same static code into each module that wants to use it... > Which I think is the concern Victor is expressing in a comment above. I think so too. The defines of BOB_BUFFER_TYPE/BOB_SIZE_TYPE/BOB_SIZE_MAX are ugly. If put the core code together, these defines can be put in a thin wrapper in _bz2module.c/_lzmamodule.c/zlibmodule.c files. This can be done now, but it's ideal to improve it more thoroughly in 3.11. _PyBytesWriter has different behavior, user may access existing data as plain data, which is impossible for _BlocksOutputBuffer. An API/code can be carefully designed, efficient/flexible/elegant, then the code may be used in some sites in CPython. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 23:19:20 2021 From: report at bugs.python.org (Alan) Date: Mon, 12 Apr 2021 03:19:20 +0000 Subject: [issue28708] Low FD_SETSIZE limit on Windows In-Reply-To: <1479250358.07.0.768722440644.issue28708@psf.upfronthosting.co.za> Message-ID: <1618197560.97.0.603719059135.issue28708@roundup.psfhosted.org> Alan added the comment: The big innovation with poll() is that it takes an array of descriptors like a normal function. https://www.geometrydash.me/ ---------- nosy: +alanpreston _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 23:36:15 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 12 Apr 2021 03:36:15 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1618198575.59.0.787599623167.issue14243@roundup.psfhosted.org> Eryk Sun added the comment: > My opinion is that no extra flags are necessary. The default of > deleting on close is fine, unless a context manager is active -- in > which case delete on CM exit. There is a use case of needing to let another thread or process open the temporary file while in a given context, but ensure that the file is deleted when the context exits. The O_TEMPORARY flag is not generally compatible with this use case, since very few programs in Windows share delete access. Python's open() doesn't, not without an opener. So this case needs to omit the O_TEMPORARY flag and rely on the context manager to delete the file. If there's no need to reopen the file in another thread or process, then using O_TEMPORARY is preferred. In this case, the file will deleted even if the current process crashes or gets terminated (e.g. by a job object). NamedTemporaryFile() in Windows could switch to relying on the context manager to delete the file. But also add an implementation of TemporaryFile() in Windows that uses O_TEMPORARY. Surely if a script has no need to reopen a temporary file, then it shouldn't care what the file's name is. For example: def TemporaryFile(mode='w+b', buffering=-1, encoding=None, newline=None, suffix=None, prefix=None, dir=None, *, errors=None): if "b" not in mode: encoding = _io.text_encoding(encoding) prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir) flags = _bin_openflags | _os.O_TEMPORARY (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type) try: _os.unlink(name) return _io.open(fd, mode, buffering=buffering, newline=newline, encoding=encoding, errors=errors) except: _os.close(fd) raise Prior to Windows 10 (tested back to Python 3.2 in Windows 2000), the unlink(name) call will leave the file linked in `dir`, but trying to access it with a new open will fail with an access-denied error. A file that's in a deleted state is only accessible by existing opens. The downside is that the temporary file can't be moved to another directory except by an existing open (e.g. via SetFileInformationByHandle: FileRenameInfo). Another process that wants to delete `dir` won't be able to move the file out of the way. It shouldn't be an issue, however, if the file is created in the user's temp directory. In Windows 10, NTFS implements a POSIX delete that also moves the file into a reserved system directory, so it doesn't remain linked in `dir` and thus doesn't prevent deleting `dir`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 23:55:01 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 12 Apr 2021 03:55:01 +0000 Subject: [issue43744] enum: Adding a member named _classname__ raises IndexError In-Reply-To: <1617700585.14.0.506924714072.issue43744@roundup.psfhosted.org> Message-ID: <1618199701.86.0.451201597189.issue43744@roundup.psfhosted.org> Change by Ethan Furman : ---------- keywords: +patch pull_requests: +24084 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25349 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 11 23:56:24 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 12 Apr 2021 03:56:24 +0000 Subject: [issue43744] enum: Adding a member named _classname__ raises IndexError In-Reply-To: <1617700585.14.0.506924714072.issue43744@roundup.psfhosted.org> Message-ID: <1618199784.41.0.712754663669.issue43744@roundup.psfhosted.org> Ethan Furman added the comment: It should not be an error at all, but a False result. PR created. ---------- assignee: -> ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 00:09:08 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 12 Apr 2021 04:09:08 +0000 Subject: [issue42454] Move slice creation to the compiler for constants In-Reply-To: <1606237897.31.0.957567165008.issue42454@roundup.psfhosted.org> Message-ID: <1618200548.75.0.00871119849192.issue42454@roundup.psfhosted.org> Andrei Kulakov added the comment: One possibility for this being a breaking change is this scenario: some codebase may have logic that takes a list and uses a slice operation on it; in a rare circumstance the list is really a dict and a TypeError is caught upstream and dealt with; with this change it will no longer be caught/logged and the dict will be unexpectedly modified. It might also be hard to debug. I don't remember seeing such code but it's conceivable. The change might still be worth it for performance improvement though - I'm not sure. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 00:13:06 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 12 Apr 2021 04:13:06 +0000 Subject: [issue42248] Raised exception in Enum keeping user objects alive unnecessarily In-Reply-To: <1604350009.17.0.208770748804.issue42248@roundup.psfhosted.org> Message-ID: <1618200786.44.0.344446882096.issue42248@roundup.psfhosted.org> Change by Ethan Furman : ---------- keywords: +patch pull_requests: +24085 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25350 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 00:50:21 2021 From: report at bugs.python.org (hai shi) Date: Mon, 12 Apr 2021 04:50:21 +0000 Subject: [issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak In-Reply-To: <1565194972.64.0.065323919799.issue37788@roundup.psfhosted.org> Message-ID: <1618203021.76.0.532722394606.issue37788@roundup.psfhosted.org> hai shi added the comment: I created PR 25226. It's a another way to solve this problem. Compared to PR 15175, `_set_sentinel()` don't need to receive any params :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 01:24:45 2021 From: report at bugs.python.org (Rene Visser) Date: Mon, 12 Apr 2021 05:24:45 +0000 Subject: [issue43810] os.path.abspath returns invalid path (resolves symbolic link) Message-ID: <1618205085.71.0.310776377701.issue43810@roundup.psfhosted.org> New submission from Rene Visser : According to the python documentation os.path.abspath() does *not* resolve symbolic links. This however does not always seem to be true causing an invalid path return by abspath. This could potentially be exploited to crash python applications. Example for bug reproduction on a linux terminal: 1. create a sub-directory "bug_abspath" 2. enter the sub-dir "bug_abspath" 3. create a symbolic link "local_link" onto the current dir using: "ln -s . local_link" 4. open python session and import os and enter the following: 5. path_correct = os.path.abspath('./../bug_abspath') # returns correct path 6. path_invalid = os.path.abspath('local_link/../bug_abspath') # returns invalid path with wrongly resolved "local_link" >From step 5 the correct/valid path is returned, from step 6 abspath returns an invalid path that is non-existing (contains non-existing "bug_abspath/bug_abspath" string. I consider this behavior incorrect and interpret it as a bug in the abspath routine which is not allowed to resolve the symbolic link "local_link". (Note os.path.realpath works as expected but is unwanted by me). Tested on OS: linux ubuntu 20.04, CentOS 7.8 PY: python 3.7 and 3.8 Thanks for any help, best wishes, Rene ---------- components: IO messages: 390818 nosy: rvisser priority: normal severity: normal status: open title: os.path.abspath returns invalid path (resolves symbolic link) type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 01:39:28 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 12 Apr 2021 05:39:28 +0000 Subject: [issue41515] typing.get_type_hints generates KeyError In-Reply-To: <1597067038.73.0.335844562656.issue41515@roundup.psfhosted.org> Message-ID: <1618205968.14.0.247977200156.issue41515@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: I guess more libraries will experience this with `from __future__ import annotations` becoming default in Python 3.10 and they switch to get_type_hints. https://github.com/sphinx-doc/sphinx/issues/8084 https://github.com/facebook/TestSlide/issues/296 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 01:40:06 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 12 Apr 2021 05:40:06 +0000 Subject: [issue43810] os.path.abspath returns invalid path (resolves symbolic link) In-Reply-To: <1618205085.71.0.310776377701.issue43810@roundup.psfhosted.org> Message-ID: <1618206006.96.0.200287455575.issue43810@roundup.psfhosted.org> Eryk Sun added the comment: In POSIX, os.path.abspath(p) is normpath(join(os.getcwd(), p)). normpath() doesn't touch the filesystem, and it's documented that its "string manipulation may change the meaning of a path that contains symbolic links". You can use os.path.realpath() to resolve symbolic links in a path. ---------- nosy: +eryksun resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 01:47:00 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 12 Apr 2021 05:47:00 +0000 Subject: [issue43785] Remove RLock from BZ2File In-Reply-To: <1617946936.07.0.338866506245.issue43785@roundup.psfhosted.org> Message-ID: <1618206420.37.0.134231460558.issue43785@roundup.psfhosted.org> Inada Naoki added the comment: New changeset cc2ffcdfd78df3a18edae60df81b2f1b044b1634 by Inada Naoki in branch 'master': bpo-43785: Improve BZ2File performance by removing RLock (GH-25299) https://github.com/python/cpython/commit/cc2ffcdfd78df3a18edae60df81b2f1b044b1634 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 01:57:40 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 12 Apr 2021 05:57:40 +0000 Subject: [issue43785] Remove RLock from BZ2File In-Reply-To: <1617946936.07.0.338866506245.issue43785@roundup.psfhosted.org> Message-ID: <1618207060.41.0.476039542259.issue43785@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +24086 pull_request: https://github.com/python/cpython/pull/25351 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 02:02:01 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 12 Apr 2021 06:02:01 +0000 Subject: [issue41515] typing.get_type_hints generates KeyError In-Reply-To: <1597067038.73.0.335844562656.issue41515@roundup.psfhosted.org> Message-ID: <1618207321.1.0.93787316021.issue41515@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- pull_requests: +24087 pull_request: https://github.com/python/cpython/pull/25352 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 02:15:24 2021 From: report at bugs.python.org (Dominic Davis-Foster) Date: Mon, 12 Apr 2021 06:15:24 +0000 Subject: [issue42059] TypedDict(...) as function does not respect "total" when setting __required_keys__ and __optional_keys__ In-Reply-To: <1602926609.93.0.947551036861.issue42059@roundup.psfhosted.org> Message-ID: <1618208124.55.0.924335058263.issue42059@roundup.psfhosted.org> Dominic Davis-Foster added the comment: I have backported this to typing_extensions in https://github.com/python/typing/pull/778 On Python 3.9.2 and above typing.TypedDict is used, otherwise it's typing_extensions.TypedDict. ---------- nosy: +domdfcoding _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 02:16:53 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 12 Apr 2021 06:16:53 +0000 Subject: [issue43787] Optimize BZ2File, GzipFile, and LZMAFile __iter__ method. In-Reply-To: <1617958183.01.0.290245206759.issue43787@roundup.psfhosted.org> Message-ID: <1618208213.73.0.851173069436.issue43787@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +24088 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25353 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 03:15:36 2021 From: report at bugs.python.org (Ma Lin) Date: Mon, 12 Apr 2021 07:15:36 +0000 Subject: [issue43787] Optimize BZ2File, GzipFile, and LZMAFile __iter__ method. In-Reply-To: <1617958183.01.0.290245206759.issue43787@roundup.psfhosted.org> Message-ID: <1618211736.7.0.397363413614.issue43787@roundup.psfhosted.org> Change by Ma Lin : ---------- nosy: +malin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 04:01:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 08:01:45 +0000 Subject: [issue43680] Remove undocumented io.OpenWrapper and _pyio.OpenWrapper In-Reply-To: <1617195561.83.0.0407283597649.issue43680@roundup.psfhosted.org> Message-ID: <1618214505.46.0.341829613066.issue43680@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24089 pull_request: https://github.com/python/cpython/pull/25354 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 04:07:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 08:07:43 +0000 Subject: [issue43682] Make static methods created by @staticmethod callable In-Reply-To: <1617201081.91.0.895015962683.issue43682@roundup.psfhosted.org> Message-ID: <1618214863.23.0.617433936757.issue43682@roundup.psfhosted.org> STINNER Victor added the comment: Ok, static methods are now callable in Python 3.10. Moreover, @staticmethod and @classmethod copy attributes from the callable object, same as functools.wraps(). Thanks to this change, I was able to propose to PR 25354 "bpo-43680: _pyio.open() becomes a static method". Serhiy: if you want to "Implement __get__ for C functions", I suggest you opening a new issue for that. To be honest, I'm a little bit scared by the migration path, I expect that it will require to fix *many* projects. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 04:16:06 2021 From: report at bugs.python.org (igo95862) Date: Mon, 12 Apr 2021 08:16:06 +0000 Subject: [issue39774] Missing documentation on how to make package executable as script In-Reply-To: <1582797188.41.0.932040725136.issue39774@roundup.psfhosted.org> Message-ID: <1618215366.43.0.785322681337.issue39774@roundup.psfhosted.org> Change by igo95862 : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 04:27:33 2021 From: report at bugs.python.org (Mikhail) Date: Mon, 12 Apr 2021 08:27:33 +0000 Subject: [issue43654] IDLE: Applying settings disables tab completion In-Reply-To: <1617007235.89.0.0831829954955.issue43654@roundup.psfhosted.org> Message-ID: <1618216053.86.0.353644232441.issue43654@roundup.psfhosted.org> Mikhail added the comment: I also checked this behavior in Jython and IPython, and there errors are explicitly caused when putting/calling such values (I also checked on MicroPython online version, everything just hangs there). For IPython I created an issue on their Github, I'm thinking of doing the same for Jython. Since you're my guide to the world of bugs and issues for CPython, any advice on whether to create a separate issue here or leave it as is? P.S. I like the Python community, everyone here is kind and helpful :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 04:28:05 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 12 Apr 2021 08:28:05 +0000 Subject: [issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch In-Reply-To: <1597551049.14.0.0578030464715.issue41561@roundup.psfhosted.org> Message-ID: <1618216085.09.0.535081648751.issue41561@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24090 pull_request: https://github.com/python/cpython/pull/25355 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 04:38:07 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 12 Apr 2021 08:38:07 +0000 Subject: [issue43811] Run GHA CI with multiple OpenSSL versions Message-ID: <1618216687.81.0.190201617408.issue43811@roundup.psfhosted.org> New submission from Christian Heimes : CI only tests one OpenSSL version, but Python supports multiple versions of OpenSSL. OpenSSL 1.0.2, 1.1.0, 1.1.1, and 3.0.0 have different APIs and behave differently. We should run minimal tests with all major OpenSSL versions to ensure that Python compiles and works with supported versions. This will slow down CI a bit. I figured out how to include ccache to speed up compilation a lot. With populated ccache configure + make takes less than 30 seconds instead of 90 seconds. I also noticed that GHA action configuration compiles Python with custom OpenSSL but fails to set rpath / LD_LIBRARY_PATH. I think this means that we compile with custom OpenSSL but actual tests use OSS' OpenSSL libraries. ---------- assignee: christian.heimes components: SSL, Tests messages: 390825 nosy: christian.heimes priority: normal severity: normal status: open title: Run GHA CI with multiple OpenSSL versions type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 04:43:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 08:43:01 +0000 Subject: [issue37804] Remove Thread.isAlive in Python 3.9 In-Reply-To: <1565364852.41.0.891047152339.issue37804@roundup.psfhosted.org> Message-ID: <1618216981.53.0.62326323193.issue37804@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9825bdfbd5c966abf1f1b7264992d722a94c9613 by Jelle Zijlstra in branch 'master': bpo-43723: Deprecate camelCase aliases from threading (GH-25174) https://github.com/python/cpython/commit/9825bdfbd5c966abf1f1b7264992d722a94c9613 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 04:43:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 08:43:01 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1618216981.43.0.710912694957.issue43723@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9825bdfbd5c966abf1f1b7264992d722a94c9613 by Jelle Zijlstra in branch 'master': bpo-43723: Deprecate camelCase aliases from threading (GH-25174) https://github.com/python/cpython/commit/9825bdfbd5c966abf1f1b7264992d722a94c9613 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 04:45:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 08:45:01 +0000 Subject: [issue43680] Remove undocumented io.OpenWrapper and _pyio.OpenWrapper In-Reply-To: <1617195561.83.0.0407283597649.issue43680@roundup.psfhosted.org> Message-ID: <1618217101.65.0.437836767988.issue43680@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 77d668b1221d0f8c3e9d6b6199f67aaf3c45f040 by Victor Stinner in branch 'master': bpo-43680: _pyio.open() becomes a static method (GH-25354) https://github.com/python/cpython/commit/77d668b1221d0f8c3e9d6b6199f67aaf3c45f040 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 05:33:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 09:33:46 +0000 Subject: [issue43680] Remove undocumented io.OpenWrapper and _pyio.OpenWrapper In-Reply-To: <1617195561.83.0.0407283597649.issue43680@roundup.psfhosted.org> Message-ID: <1618220026.26.0.841071061276.issue43680@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24091 pull_request: https://github.com/python/cpython/pull/25357 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 05:39:25 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 12 Apr 2021 09:39:25 +0000 Subject: [issue43682] Make static methods created by @staticmethod callable In-Reply-To: <1617201081.91.0.895015962683.issue43682@roundup.psfhosted.org> Message-ID: <1618220365.05.0.865840717178.issue43682@roundup.psfhosted.org> Mark Shannon added the comment: This is a significant change to the language. There should be a PEP, or at the very least a discussion on Python Dev. There may well be a very good reason why static methods have not been made callable before that you have overlooked. Changing static methods to be callable will break backwards compatibility for any code that tests `callable(x)` where `x` is a static method. I'm not saying that making staticmethods callable is a bad idea, just that it needs proper discussion. https://bugs.python.org/issue20309 was closed as "won't fix". What has changed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 05:44:26 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 12 Apr 2021 09:44:26 +0000 Subject: [issue43811] Run GHA CI with multiple OpenSSL versions In-Reply-To: <1618216687.81.0.190201617408.issue43811@roundup.psfhosted.org> Message-ID: <1618220666.9.0.00170849466841.issue43811@roundup.psfhosted.org> Christian Heimes added the comment: Github selects required actions based on the "name" attribute of a job. Therefore I decided to keep the default "Ubuntu" job and moved the additional OpenSSL tests to another job. For future reference, my first approach was: strategy: fail-fast: false matrix: openssl_ver: [1.1.1k, 1.0.2u, 1.1.0l, 3.0.0-alpha14] include: - openssl_ver: 1.1.1k testmode: 'full' ... - name: Tests run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu" if: ${{ matrix.testmode == 'full' }} - name: SSL tests run: ./python Lib/test/ssltests.py if: ${{ matrix.testmode != 'full' }} ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 05:57:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 09:57:17 +0000 Subject: [issue43792] Cython is not compatible with Python 3.10 yet: "SystemError: bad argument to internal function" In-Reply-To: <1617975873.6.0.244911999729.issue43792@roundup.psfhosted.org> Message-ID: <1618221436.99.0.460872366736.issue43792@roundup.psfhosted.org> STINNER Victor added the comment: > This is correct, thanks! The problem is gone with git master version of cython. master is a different version. I suggest you trying the 0.29.x branch which is the actively maintained stable branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 05:57:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 09:57:23 +0000 Subject: [issue22393] multiprocessing.Pool shouldn't hang forever if a worker process dies unexpectedly In-Reply-To: <1410474786.78.0.264797717105.issue22393@psf.upfronthosting.co.za> Message-ID: <1618221443.44.0.313735570425.issue22393@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 06:00:49 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 12 Apr 2021 10:00:49 +0000 Subject: [issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch In-Reply-To: <1597551049.14.0.0578030464715.issue41561@roundup.psfhosted.org> Message-ID: <1618221649.35.0.27830200488.issue41561@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 3447750073aff229b049e4ccd6217db2811dcfd1 by Christian Heimes in branch 'master': bpo-41561: Fix testing with OpenSSL 1.0.2 (GH-25355) https://github.com/python/cpython/commit/3447750073aff229b049e4ccd6217db2811dcfd1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 06:01:07 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 12 Apr 2021 10:01:07 +0000 Subject: [issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch In-Reply-To: <1597551049.14.0.0578030464715.issue41561@roundup.psfhosted.org> Message-ID: <1618221667.14.0.5226487821.issue41561@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24092 pull_request: https://github.com/python/cpython/pull/25358 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 06:01:14 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 12 Apr 2021 10:01:14 +0000 Subject: [issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch In-Reply-To: <1597551049.14.0.0578030464715.issue41561@roundup.psfhosted.org> Message-ID: <1618221674.1.0.786857444017.issue41561@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24093 pull_request: https://github.com/python/cpython/pull/25359 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 06:02:19 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 12 Apr 2021 10:02:19 +0000 Subject: [issue43811] Run GHA CI with multiple OpenSSL versions In-Reply-To: <1618216687.81.0.190201617408.issue43811@roundup.psfhosted.org> Message-ID: <1618221739.66.0.905750579157.issue43811@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +24094 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25360 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 06:02:52 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 12 Apr 2021 10:02:52 +0000 Subject: [issue34309] Trouble when reloading extension modules. In-Reply-To: <1533144973.44.0.56676864532.issue34309@psf.upfronthosting.co.za> Message-ID: <1618221772.0.0.709093722043.issue34309@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 06:14:24 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Mon, 12 Apr 2021 10:14:24 +0000 Subject: [issue34311] locale.format() and locale.format_string() cast Decimals to float In-Reply-To: <1533154971.69.0.56676864532.issue34311@psf.upfronthosting.co.za> Message-ID: <1618222464.12.0.320178107913.issue34311@roundup.psfhosted.org> Change by St?phane Wirtel : ---------- versions: +Python 3.10 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 06:19:28 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 12 Apr 2021 10:19:28 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1618222768.68.0.478005688574.issue43723@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: +christian.heimes nosy_count: 5.0 -> 6.0 pull_requests: +24095 pull_request: https://github.com/python/cpython/pull/25361 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 06:21:12 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 12 Apr 2021 10:21:12 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1618222872.86.0.959699171301.issue43723@roundup.psfhosted.org> Christian Heimes added the comment: The commit broke my PR https://github.com/python/cpython/pull/25329. You missed a call in asyncio tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 06:21:29 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 12 Apr 2021 10:21:29 +0000 Subject: [issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch In-Reply-To: <1597551049.14.0.0578030464715.issue41561@roundup.psfhosted.org> Message-ID: <1618222889.12.0.73351432554.issue41561@roundup.psfhosted.org> miss-islington added the comment: New changeset 04425a922b598d03770619b0c658ee9874113550 by Miss Islington (bot) in branch '3.8': bpo-41561: Fix testing with OpenSSL 1.0.2 (GH-25355) https://github.com/python/cpython/commit/04425a922b598d03770619b0c658ee9874113550 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 06:24:56 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 12 Apr 2021 10:24:56 +0000 Subject: [issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch In-Reply-To: <1597551049.14.0.0578030464715.issue41561@roundup.psfhosted.org> Message-ID: <1618223096.85.0.265766643589.issue41561@roundup.psfhosted.org> miss-islington added the comment: New changeset 0983e01837714524fb164e784a8e96a2bc4bdf94 by Miss Islington (bot) in branch '3.9': bpo-41561: Fix testing with OpenSSL 1.0.2 (GH-25355) https://github.com/python/cpython/commit/0983e01837714524fb164e784a8e96a2bc4bdf94 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 06:26:28 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 12 Apr 2021 10:26:28 +0000 Subject: [issue41561] test_ssl fails in Ubuntu 20.04: test_min_max_version_mismatch In-Reply-To: <1597551049.14.0.0578030464715.issue41561@roundup.psfhosted.org> Message-ID: <1618223188.01.0.870439695858.issue41561@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 07:03:14 2021 From: report at bugs.python.org (Ma Lin) Date: Mon, 12 Apr 2021 11:03:14 +0000 Subject: [issue43787] Optimize BZ2File, GzipFile, and LZMAFile __iter__ method. In-Reply-To: <1617958183.01.0.290245206759.issue43787@roundup.psfhosted.org> Message-ID: <1618225394.61.0.0707663320633.issue43787@roundup.psfhosted.org> Ma Lin added the comment: I think this change is safe. The behaviors should be exactly the same, except the iterators are different objects (obj vs obj._buffer). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 07:13:03 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 12 Apr 2021 11:13:03 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1618225983.97.0.589842343185.issue43723@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 95bbb331ecb3ef5d05859d90b287cc3d27613c86 by Christian Heimes in branch 'master': bpo-43723: Fix deprecation error caused by thread.setDaemon() (GH-25361) https://github.com/python/cpython/commit/95bbb331ecb3ef5d05859d90b287cc3d27613c86 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 07:35:12 2021 From: report at bugs.python.org (Jeppe Dakin) Date: Mon, 12 Apr 2021 11:35:12 +0000 Subject: [issue43812] Tuple unpacking in getitem Message-ID: <1618227312.63.0.479595083771.issue43812@roundup.psfhosted.org> New submission from Jeppe Dakin : This is similar to issue 32117 (I'm the author of the StackOverflow query referenced within it), which extends the tuple unpacking syntax to a small corner of the language: https://bugs.python.org/issue32117 Currently tuple unpacking is disallowed within getitem (brackets): d = {(1, 2, 3): 42} t = (2, 3) d[1, *t] # SyntaxError To make it work, explicit parenthesization is needed: d[(1, *t)] # OK On top of being slightly more neat, the un-parenthesized version is more in harmony with the language generally: 1) Parentheses are usually only required in order to distinguish between several possible outcomes (grouping). This is not the case here, as leaving out the parentheses doesn't produce any outcome at all. 2) Sub-expressions can usually be extracted as a variable. That is, one would expect the illegal code d[1, *t] # SyntaxError to be equivalent to the legal code sub = 1, *t d[sub] # OK 3) The following are both allowed and equivalent: d[1, 2, 3] d[(1, 2, 3)] where both gets transformed into d.__getitem__((1, 2, 3)), implying that implicit tuple packing occurs in the first case. Having this tuple packing feature without allowing for the * unpacking operator feels incomplete. 4) What the syntax d[1, *t] is supposed to mean is obvious, enough so that I was surprised to find that it was disallowed. Though hardly a stumbling block, I suspect many have written such code, gotten the SyntaxError and remedied the code by putting in the (apparently non-superfluous) parentheses. I propose allowing such tuple unpacking within getitem [], which I believe amounts to a slight adjustment of the grammar. This should not break any existing code as it merely extends the space of allowed syntax. ---------- components: Interpreter Core messages: 390838 nosy: dakinjeppe priority: normal severity: normal status: open title: Tuple unpacking in getitem type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 07:54:39 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 12 Apr 2021 11:54:39 +0000 Subject: [issue43799] OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1 In-Reply-To: <1618047260.96.0.943530034595.issue43799@roundup.psfhosted.org> Message-ID: <1618228479.08.0.300825486585.issue43799@roundup.psfhosted.org> Christian Heimes added the comment: OpenSSL 1.0.2, 1.1.0, 1.1.1 and 3.0.0 behave slightly differently. For example I'm still getting a warning with 1.1.0. Only 3.0.0 supports OPENSSL_NO_DEPRECATED. After multiple failed attempts I decided to set the API level to 1.1.1 and define the three TLSv*_method() functions explicitly. It's not the most elegant approach but it works. The symbols are available unless OPENSSL_NO_TLS*_METHOD is defined. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 08:07:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 12:07:13 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1618229233.18.0.836035502476.issue43723@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Jelle Zijlstra, I merged your PR! I close issue. Ok, aliases are now deprecated. If someone wants to actually remove the aliases, I suggest to help all projects still using them to fix their deprecation warnings: https://bugs.python.org/issue43723#msg390337 For now, I prefer to not schedule the removal. There are too many projects using it. By the way, I'm surprised that this number, I expected that most projects switched since Python 2.6 :-) Christian: > The commit broke my PR https://github.com/python/cpython/pull/25329 Usually, warnings are not treated as errors. Thanks for fixing test_asyncio! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 08:09:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 12:09:51 +0000 Subject: [issue43682] Make static methods created by @staticmethod callable In-Reply-To: <1617201081.91.0.895015962683.issue43682@roundup.psfhosted.org> Message-ID: <1618229391.35.0.0958342355415.issue43682@roundup.psfhosted.org> STINNER Victor added the comment: Mark Shannon: > Changing static methods to be callable will break backwards compatibility for any code that tests `callable(x)` where `x` is a static method. Can you please elaborate on why this is an issue? In the pydoc case, it sounds like an enhancement: https://bugs.python.org/issue43682#msg390525 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 08:17:48 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Mon, 12 Apr 2021 12:17:48 +0000 Subject: [issue34311] locale.format() and locale.format_string() cast Decimals to float In-Reply-To: <1533154971.69.0.56676864532.issue34311@psf.upfronthosting.co.za> Message-ID: <1618229868.64.0.90616290148.issue34311@roundup.psfhosted.org> St?phane Wirtel added the comment: New changeset e126547c070fbc080562abb08e16a2c93a8a805d by C?dric Krier in branch 'master': bpo-34311: Add locale.localize (GH-15275) https://github.com/python/cpython/commit/e126547c070fbc080562abb08e16a2c93a8a805d ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 08:20:17 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 12 Apr 2021 12:20:17 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1618230017.34.0.323318246599.issue43723@roundup.psfhosted.org> Christian Heimes added the comment: > Usually, warnings are not treated as errors. Thanks for fixing test_asyncio! Tests should treat any unhandled deprecation warnings as a test failure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 08:20:49 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Mon, 12 Apr 2021 12:20:49 +0000 Subject: [issue34311] locale.format() and locale.format_string() cast Decimals to float In-Reply-To: <1533154971.69.0.56676864532.issue34311@psf.upfronthosting.co.za> Message-ID: <1618230049.45.0.31169634096.issue34311@roundup.psfhosted.org> St?phane Wirtel added the comment: I have merged the PR, thank you to C?dric for the PR, and thank you to Steve for his review. ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 08:24:44 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 12 Apr 2021 12:24:44 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1618230284.69.0.559988223617.issue43723@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: I opened a thread a year back on running tests with -Werror in CI. This issue still pops up when someone runs with -Wall and finds unhandled deprecation warnings. https://discuss.python.org/t/run-test-suite-with-werror-on-ci/2333 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 08:30:47 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 12:30:47 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1618230647.21.0.72176411995.issue43723@roundup.psfhosted.org> STINNER Victor added the comment: > Tests should treat any unhandled deprecation warnings as a test failure. libregrtest sets a sys.unraisablehook: a test is marked as "failed" if any "unraisable exception" is logged. libregrtest might use a hook on warnings to do the same: log the warning, but mark the test as failed? One issue that I had with libregrtest and sys.unraisablehook was that some "unraisable exception" was not logged in buildbot logs. I had to use sys.__stderr__ to ensure that the exception is logged. See regrtest_unraisable_hook() of test.libregrtest.utils. It would be annoying to get a test marked as "FAILED" if the warning is not visible in logs :-( --- Using -Werror on some CIs would be another option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 08:33:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 12:33:24 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1618230804.07.0.142784024103.issue43723@roundup.psfhosted.org> STINNER Victor added the comment: Oh by the way, if someone wants to enhance libregrtest / our CI, please open a new issue ;-) I'm not interested so, I didn't open a new issue :-) Someone also once proposed to add a post-commit buildbot using -Werror. It may be enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 09:10:58 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 12 Apr 2021 13:10:58 +0000 Subject: [issue43682] Make static methods created by @staticmethod callable In-Reply-To: <1617201081.91.0.895015962683.issue43682@roundup.psfhosted.org> Message-ID: <1618233058.94.0.162337349936.issue43682@roundup.psfhosted.org> Mark Shannon added the comment: Are you asking why breaking backwards compatibility is an issue? Or how it breaks backwards compatibility? pydoc could be changed to produce the proposed output, it doesn't need this change. We don't know what this change will break, but we do know that it is a potentially breaking change. `callable(staticmethod(f))` will change from `False` to `True`. I don't think you should be making changes like this unilaterally. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 09:17:08 2021 From: report at bugs.python.org (Mohammed Dief) Date: Mon, 12 Apr 2021 13:17:08 +0000 Subject: [issue43813] Denial of service on http.server module with large request method. Message-ID: <1618233428.41.0.905190325792.issue43813@roundup.psfhosted.org> New submission from Mohammed Dief : - Hello there, 2 days ago i discovered a DoS on http.server in python that allows me to take any python http.server down using less than 1k requests. i reported it to PSRT but they said i should report it here since http.server isn't for production. so here's the issue, in server.py http.server library has a really big value on the validation. and check if the first line of the request (method /path HTTP/VERSION) have more than 65k characters inside of it using `len()` function. - In this case, the user is able to provide a method with 65k characters long and the server will accept it, if you send one request with this number of characters inside of the request using cURL. you will notice that the server could handle it. but after creating a big loop of 1k requests with the same characters. the server was taken down and didn't response again since it was trying to process this amount of data. - Such an attack could be used to take down any python server running using http.server module. but since it's not for production like the documentations said the attack surface isn't that wide. - To proof this issue, you can use this command while running your server on port 8080 or any port you just need to modify the command: for i in $(python3 -c "print('A\n'*10000)"); do curl -X $(python3 -c "print('A'*10000)") 'http://localhost:8080/404' ; done - Then the server should be taken down after many requests, also, i managed to fix this issue from my side by adding characters validation on the code to avoid interacting with the long data many times. should i submit it here. or should i create a PR? PS, my fix doesn't change the main requestline validation int. ---------- messages: 390849 nosy: demonia priority: normal severity: normal status: open title: Denial of service on http.server module with large request method. type: security versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 09:50:36 2021 From: report at bugs.python.org (Alexandru Coca) Date: Mon, 12 Apr 2021 13:50:36 +0000 Subject: [issue35540] dataclasses.asdict breaks with defaultdict fields In-Reply-To: <1545257204.19.0.788709270274.issue35540@psf.upfronthosting.co.za> Message-ID: <1618235436.87.0.0920047576071.issue35540@roundup.psfhosted.org> Alexandru Coca added the comment: I was wondering if this issue is still being tracked for resolution? I found the same bug in Python 3.8. ---------- nosy: +alexcoca _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 09:55:17 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Mon, 12 Apr 2021 13:55:17 +0000 Subject: [issue43814] Fix the error message for disallowed __weakref__ slots Message-ID: <1618235717.97.0.321047672472.issue43814@roundup.psfhosted.org> New submission from G?ry : When ``` TypeError: __weakref__ slot disallowed: either we already got one, or __itemsize__ != 0 ``` is raised, the second condition `base->tp_itemsize != 0` (i.e. the base is a *variable-length* type, like `int`, `tuple` and `bytes`) in the error message is impossible since using a non-empty `__slots__` (e.g. `__slots__ = ('__weakref__',)`) for a subtype of a variable-length type raises a ``` TypeError: nonempty __slots__ not supported for subtype of '?' ``` earlier in the `type.__new__` implementation. ---------- components: Interpreter Core messages: 390851 nosy: maggyero priority: normal severity: normal status: open title: Fix the error message for disallowed __weakref__ slots type: enhancement versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 09:55:39 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Mon, 12 Apr 2021 13:55:39 +0000 Subject: [issue43814] Fix the error message for disallowed __weakref__ slots In-Reply-To: <1618235717.97.0.321047672472.issue43814@roundup.psfhosted.org> Message-ID: <1618235739.83.0.898257583745.issue43814@roundup.psfhosted.org> Change by G?ry : ---------- keywords: +patch pull_requests: +24096 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25362 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 10:16:38 2021 From: report at bugs.python.org (Andrew V. Jones) Date: Mon, 12 Apr 2021 14:16:38 +0000 Subject: [issue43351] `RecursionError` during deallocation In-Reply-To: <1614595632.86.0.935465611369.issue43351@roundup.psfhosted.org> Message-ID: <1618236998.59.0.531561399182.issue43351@roundup.psfhosted.org> Andrew V. Jones added the comment: For us, this issue was resolved with moving to 3.9.2. I have closed it as it seems it was an "accidentally fixed" bug. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 10:18:33 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Mon, 12 Apr 2021 14:18:33 +0000 Subject: [issue33927] Allow json.tool to have identical infile and outfile In-Reply-To: <1529577940.46.0.56676864532.issue33927@psf.upfronthosting.co.za> Message-ID: <1618237113.87.0.31437548269.issue33927@roundup.psfhosted.org> St?phane Wirtel added the comment: Hello @pablogsal, What do you think about the PR of R?mi? Thank you, ---------- versions: -Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 10:23:27 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 12 Apr 2021 14:23:27 +0000 Subject: [issue43815] documentation for types.new_class() mention misleading default for exec_body Message-ID: <1618237407.5.0.0559454407816.issue43815@roundup.psfhosted.org> New submission from Eric V. Smith : https://github.com/python/cpython/blob/3.8/Lib/types.py The documentation says "If no callback is provided, it has the same effect as passing in lambda ns: ns." I read this as saying that the callback should return the namespace, but in reality the return value is ignored. I think the lambda should be "lambda ns: None". ---------- assignee: docs at python components: Documentation keywords: easy, newcomer friendly messages: 390854 nosy: docs at python, eric.smith priority: normal severity: normal status: open title: documentation for types.new_class() mention misleading default for exec_body versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 10:45:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 14:45:51 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1618238751.92.0.55074412267.issue43774@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24097 pull_request: https://github.com/python/cpython/pull/25363 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 10:54:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 14:54:10 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1618239250.71.0.224918420575.issue43774@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24098 pull_request: https://github.com/python/cpython/pull/25364 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 11:16:23 2021 From: report at bugs.python.org (Andrew V. Jones) Date: Mon, 12 Apr 2021 15:16:23 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table Message-ID: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> New submission from Andrew V. Jones : With Python 3.9.4, and when compiling with Visual Studio 2019, we have noticed that the variable `_Py_ctype_table` is *not* scoped with in an `extern "C"` block, and where the Python library (`python39.lib`) *has* been compiled with a C compiler. This causes an issue when trying to refer to `_Py_ctype_table` from a C++ file, as the compiler tries to name-mangle the _use_ of `_Py_ctype_table`, but the linker cannot then tie the mangled name to non-mangled named from `python39.lib`. Example: ``` #include "Python.h" int main() { return _Py_ctype_table[0]; } ``` Compilation: ``` cl.exe /Fe:test.exe /TP /I include test.cpp /link libs/python39.lib Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29336 for x64 Copyright (C) Microsoft Corporation. All rights reserved. test.cpp Microsoft (R) Incremental Linker Version 14.28.29336.0 Copyright (C) Microsoft Corporation. All rights reserved. /out:test.exe libs/python39.lib test.obj test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) unsigned int const * const _Py_ctype_table" (__imp_?_Py_ctype_table@@3QBIB) referenced in function main test.exe : fatal error LNK1120: 1 unresolved externals ``` With `cl.exe`: ``` cl.exe /Bv Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29336 for x64 Copyright (C) Microsoft Corporation. All rights reserved. Compiler Passes: Z:\home\avj\visual_studio\MSVC\14.28.29333\bin\HostX64\x64\cl.exe: Version 19.28.29336.0 Z:\home\avj\visual_studio\MSVC\14.28.29333\bin\HostX64\x64\c1.dll: Version 19.28.29336.0 Z:\home\avj\visual_studio\MSVC\14.28.29333\bin\HostX64\x64\c1xx.dll: Version 19.28.29336.0 Z:\home\avj\visual_studio\MSVC\14.28.29333\bin\HostX64\x64\c2.dll: Version 19.28.29336.0 Z:\home\avj\visual_studio\MSVC\14.28.29333\bin\HostX64\x64\c1xx.dll: Version 19.28.29336.0 Z:\home\avj\visual_studio\MSVC\14.28.29333\bin\HostX64\x64\link.exe: Version 14.28.29336.0 Z:\home\avj\visual_studio\MSVC\14.28.29333\bin\HostX64\x64\mspdb140.dll: Version 14.28.29336.0 Z:\home\avj\visual_studio\MSVC\14.28.29333\bin\HostX64\x64\1033\clui.dll: Version 19.28.29336.0 ``` A na?ve check of Python.h (e126547c07) seems to suggest that: * There are 82 includes * 64 of these contain `extern "C"` * 8 do not contain `extern "C"` * The remaining 10 are either system includes or pyconfig.h For the 8 that *do not* contain `extern "C"`, none of these use `PyAPI_DATA`. This leads me to believe that it is an oversight that `pyctype.h` does not have `extern "C"` ---------- messages: 390855 nosy: andrewvaughanj priority: normal severity: normal status: open title: Missing 'extern "C"' for _Py_ctype_table versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 11:19:01 2021 From: report at bugs.python.org (Andrew V. Jones) Date: Mon, 12 Apr 2021 15:19:01 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618240741.29.0.762813557975.issue43816@roundup.psfhosted.org> Change by Andrew V. Jones : ---------- keywords: +patch pull_requests: +24099 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25365 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 11:36:32 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Mon, 12 Apr 2021 15:36:32 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618241792.75.0.896522793578.issue43816@roundup.psfhosted.org> St?phane Wirtel added the comment: In fact, _Py_ctype_table is limited to the internal parts of the interpreter. So in this case, this one could not be used in an external tool. You can read: https://docs.python.org/3/c-api/stable.html I am not sure that you correctly use the API. ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 11:36:46 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 12 Apr 2021 15:36:46 +0000 Subject: [issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path In-Reply-To: <1612285380.24.0.495785451269.issue43105@roundup.psfhosted.org> Message-ID: <1618241806.76.0.152053827938.issue43105@roundup.psfhosted.org> Change by Steve Dower : ---------- assignee: -> steve.dower resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 11:39:38 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 12 Apr 2021 15:39:38 +0000 Subject: [issue41661] os.path.relpath does not document ValueError on Windows with different drives In-Reply-To: <1598681705.55.0.359436315051.issue41661@roundup.psfhosted.org> Message-ID: <1618241978.93.0.0560501354068.issue41661@roundup.psfhosted.org> Steve Dower added the comment: New changeset 67c0b3d89c4da9750fdb43fc66d3924681b22d2e by Zackery Spytz in branch 'master': bpo-41661: Document os.path.relpath() exception on Windows with different drives (GH-25346) https://github.com/python/cpython/commit/67c0b3d89c4da9750fdb43fc66d3924681b22d2e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 11:39:46 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 12 Apr 2021 15:39:46 +0000 Subject: [issue41661] os.path.relpath does not document ValueError on Windows with different drives In-Reply-To: <1598681705.55.0.359436315051.issue41661@roundup.psfhosted.org> Message-ID: <1618241986.37.0.232874700022.issue41661@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +24100 pull_request: https://github.com/python/cpython/pull/25366 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 11:39:55 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 12 Apr 2021 15:39:55 +0000 Subject: [issue41661] os.path.relpath does not document ValueError on Windows with different drives In-Reply-To: <1598681705.55.0.359436315051.issue41661@roundup.psfhosted.org> Message-ID: <1618241995.31.0.422158668004.issue41661@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24101 pull_request: https://github.com/python/cpython/pull/25367 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 11:42:18 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 12 Apr 2021 15:42:18 +0000 Subject: [issue41661] os.path.relpath does not document ValueError on Windows with different drives In-Reply-To: <1598681705.55.0.359436315051.issue41661@roundup.psfhosted.org> Message-ID: <1618242138.91.0.215070942649.issue41661@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 11:46:55 2021 From: report at bugs.python.org (Andrew V. Jones) Date: Mon, 12 Apr 2021 15:46:55 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618242415.45.0.362179551442.issue43816@roundup.psfhosted.org> Andrew V. Jones added the comment: > In fact, _Py_ctype_table is limited to the internal parts of the interpreter. So in this case, this one could not be used in an external tool. > Hmm, so why is this "exposed" by the "world-facing" `Python.h` file? I should say: we found this bug via Cython; and it was Cython that was accessing/referring to `_Py_ctype_table` -- our Cythonated code pulls in C++ headers, so we need to compile these files as C++. I am happy to re-assign this as a Cython bug, but the fact it is fixed with an `extern "C"` in Python.h, really makes it feel like it is a Python-proper issue and not a "user" issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 11:51:28 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 12 Apr 2021 15:51:28 +0000 Subject: [issue42248] Raised exception in Enum keeping user objects alive unnecessarily In-Reply-To: <1604350009.17.0.208770748804.issue42248@roundup.psfhosted.org> Message-ID: <1618242688.5.0.669725055005.issue42248@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 8c14f5a787b21d5a1eae5d5ee981431d1c0e055f by Ethan Furman in branch 'master': bpo-42248: [Enum] ensure exceptions raised in ``_missing_`` are released (GH-25350) https://github.com/python/cpython/commit/8c14f5a787b21d5a1eae5d5ee981431d1c0e055f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 11:55:57 2021 From: report at bugs.python.org (Andrew V. Jones) Date: Mon, 12 Apr 2021 15:55:57 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618242957.78.0.815506603582.issue43816@roundup.psfhosted.org> Andrew V. Jones added the comment: > I am happy to re-assign this as a Cython bug, but the fact it is fixed with an `extern "C"` in Python.h, really makes it feel like it is a Python-proper issue and not a "user" issue. > Just to extend on this: 1) The Cython-generated code uses `Py_ISSPACE` (and not `_Py_ctype_table`), but the expansion of the macro `Py_ISSPACE` then adds `_Py_ctype_table` to the user's code 2) The "user-fix" is to wrap `#include ` in `extern "C"` -- however, given other parts of Python.h already do this, it seems extraneous to expect a C++ user to wrap Python.h in this way ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 11:58:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Apr 2021 15:58:58 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1618243138.88.0.822571248289.issue43774@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 2459b92a4db69d9b14d0a86a9b81cc075894e910 by Victor Stinner in branch 'master': bpo-43774: Remove --without-cycle-gc doc (GH-25364) https://github.com/python/cpython/commit/2459b92a4db69d9b14d0a86a9b81cc075894e910 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 11:59:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Apr 2021 15:59:34 +0000 Subject: [issue43797] Improve syntax error for invalid comparisons In-Reply-To: <1617995491.91.0.835586864843.issue43797@roundup.psfhosted.org> Message-ID: <1618243174.09.0.638897418106.issue43797@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset b86ed8e3bb41ede77eeab4a8bb4e2b91a8065283 by Pablo Galindo in branch 'master': bpo-43797: Improve syntax error for invalid comparisons (#25317) https://github.com/python/cpython/commit/b86ed8e3bb41ede77eeab4a8bb4e2b91a8065283 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 11:59:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Apr 2021 15:59:58 +0000 Subject: [issue43797] Improve syntax error for invalid comparisons In-Reply-To: <1617995491.91.0.835586864843.issue43797@roundup.psfhosted.org> Message-ID: <1618243198.99.0.214058471404.issue43797@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 12:03:16 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 12 Apr 2021 16:03:16 +0000 Subject: [issue41661] os.path.relpath does not document ValueError on Windows with different drives In-Reply-To: <1598681705.55.0.359436315051.issue41661@roundup.psfhosted.org> Message-ID: <1618243396.5.0.533594733536.issue41661@roundup.psfhosted.org> miss-islington added the comment: New changeset de06baa9de109a00c26de0dc5a248fe7aafe09f5 by Miss Islington (bot) in branch '3.9': bpo-41661: Document os.path.relpath() exception on Windows with different drives (GH-25346) https://github.com/python/cpython/commit/de06baa9de109a00c26de0dc5a248fe7aafe09f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 12:06:54 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 12 Apr 2021 16:06:54 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618243614.98.0.624044970069.issue43816@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- components: +C API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 12:12:40 2021 From: report at bugs.python.org (Big Stone) Date: Mon, 12 Apr 2021 16:12:40 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.4 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1618243960.64.0.250010942486.issue43492@roundup.psfhosted.org> Big Stone added the comment: 3.35.4 is there ---------- nosy: +Big Stone _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 12:35:21 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 12 Apr 2021 16:35:21 +0000 Subject: [issue43761] Documenting dataclass and namedtuple changes for structural pattern matching In-Reply-To: <1617792027.47.0.961772614464.issue43761@roundup.psfhosted.org> Message-ID: <1618245321.1.0.517202507103.issue43761@roundup.psfhosted.org> Brandt Bucher added the comment: > For named tuples, there isn't an include/exclude option, so no extra mention is warranted. I think a note in the docs could still be valuable, if only because defining __match_args__ for named tuples changes the inherited tuple behavior for positional matches quite significantly: "case tuple(x)" and "case MyNT(x)" don't mean the same thing. (Although perhaps this could be inferred from the new constructor signature.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 12:48:53 2021 From: report at bugs.python.org (Ross Rhodes) Date: Mon, 12 Apr 2021 16:48:53 +0000 Subject: [issue42916] Support for DICOM image file format in imghdr module In-Reply-To: <1610497726.98.0.199039272928.issue42916@roundup.psfhosted.org> Message-ID: <1618246133.32.0.772996609125.issue42916@roundup.psfhosted.org> Ross Rhodes added the comment: PR already open to support DICOM based on the first 132 characters. Marked ?stale? since I haven?t had any feedback on GitHub, yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 12:50:21 2021 From: report at bugs.python.org (Ross Rhodes) Date: Mon, 12 Apr 2021 16:50:21 +0000 Subject: [issue43123] email MIME splitting In-Reply-To: <1612442926.7.0.976451859836.issue43123@roundup.psfhosted.org> Message-ID: <1618246221.8.0.597550320941.issue43123@roundup.psfhosted.org> Ross Rhodes added the comment: PR now ?stale? since I have not received any feedback, yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 12:55:56 2021 From: report at bugs.python.org (Andrew V. Jones) Date: Mon, 12 Apr 2021 16:55:56 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618246556.98.0.584590373945.issue43816@roundup.psfhosted.org> Andrew V. Jones added the comment: > 1) The Cython-generated code uses `Py_ISSPACE` (and not `_Py_ctype_table`), but the expansion of the macro `Py_ISSPACE` then adds `_Py_ctype_table` to the user's code > I wrote this up as a Cython bug here (just to see if the Cython team consider this "their" bug): https://github.com/cython/cython/issues/4111 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 12:56:23 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 12 Apr 2021 16:56:23 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.4 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1618246583.02.0.50727264622.issue43492@roundup.psfhosted.org> Steve Dower added the comment: It's been a busy month for the SQLite team... hope they're doing okay. Let's give this one a few weeks, just in case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 13:17:21 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 12 Apr 2021 17:17:21 +0000 Subject: [issue42059] TypedDict(...) as function does not respect "total" when setting __required_keys__ and __optional_keys__ In-Reply-To: <1602926609.93.0.947551036861.issue42059@roundup.psfhosted.org> Message-ID: <1618247841.54.0.940739141708.issue42059@roundup.psfhosted.org> Guido van Rossum added the comment: Dominic, thanks so much for the backport! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 13:23:20 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 12 Apr 2021 17:23:20 +0000 Subject: [issue42904] get_type_hints does not provide localns for classes In-Reply-To: <1610427615.24.0.000795612365541.issue42904@roundup.psfhosted.org> Message-ID: <1618248200.04.0.811051696002.issue42904@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 852150ddfe68bc2696fc880175aeb855a0c16ae6 by Ken Jin in branch 'master': bpo-42904: Fix get_type_hints for class local namespaces (GH-24201) https://github.com/python/cpython/commit/852150ddfe68bc2696fc880175aeb855a0c16ae6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 13:24:18 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 12 Apr 2021 17:24:18 +0000 Subject: [issue42904] get_type_hints does not provide localns for classes In-Reply-To: <1610427615.24.0.000795612365541.issue42904@roundup.psfhosted.org> Message-ID: <1618248258.15.0.464873996719.issue42904@roundup.psfhosted.org> Guido van Rossum added the comment: Hi Ken Jin, you can close this issue now with your new permissions, right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 13:26:00 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 12 Apr 2021 17:26:00 +0000 Subject: [issue42737] PEP 563: drop annotations for complex assign targets In-Reply-To: <1608888770.02.0.483696766952.issue42737@roundup.psfhosted.org> Message-ID: <1618248360.27.0.999977838034.issue42737@roundup.psfhosted.org> Guido van Rossum added the comment: Batuhan, can you summarize the argument from the thread? What do you think yourself? Myself, I'm not sure either way, but it seems okay to remove the remnant bytecode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 13:39:44 2021 From: report at bugs.python.org (Larry Hastings) Date: Mon, 12 Apr 2021 17:39:44 +0000 Subject: [issue43817] Add typing.eval_annotations() Message-ID: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> New submission from Larry Hastings : Currently, with PEP 563 looming over us, people who use annotations for something besides type hints are kind of stuck. Converting stringized annotations back into useful values is a complicated problem, and there's only function in the standard library that will do it for you: typing.get_type_hints(). However, typing.get_type_hints() deals specifically with *type hints*. Type hints are a subset of annotations, and they have an additional set of rules they want to obey. As such typing.get_type_hints() is quite opinionated and makes additional changes to the annotations that someone who only wants to un-stringize their annotations likely does not want. I therefore propose adding a new function to typing: typing.get_annotations(o) This would behave similarly to typing.get_type_hints(o), except it would be agnostic about the contents of the annotations. It would simply evaluate them, without further changing them as typing.get_type_hints() does. Specifically: * It would ignore the "__no_type_check__" attribute. * It would not wrap string annotations with ForwardRef(). * It would not wrap values with Optional[]. * It would not turn an annotation of None into type(None). * It would not otherwise change the value of the annotation, in case I missed any. Since the two functions would be so similar, hopefully either they would share a common implementation, or typing.get_type_hints() could be implemented on top of typing.get_annotations(). Guido, Eric, any thoughts? ---------- components: Library (Lib) messages: 390874 nosy: eric.smith, gvanrossum, larry priority: normal severity: normal stage: needs patch status: open title: Add typing.eval_annotations() type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 13:42:22 2021 From: report at bugs.python.org (Larry Hastings) Date: Mon, 12 Apr 2021 17:42:22 +0000 Subject: [issue43817] Add typing.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1618249342.94.0.0556566575227.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: (realized mid-issue-creation that it should have a different name) ---------- title: Add typing.eval_annotations() -> Add typing.get_annotations() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 13:50:17 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 12 Apr 2021 17:50:17 +0000 Subject: [issue43817] Add typing.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1618249817.85.0.805337676856.issue43817@roundup.psfhosted.org> Guido van Rossum added the comment: It's fair that get_type_hints() does too much. But what does your proposed function do besides this? {k: eval(v) for k, b in x.__annotations__.items()} ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 13:57:50 2021 From: report at bugs.python.org (Larry Hastings) Date: Mon, 12 Apr 2021 17:57:50 +0000 Subject: [issue43817] Add typing.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1618250270.47.0.0448890018374.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: To be honest, I'm not 100% sure. But I observe that typing.get_type_hints() is about fifty lines of code, and very few of them are the opinionated lines I want to avoid. Some things typing.get_type_hints() seems to do for you: * Work around the "classes inherit annotations" design bug. * Unwrap wrapped functions. * "Return empty annotations for something that _could_ have them." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 13:59:29 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 12 Apr 2021 17:59:29 +0000 Subject: [issue43817] Add typing.get_annotations() In-Reply-To: <1618250270.47.0.0448890018374.issue43817@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: I'd say just submit the PR. Shouldn't be problematic. (Have you decided what to do if the eval() fails?) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 14:00:03 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 12 Apr 2021 18:00:03 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.4 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1618250403.36.0.772778588795.issue43492@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: I agree, Steve. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 14:02:00 2021 From: report at bugs.python.org (jana) Date: Mon, 12 Apr 2021 18:02:00 +0000 Subject: [issue30528] ipaddress.IPv{4,6}Network.reverse_pointer is broken In-Reply-To: <1496250931.44.0.236459920081.issue30528@psf.upfronthosting.co.za> Message-ID: <1618250520.26.0.395907416324.issue30528@roundup.psfhosted.org> jana added the comment: Running into the same problem here. Within the zonefile rfc1035 defines a usecase for ipv4, but I can't find anything similar for IPv6. The feature is also rather obscure. The zone however is used in the zonefile as origin and in bind in the named.conf to refer to which zone is managed where. For this you want to provide the reverse network address, minus the irrelevant zeros, so 192.168.0.0/24 => 0.168.192.in-addr.arpa and 2001:db8::/32 => 8.b.d.0.1.0.0.2.ip6.arpa This would be to me a fitting and convenient interpretation of the function. ---------- nosy: +jana versions: +Python 3.7 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 14:11:29 2021 From: report at bugs.python.org (Larry Hastings) Date: Mon, 12 Apr 2021 18:11:29 +0000 Subject: [issue43817] Add typing.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1618251089.37.0.722643047381.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: > I'd say just submit the PR. Shouldn't be problematic. Okey-doke, I can do it. Though I have plenty to do at the moment, though, so it wouldn't be this week. Is there anybody who would *enjoy* taking this on, who we could farm it out to? If not, that's no problem, I should be able to get it done before 3.10b1. > (Have you decided what to do if the eval() fails?) My experience is that typing.get_type_hints() doesn't catch exceptions, e.g. NameError. I assumed that typing.get_annotations() should behave the same way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 14:17:32 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 12 Apr 2021 18:17:32 +0000 Subject: [issue41515] typing.get_type_hints generates KeyError In-Reply-To: <1597067038.73.0.335844562656.issue41515@roundup.psfhosted.org> Message-ID: <1618251452.62.0.460267760939.issue41515@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset a9cf69df2e031d6157f01289f66ca9cf723ceb5c by Karthikeyan Singaravelan in branch 'master': bpo-41515: Fix KeyError raised in get_type_hints (GH-25352) https://github.com/python/cpython/commit/a9cf69df2e031d6157f01289f66ca9cf723ceb5c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 14:20:37 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 12 Apr 2021 18:20:37 +0000 Subject: [issue43817] Add typing.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1618251637.63.0.751115489256.issue43817@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 14:21:43 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 12 Apr 2021 18:21:43 +0000 Subject: [issue43804] Add more info about building C/C++ Extensions on Windows using MSVC In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1618251703.79.0.334702146071.issue43804@roundup.psfhosted.org> Shreyan Avigyan added the comment: Kindly have a review of my PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 14:37:26 2021 From: report at bugs.python.org (jana) Date: Mon, 12 Apr 2021 18:37:26 +0000 Subject: [issue30528] ipaddress.IPv{4,6}Network.reverse_pointer is broken In-Reply-To: <1496250931.44.0.236459920081.issue30528@psf.upfronthosting.co.za> Message-ID: <1618252646.74.0.866492971268.issue30528@roundup.psfhosted.org> jana added the comment: This code does the trick: ipn = ipaddress.ip_network("2a0c:ac10::/32") prefix = ipn.prefixlen if ipn.version == 6: rest = int((ipn.max_prefixlen - prefix) / 4) elif ipn.version == 4: rest = int((ipn.max_prefixlen - prefix) / 8) return ipn.network_address.reverse_pointer.split(".", rest)[-1] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 14:40:31 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 12 Apr 2021 18:40:31 +0000 Subject: [issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring In-Reply-To: <1618106073.56.0.0553736134144.issue43803@roundup.psfhosted.org> Message-ID: <1618252831.61.0.436183430295.issue43803@roundup.psfhosted.org> Shreyan Avigyan added the comment: Yeah, you're right and also it is true that changing the docstring to "ptr" can succinctly say "Return the byte string at void *ptr." But it's a kind of problem if different argument names are used for the same argument in docstring, argument list and documentation. If that's the problem then why not change all of them to use the name "address" or "addr" to avoid confusion and make it clear simple. What is your view? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 14:53:57 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 12 Apr 2021 18:53:57 +0000 Subject: [issue42248] Raised exception in Enum keeping user objects alive unnecessarily In-Reply-To: <1604350009.17.0.208770748804.issue42248@roundup.psfhosted.org> Message-ID: <1618253637.82.0.409320199748.issue42248@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +24102 pull_request: https://github.com/python/cpython/pull/25369 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 15:05:32 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 12 Apr 2021 19:05:32 +0000 Subject: [issue42248] Raised exception in Enum keeping user objects alive unnecessarily In-Reply-To: <1604350009.17.0.208770748804.issue42248@roundup.psfhosted.org> Message-ID: <1618254332.95.0.114682690107.issue42248@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +24103 pull_request: https://github.com/python/cpython/pull/25370 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 15:13:45 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Apr 2021 19:13:45 +0000 Subject: [issue43812] Tuple unpacking in getitem In-Reply-To: <1618227312.63.0.479595083771.issue43812@roundup.psfhosted.org> Message-ID: <1618254825.7.0.0121984422129.issue43812@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This is currently being proposed as part of https://www.python.org/dev/peps/pep-0646. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 15:15:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Apr 2021 19:15:14 +0000 Subject: [issue43812] Tuple unpacking in getitem In-Reply-To: <1618227312.63.0.479595083771.issue43812@roundup.psfhosted.org> Message-ID: <1618254914.68.0.48090801383.issue43812@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I am closing this as duplicate of https://www.python.org/dev/peps/pep-0646, but feel free to reopen if you think there is some missing considerations. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 15:16:26 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 12 Apr 2021 19:16:26 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1618254986.36.0.857004455731.issue14243@roundup.psfhosted.org> Ethan Furman added the comment: Eryk, I'm not sure if you are agreeing or disagreeing with me. :) On Windows it sounds like O_TEMPORARY buys us guaranteed file deletion, but costs us easy sharing of file resources and a difference in semantics between Windows and non-Windows. Is the automatic deletion truly that valuable? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 15:16:54 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 12 Apr 2021 19:16:54 +0000 Subject: [issue42248] Raised exception in Enum keeping user objects alive unnecessarily In-Reply-To: <1604350009.17.0.208770748804.issue42248@roundup.psfhosted.org> Message-ID: <1618255014.08.0.347356431311.issue42248@roundup.psfhosted.org> Ethan Furman added the comment: New changeset f396a1a940f8608a4be2a9ac4ef82e37c198ecd3 by Ethan Furman in branch '3.8': [3.8] bpo-42248: [Enum] ensure exceptions raised in ``_missing_`` are released (GH-25350). (GH-25369) https://github.com/python/cpython/commit/f396a1a940f8608a4be2a9ac4ef82e37c198ecd3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 15:22:56 2021 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 12 Apr 2021 19:22:56 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618255376.02.0.403108760346.issue43816@roundup.psfhosted.org> Stefan Behnel added the comment: These macros are a sort-of documented part of the C-API. At least, they were mentioned in a What's New document: https://docs.python.org/3/whatsnew/2.7.html?highlight=py_isspace#build-and-c-api-changes They were added here, for the Py2.7 release: https://github.com/python/cpython/commit/8374981fb4d781d5ddbca313656bd3f32b49cef4 It looks to me like the header file should use "extern C". @Eric, do you agree? ---------- nosy: +eric.smith, scoder type: -> compile error versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 15:24:19 2021 From: report at bugs.python.org (Roundup Robot) Date: Mon, 12 Apr 2021 19:24:19 +0000 Subject: [issue30528] ipaddress.IPv{4,6}Network.reverse_pointer is broken In-Reply-To: <1496250931.44.0.236459920081.issue30528@psf.upfronthosting.co.za> Message-ID: <1618255459.32.0.533897710138.issue30528@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 6.0 -> 7.0 pull_requests: +24104 pull_request: https://github.com/python/cpython/pull/25371 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 15:30:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 19:30:04 +0000 Subject: [issue41515] typing.get_type_hints generates KeyError In-Reply-To: <1597067038.73.0.335844562656.issue41515@roundup.psfhosted.org> Message-ID: <1618255804.0.0.817091993001.issue41515@roundup.psfhosted.org> STINNER Victor added the comment: This change introduced a regression: https://buildbot.python.org/all/#/builders/96/builds/1012 $ ./python -m test test___all__ 0:00:00 load avg: 0.28 Run tests sequentially 0:00:00 load avg: 0.28 [1/1] test___all__ test test___all__ failed -- Traceback (most recent call last): File "/home/vstinner/python/master/Lib/test/test___all__.py", line 104, in test_all self.check_all(modname) File "/home/vstinner/python/master/Lib/test/test___all__.py", line 25, in check_all exec("import %s" % modname, names) File "/home/vstinner/python/master/Lib/contextlib.py", line 140, in __exit__ next(self.gen) File "/home/vstinner/python/master/Lib/test/support/warnings_helper.py", line 177, in _filterwarnings raise AssertionError("unhandled warning %s" % reraise[0]) AssertionError: unhandled warning {message : SyntaxWarning('assertion is always true, perhaps remove parentheses?'), category : 'SyntaxWarning', filename : '/home/vstinner/python/master/Lib/test/test_typing.py', lineno : 2275, line : None} test___all__ failed == Tests result: FAILURE == 1 test failed: test___all__ Total duration: 2.7 sec Tests result: FAILURE It comes from the following line of test_bad_module() in Lib/test/test_typing: assert(get_type_hints(BadModule), {}) assert should be used as "assert test" or "assert test, expr". assert (expr, expr) tests if the tuple (2 items) is true, and it's always true. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 15:33:40 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 12 Apr 2021 19:33:40 +0000 Subject: [issue41515] typing.get_type_hints generates KeyError In-Reply-To: <1597067038.73.0.335844562656.issue41515@roundup.psfhosted.org> Message-ID: <1618256020.98.0.595482757964.issue41515@roundup.psfhosted.org> Guido van Rossum added the comment: Thanks -- odd this didn't fail in CI. We'll get it fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 15:42:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 19:42:22 +0000 Subject: [issue41515] typing.get_type_hints generates KeyError In-Reply-To: <1597067038.73.0.335844562656.issue41515@roundup.psfhosted.org> Message-ID: <1618256542.56.0.491465892027.issue41515@roundup.psfhosted.org> STINNER Victor added the comment: > Thanks -- odd this didn't fail in CI. The CI runs tests with "make buildbottest" which uses the -w option: -w, --verbose2 re-run failed tests in verbose mode When test___all__ is re-run in verbose mode, it doesn't fail: "== Tests result: FAILURE then SUCCESS ==" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 15:45:51 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 12 Apr 2021 19:45:51 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1618256751.66.0.335834297886.issue14243@roundup.psfhosted.org> Steve Dower added the comment: O_TEMPORARY is clearly not the right option here, and we should just move the unlink call into __exit__ and attempt it even if close() has been called. Windows's "delete on close" functionality is great, but if you haven't designed for its semantics, it's unusable. And this library is not designed for it, so users can't rely on the native functionality. So we stop passing the O_TEMPORARY flag. If __enter__() is called, close() closes the file but doesn't delete anything, and __exit__() closes the file (if open) and deletes it (even if it wasn't open). If there is no __enter__(), close() also deletes the file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 16:07:42 2021 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 12 Apr 2021 20:07:42 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1618258062.37.0.41205695258.issue40066@roundup.psfhosted.org> Stefan Behnel added the comment: > why /shouldn't/ we make the change? It breaks doctests, and probably some other unit tests, too, e.g. for output formatting. What should we suggest users to do? Replace >>> get_flag(?) by >>> get_flag(?) == app_enums.TrickyFlag or get_flag(?) # (also show result on failure) True and assertEqual( "You caught the %s flag!" % result, "You caught the app_enums.TrickyFlag flag!") by assertEqual( ("You caught the %s flag!" % result).replace("app_enums.", ""), "You caught the TrickyFlag flag!") ? Note that using "%r" does not help, since it's also backwards incompatible. For their own enums, users can probably backport (or forward-port) "__str__()" and "__repr__()" themselves in order to work around this difference. But it's something they would have to do. I certainly understand the reasoning, and it also makes new Py3.10-only doctests nicer, actually, but IMHO it counts as deliberate breakage. ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 16:14:14 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 12 Apr 2021 20:14:14 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618258454.86.0.885205101289.issue43816@roundup.psfhosted.org> Eric V. Smith added the comment: These files were probably added as part of str.format() or short float repr. I think the fact that they've been moved to Include/cpython means that user code shouldn't be using them. See https://bugs.python.org/issue35134 and https://vstinner.github.io/split-include-directory-python38.html. Probably best to ask Victor. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 16:17:28 2021 From: report at bugs.python.org (Joseph Ishac) Date: Mon, 12 Apr 2021 20:17:28 +0000 Subject: [issue43818] Email does not apply policy to multipart messages with defects Message-ID: <1618258648.79.0.562101023353.issue43818@roundup.psfhosted.org> New submission from Joseph Ishac : I have noticed an issue (Python 3.8.5) where an email can be read in as bytes, but will not be returned as such with the as_bytes() call if the message is multipart, has a boundary which is not properly quoted, and the message has non-ascii text. It seems to be a result of how multipart messages are treated if the NoBoundaryInMultipartDefect is encountered [See Test #1]. I would argue that attempting to output the test message in the sample script with an 8bit, utf-8 enabled policy should return the original bytes as the 8bit policy should be applied to the "body" portion (any part after the null lines) of the email (as would be the case if it were not multipart) [See Test #4] Currently it appears that the entire message is treated as headers, applying the strict 7bit, ascii requirement to the entire contents of the message. Furthermore, the msg.preamble is None. I am also uncertain that attempting to leverage the handle_defect hooks would be helpful as correcting the boundary doesn't seem to work unless you re-parse the message [See Tests #2 and #3] So the requested change would be to apply the encoding output policy to all portions of a message after the null line ending the headers. ---------- components: email files: email.multipart.test.py messages: 390897 nosy: barry, jishac, r.david.murray priority: normal severity: normal status: open title: Email does not apply policy to multipart messages with defects versions: Python 3.8 Added file: https://bugs.python.org/file49955/email.multipart.test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 16:21:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 20:21:37 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1618258897.41.0.127239773034.issue42238@roundup.psfhosted.org> STINNER Victor added the comment: Pablo reenabled the check: commit 20ac34772aa9805ccbf082e700f2b033291ff5d2 (upstream/master, master) Author: Pablo Galindo Date: Mon Apr 12 20:53:15 2021 +0100 Fix Sphinx errors in the documentation and re-activate the suspicious check (GH-25368) The suspicious check is still executed as part of the release process and release managers have been lately fixing some actual errors that the suspicious target can find. For this reason, reactivate the suspicious until we decide what to do in a coordinated fashion. ---------- nosy: +pablogsal, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 16:24:30 2021 From: report at bugs.python.org (Paul Moore) Date: Mon, 12 Apr 2021 20:24:30 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1618259070.92.0.533656186882.issue14243@roundup.psfhosted.org> Paul Moore added the comment: There's a lot of technical discussion of implementation details here, but not much about use cases. IMO, what's more important is whether NamedTemporaryFile is *useful* to people, and what they want to use it *for*. Working out how to implement it can come after we know what people want it to do. My particular use case is actually pretty simple, and I suspect constitutes a fairly major proportion of what people want of this API: 1. Create a temporary file. 2. Write some data into it. 3. At some point, we're done writing to the file. 4. Only after that point, pass the name of the file to "somewhere else" for processing. That's often, in my use cases, as an argument to a subprocess. 5. Once we're all done, clean up securely. The key additional requirement is that this is done "safely" (by which I mean I don't have to think about race conditions, etc, as someone else has that covered). What I think that means is that we need to maintain an open filehandle of *some* sort continually, but there's a point where the user can say "I'm done writing, I want to share this now". Is there an actual known use case for the behaviour of deleting the file on close *rather* than at the end of the CM's scope? That's unlike any other CM I know of, where the scope ending is what triggers tidy-up. Maybe NamedTemporaryFile should be retained for backward compatibility, but as a normal function, with the CM behaviour deprecated. It would still be essentially useless on Windows, but we maybe don't care about that. In addition, we create a *new* context manager, that simply creates the file at the start and deletes it at close of scope. It returns a writeable file object, but that can be closed (and the documentation notes that for portability it *must* be closed before passing the name to another process for use). I don't know enough about how we protect this against race condition attacks, but I'm pretty sure that this API gives us the best chance we're likely to have of doing so in a cross-platform manner. (Maybe we have a "reopen" method rather than "close". Or can we open *two* file handles at the start, one for writing and one for reading, return the one for writing, and keep the one for reading internal, purely to keep the file locked? I feel like that wouldn't work because if *we* can open a write handle, so could an attacker - but as I say, I'm not an expert). Basically, I may be wrong, but I feel that we should stop trying to "rescue" NamedTemporaryFile, and instead try providing an *alternative* that handles the cross-platform use case that started all of this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 16:27:49 2021 From: report at bugs.python.org (Andrew V. Jones) Date: Mon, 12 Apr 2021 20:27:49 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618259269.64.0.83324093653.issue43816@roundup.psfhosted.org> Andrew V. Jones added the comment: > I think the fact that they've been moved to Include/cpython means that user > code shouldn't be using them. > I think it is fine to say that they shouldn't be used, but then we get this from Victor's blog: > It was decided that internal header files must not be included implicitly by > the generic #include , but included explicitly. > So, is it the case that we have two issues here: 1) Cython is using stuff it shouldn't (I can do a PR against Cython) 2) Python.h is exposing more than it should (so, if Python "core" wants something from pyctype.h, it should be explicitly including pyctype.h and not getting via Python.h) ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 16:31:54 2021 From: report at bugs.python.org (daniel hahler) Date: Mon, 12 Apr 2021 20:31:54 +0000 Subject: [issue43798] Add position metadata to alias AST type In-Reply-To: <1618000136.49.0.849749645286.issue43798@roundup.psfhosted.org> Message-ID: <1618259514.56.0.0456727980877.issue43798@roundup.psfhosted.org> daniel hahler added the comment: @Pablo: the problem (referenced in the pytest issue) is that `ast.alias` has new required arguments now (see also the adjusted test in https://github.com/python/cpython/commit/75a06f067bd0a2687312e5f8e78f9075be76ad3a#diff-3f516b60719dd445d33225e4f316b36e85c9c51a843a0147349d11a005c55937R1060-R1061). That's expected/wanted though (assuming that it should not have "defaults" for B/C), and there's a patch for the issue at https://github.com/pytest-dev/pytest/pull/8540. ---------- nosy: +blueyed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 16:32:47 2021 From: report at bugs.python.org (daniel hahler) Date: Mon, 12 Apr 2021 20:32:47 +0000 Subject: [issue43798] Add position metadata to alias AST type In-Reply-To: <1618000136.49.0.849749645286.issue43798@roundup.psfhosted.org> Message-ID: <1618259567.09.0.905522063977.issue43798@roundup.psfhosted.org> Change by daniel hahler : ---------- versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 16:39:42 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Apr 2021 20:39:42 +0000 Subject: [issue43798] Add position metadata to alias AST type In-Reply-To: <1618000136.49.0.849749645286.issue43798@roundup.psfhosted.org> Message-ID: <1618259982.69.0.201187541921.issue43798@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ah, it was not clear from the issue that pytest was constructing nodes by hand. It makes sense now. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 16:46:51 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 12 Apr 2021 20:46:51 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1618260411.61.0.632749919847.issue14243@roundup.psfhosted.org> Ethan Furman added the comment: Paul, If "rescuing" (i.e. "fixing" ;) NamedTemporaryFile was arduous, complicated, or had serious backwards-compatibility issues then I would completely agree with you. However, the fix is simple, the only backwards-compatible issue is the file would still be there /while a context manager was in use/ after it had been closed (which conforms to most, if not all, users of context managers) and a file would be left on disk in the event of a hard crash (hopefully a rare occurrence). Your proposal, on the other, is a lot of work. Is the minor backwards compatibility worth all that work? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 16:47:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Apr 2021 20:47:32 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1618260452.88.0.286977201602.issue42238@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Background on why I reactivated it: I every single alpha release I had to fix actual documentation errors (no false positives) like the one fixed here: https://github.com/python/cpython/commit/20ac34772aa9805ccbf082e700f2b033291ff5d2 I don't like the check, but the release management team don't like to have to restart the release process just fo fix a bunch of docs issues that should have been detected by the CI. If we remove the fix, we need to coordinate all together because currently the status quo is that the RM team now is responsable of fixing the documentation errors as there are several release tools (and other ones) that depend on this target passing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 16:54:59 2021 From: report at bugs.python.org (Ian H) Date: Mon, 12 Apr 2021 20:54:59 +0000 Subject: [issue43819] ExtensionFileLoader Does Not Implement invalidate_caches Message-ID: <1618260899.84.0.216826895775.issue43819@roundup.psfhosted.org> New submission from Ian H : Currently there's no easy way to get at the internal cache of module spec objects for compiled extension modules. See https://github.com/python/cpython/blob/20ac34772aa9805ccbf082e700f2b033291ff5d2/Python/import.c#L401-L415. For example, these module spec objects continue to be cached even if we call importlib.invalidate_caches. ExtensionFileLoader doesn't implement the corresponding method for this. The comment in the C file referenced above implies this is done this way to avoid re-initializing extension modules. I'm not sure if this can be fixed, but I figured I'd ask for input. Our use-case is an academic project where we've been experimenting with building an interface for linker namespaces into Python to allow for (among other things) loading multiple copies of any module without explicit support from that module. We've been able to do this without having custom builds of Python. We've instead gone the route of overriding some of the import machinery at runtime. To make this work we need a way to prevent caching of previous import-related information about a specific extension module. We currently have to rely on an unfortunate hack to get access to the internal cache of module spec objects for extension modules and modify that dictionary manually. What we have works, but any sort of alternative would be welcome. ---------- messages: 390905 nosy: Ian.H priority: normal severity: normal status: open title: ExtensionFileLoader Does Not Implement invalidate_caches type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 16:57:40 2021 From: report at bugs.python.org (Paul Moore) Date: Mon, 12 Apr 2021 20:57:40 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1618261060.57.0.840738363457.issue14243@roundup.psfhosted.org> Paul Moore added the comment: Sorry - I'm maybe making an unwarranted assumption. If simply removing "delete on close" behaviour in the CM case is acceptable, then I'm 100% in favour of that. I'd assumed that it was somehow unacceptable, but you're right, and it's not clear if Eryk is agreeing or disagreeing with you (I assumed he was disagreeing, based mainly on the length and complexity of his response :-)) It didn't help that somehow Steve's reply wasn't visible when I posted mine. Apologies for the noise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 17:12:10 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 12 Apr 2021 21:12:10 +0000 Subject: [issue43820] Remove namespace copy from dataclasses.make_dataclass() Message-ID: <1618261930.36.0.318460450157.issue43820@roundup.psfhosted.org> New submission from Eric V. Smith : In make_dataclasses(), the "namespace" argument is copied because it is mutated. This isn't really necessary: the callback passed to types.new_class() could just update its "ns" parameter with "namespace" and with the new attributes (__anotations__ and default field values). This would eliminate the need to copy "namespace". ---------- assignee: eric.smith components: Library (Lib) messages: 390907 nosy: eric.smith priority: normal severity: normal status: open title: Remove namespace copy from dataclasses.make_dataclass() type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 17:21:17 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 12 Apr 2021 21:21:17 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1618262477.06.0.0179592435037.issue14243@roundup.psfhosted.org> Ethan Furman added the comment: Hey, you agree with me now, so it's not noise. ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 17:27:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 21:27:43 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1618262863.49.0.75851811263.issue43774@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 85918e4ab6e9410008aef6dedf000d24b3e120ea by Victor Stinner in branch 'master': bpo-43774: Add more links to configure options (GH-25363) https://github.com/python/cpython/commit/85918e4ab6e9410008aef6dedf000d24b3e120ea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 17:49:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 21:49:29 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618264169.75.0.0521319254483.issue43816@roundup.psfhosted.org> STINNER Victor added the comment: See https://github.com/python/cpython/blob/master/Include/README.rst for the organization of the C API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 17:52:05 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 12 Apr 2021 21:52:05 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1618264325.37.0.568205039865.issue14243@roundup.psfhosted.org> Eryk Sun added the comment: > So we stop passing the O_TEMPORARY flag. If __enter__() is called, > close() closes the file but doesn't delete anything, and > __exit__() closes the file (if open) and deletes it (even if it > wasn't open). If there is no __enter__(), close() also deletes the > file. This behavior change is fine if O_TEMPORARY isn't used. I wasn't disagreeing with Ethan. I was providing a summary of a common use case that conflicts with using O_TEMPORARY to make it clear that this flag has to be omitted if we're not implementing something like a delete_on_close boolean option. Most of my last comment, however, was dedicated to implementing TemporaryFile() if this change is applied, instead of leaving it as an alias for NamedTemporaryFile(). I can't imagine not wanting the guaranteed cleanup semantics of O_TEMPORARY in the case of an anonymous temporary file that doesn't need to be reopened. I also want O_SHORT_LIVED. This opens the file with the attribute FILE_ATTRIBUTE_TEMPORARY [1], which tells the cache manager to try to keep the file contents in memory instead of flushing data to disk. --- [1] https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew#caching_behavior ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 17:56:43 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 12 Apr 2021 21:56:43 +0000 Subject: [issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring In-Reply-To: <1618106073.56.0.0553736134144.issue43803@roundup.psfhosted.org> Message-ID: <1618264603.62.0.129009929484.issue43803@roundup.psfhosted.org> Eryk Sun added the comment: > If that's the problem then why not change all of them to use the > name "address" or "addr" to avoid confusion and make it clear > simple. What is your view? Change them all to refer to `ptr`. It's not worth introducing a breaking change: >>> ctypes.string_at(ptr=b'spam') b'spam' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 18:03:39 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 12 Apr 2021 22:03:39 +0000 Subject: [issue42248] Raised exception in Enum keeping user objects alive unnecessarily In-Reply-To: <1604350009.17.0.208770748804.issue42248@roundup.psfhosted.org> Message-ID: <1618265019.05.0.982337167919.issue42248@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 6379924ecd51e346b42b0293da0f4442a0f67707 by Ethan Furman in branch '3.9': [3.9] bpo-42248: [Enum] ensure exceptions raised in ``_missing_`` are released (GH-25350). (GH-25370) https://github.com/python/cpython/commit/6379924ecd51e346b42b0293da0f4442a0f67707 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 18:08:29 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 12 Apr 2021 22:08:29 +0000 Subject: [issue43820] Remove namespace copy from dataclasses.make_dataclass() In-Reply-To: <1618261930.36.0.318460450157.issue43820@roundup.psfhosted.org> Message-ID: <1618265309.76.0.608820758521.issue43820@roundup.psfhosted.org> Change by Eric V. Smith : ---------- keywords: +patch pull_requests: +24105 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25372 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 18:11:20 2021 From: report at bugs.python.org (=?utf-8?q?Josef_Havr=C3=A1nek?=) Date: Mon, 12 Apr 2021 22:11:20 +0000 Subject: [issue43821] Undocumented behavior of sleep functions and asyncio delayed execution Message-ID: <1618265480.34.0.661337068336.issue43821@roundup.psfhosted.org> New submission from Josef Havr?nek : Hi i found undocumented behavior of time.sleep, and call_at / call_later from asyncio loop There are two things to properly document/consider. It is time of delay/sleep when time for python stops (aka computer is going to hibernate/Cpu not runing) because time is relative from view of RTC(real time clock) and program both is correct curent behavior on Python 3.9.4 (tags/v3.9.4:1f2e308, Apr 6 2021, 13:40:21) [MSC v.1928 64 bit (AMD64)] on win32 There is time.sleep , asyncio.sleep and call_later They stall for time that has pased for program not on RTC (so it may take time) they not resume when time already passed in real word then there is loop.call_at there in in doc two kinda contradicadictory statements. and that is "This method?s behavior is the same as call_later()" "and Schedule callback to be called at the given absolute timestamp when (an int or a float), using the same time reference as loop.time()." thing is it should be legal acording to 1st qoute use loop.call_at(seconds_to_sleep, lambda:print("something usefull") but acording to 2nd we should use loop.call_at(seconds_to_sleep+loop.time(), lambda:print("something usefull") and They Both execute after seconds_to_sleep! this is a bug because time to sleep cant be bigger than curent loop.time() then it would execute at incorect time. Also there is second bug loop.call_at(seconds_to_sleep+loop.time(), lambda:print("something usefull") Even this is acording to me(how i understood from doc correct usage) This will efectively behave as call_later because it will not call callback when seconds_to_sleep already passed since submission however using loop.call_at(seconds_to_sleep, lambda:print("something usefull") will invoke as soon as program resumed from hybernation/when missed i think loop.call_at(seconds_to_sleep, lambda:print("something usefull") should not wait seconds_to_sleep when it is smaller then loop.time() and just execute it ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 390914 nosy: Josef Havr?nek, docs at python priority: normal severity: normal status: open title: Undocumented behavior of sleep functions and asyncio delayed execution type: behavior versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 18:13:21 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 12 Apr 2021 22:13:21 +0000 Subject: [issue43817] Add typing.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1618265601.29.0.750595625042.issue43817@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 18:36:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 12 Apr 2021 22:36:14 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1618266974.94.0.22947296439.issue43770@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24106 pull_request: https://github.com/python/cpython/pull/25373 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 21:08:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 01:08:46 +0000 Subject: [issue43797] Improve syntax error for invalid comparisons In-Reply-To: <1617995491.91.0.835586864843.issue43797@roundup.psfhosted.org> Message-ID: <1618276126.94.0.520722563864.issue43797@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24107 pull_request: https://github.com/python/cpython/pull/25375 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 21:21:18 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 13 Apr 2021 01:21:18 +0000 Subject: [issue40006] enum: Add documentation for _create_pseudo_member_ and composite members In-Reply-To: <1584562609.71.0.431349886951.issue40006@roundup.psfhosted.org> Message-ID: <1618276878.0.0.213476896565.issue40006@roundup.psfhosted.org> Change by Ethan Furman : ---------- keywords: +patch pull_requests: +24108 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25376 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 21:24:50 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 13 Apr 2021 01:24:50 +0000 Subject: [issue40006] enum: Add documentation for _create_pseudo_member_ and composite members In-Reply-To: <1584562609.71.0.431349886951.issue40006@roundup.psfhosted.org> Message-ID: <1618277090.05.0.015149466586.issue40006@roundup.psfhosted.org> Ethan Furman added the comment: `_create_pseudo_member_` was an implementation detail and has been removed. I did update the doc string which was migrated to `_missing_`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 21:30:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 01:30:43 +0000 Subject: [issue43822] Improve syntax errors for missing commas Message-ID: <1618277443.81.0.695650412986.issue43822@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Given that is quite common to forgot a comma in containers, function calls, ...etc and that the current error is: >>> [a, b, c d] File "", line 1 [a, b, c d] ^ SyntaxError: invalid syntax We could improve the user experience quite a lot if we mention that probably the user forgot a comma: >>> [a, b, c d] File "", line 1 [a, b, c d] ^ SyntaxError: invalid syntax. Perhaps you forgot a comma? ---------- messages: 390916 nosy: pablogsal priority: normal severity: normal status: open title: Improve syntax errors for missing commas _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 21:32:44 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 01:32:44 +0000 Subject: [issue43822] Improve syntax errors for missing commas In-Reply-To: <1618277443.81.0.695650412986.issue43822@roundup.psfhosted.org> Message-ID: <1618277564.97.0.924628173142.issue43822@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +24109 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25377 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 22:05:47 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 02:05:47 +0000 Subject: [issue43823] Improve syntax errors for invalid dictionary literals Message-ID: <1618279547.58.0.105219171129.issue43823@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Currently the error for invalid dict literals is generic: >>> {1:2, 3:} File "", line 1 {1:2, 3:} ^ SyntaxError: invalid syntax >>> {1:2, 3} File "", line 1 {1:2, 3} ^ SyntaxError: invalid syntax We can have better errors for these cases, which can help with big dict literals: >>> {1:2, 3} File "", line 1 {1:2, 3} ^ SyntaxError: ':' expected after dictionary key >>> {1:2, 3:} File "", line 1 {1:2, 3:} ^ SyntaxError: expression expected after dictionary key and ':' ---------- messages: 390917 nosy: pablogsal priority: normal severity: normal status: open title: Improve syntax errors for invalid dictionary literals _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 22:06:45 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 02:06:45 +0000 Subject: [issue43823] Improve syntax errors for invalid dictionary literals In-Reply-To: <1618279547.58.0.105219171129.issue43823@roundup.psfhosted.org> Message-ID: <1618279605.81.0.234537591274.issue43823@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +24110 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25378 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 23:00:23 2021 From: report at bugs.python.org (MingZhe Hu) Date: Tue, 13 Apr 2021 03:00:23 +0000 Subject: [issue43824] array.array.__deepcopy__() accepts a parameter of any type Message-ID: <1618282823.71.0.158081390215.issue43824@roundup.psfhosted.org> New submission from MingZhe Hu : The C implementation of foreign function array.array.__deepcopy__() is declared as follows: https://github.com/python/cpython/blob/d9151cb45371836d39b6d53afb50c5bcd353c661/Modules/arraymodule.c#L855 The second argument is unused in the function body. However, corresponding PyMethodDef is declared with `METH_O` flag, meaning one parameter should be passed to array.array.__deepcopy__() from the Python side: https://github.com/python/cpython/blob/d9151cb45371836d39b6d53afb50c5bcd353c661/Modules/clinic/arraymodule.c.h#L30 This makes the following code legal: ``` import array a = array.array('b', [ord('g')]) a.__deepcopy__('str') a.__deepcopy__(1) a.__deepcopy__([1,'str']) ``` A parameter of ANY type can be passed to the foreign function, without effect on its semantic. These code are clinic generated, and similar problems can be found for more foreign functions. ---------- components: Argument Clinic, Extension Modules messages: 390918 nosy: Elaphurus, larry priority: normal severity: normal status: open title: array.array.__deepcopy__() accepts a parameter of any type type: behavior versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 23:15:28 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 13 Apr 2021 03:15:28 +0000 Subject: [issue41515] typing.get_type_hints generates KeyError In-Reply-To: <1597067038.73.0.335844562656.issue41515@roundup.psfhosted.org> Message-ID: <1618283728.86.0.24410621238.issue41515@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- pull_requests: +24111 pull_request: https://github.com/python/cpython/pull/25379 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 23:17:59 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 13 Apr 2021 03:17:59 +0000 Subject: [issue41515] typing.get_type_hints generates KeyError In-Reply-To: <1597067038.73.0.335844562656.issue41515@roundup.psfhosted.org> Message-ID: <1618283879.26.0.884802515903.issue41515@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks Victor. I have created https://github.com/python/cpython/pull/25379 that uses self.assertEqual instead of assert that produces syntax warning. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 12 23:56:40 2021 From: report at bugs.python.org (Josh Rosenberg) Date: Tue, 13 Apr 2021 03:56:40 +0000 Subject: [issue43824] array.array.__deepcopy__() accepts a parameter of any type In-Reply-To: <1618282823.71.0.158081390215.issue43824@roundup.psfhosted.org> Message-ID: <1618286200.17.0.642193445143.issue43824@roundup.psfhosted.org> Josh Rosenberg added the comment: __deepcopy__ is required to take a second argument by the rules of the copy module; the second argument is supposed to be a memo dictionary, but there's no reason to use it for array.array (it can't contain Python objects, and you only use the memo dictionary when recursing to Python objects you contain). Sure, the second argument isn't being type-checked, but it's not used at all, and it's only supposed to be invoked indirectly via copy.deepcopy (that passes a dict). Can you explain what is wrong here that needs to be fixed? Seems like a straightforward "protocol requires argument, but use case doesn't have anything to do with it, so it ignores it". Are you suggesting adding type-checks for something that never gets used? ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 00:51:57 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 13 Apr 2021 04:51:57 +0000 Subject: [issue43787] Optimize BZ2File, GzipFile, and LZMAFile __iter__ method. In-Reply-To: <1617958183.01.0.290245206759.issue43787@roundup.psfhosted.org> Message-ID: <1618289517.0.0.542833848267.issue43787@roundup.psfhosted.org> Inada Naoki added the comment: New changeset d2a8e69c2c605fbaa3656a5f99aa8d295f74c80e by Inada Naoki in branch 'master': bpo-43787: Add __iter__ to GzipFile, BZ2File, and LZMAFile (GH-25353) https://github.com/python/cpython/commit/d2a8e69c2c605fbaa3656a5f99aa8d295f74c80e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 00:52:26 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 13 Apr 2021 04:52:26 +0000 Subject: [issue43787] Optimize BZ2File, GzipFile, and LZMAFile __iter__ method. In-Reply-To: <1617958183.01.0.290245206759.issue43787@roundup.psfhosted.org> Message-ID: <1618289546.47.0.421053992606.issue43787@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 01:11:38 2021 From: report at bugs.python.org (Jordan Borean) Date: Tue, 13 Apr 2021 05:11:38 +0000 Subject: [issue37179] asyncio loop.start_tls() provide support for TLS in TLS In-Reply-To: <1559843713.76.0.0171515478407.issue37179@roundup.psfhosted.org> Message-ID: <1618290698.82.0.40876433551.issue37179@roundup.psfhosted.org> Jordan Borean added the comment: I'm looking through the PR https://github.com/python/cpython/pull/17975 and it doesn't look like it addresses this particular problem. The code for start_tls https://github.com/python/cpython/blob/d2a8e69c2c605fbaa3656a5f99aa8d295f74c80e/Lib/asyncio/base_events.py#L1210-L1212 has a check for the attribute '_start_tls_compatible' but _SSLProtocolTransport (https://github.com/python/cpython/blob/master/Lib/asyncio/sslproto.py) does not set this. The PR mentioned https://github.com/python/cpython/pull/17975 does not seem to touch any of this so I would assume the problem is still there? I also installed 3.10.0a7 and this problem still persists when I call loop.start_tls with my SSL writer transport. ---------- nosy: +jborean93 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 01:15:15 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 13 Apr 2021 05:15:15 +0000 Subject: [issue43825] Deprecation warnings in test cases Message-ID: <1618290915.84.0.96654876493.issue43825@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : Following deprecation warnings are raised when tests are ran with -Wall in CPython test suite. I will raise a PR for this. 0:03:48 load avg: 0.79 [ 59/427] test_cmd_line /root/cpython/Lib/test/test_cmd_line.py:865: DeprecationWarning: invalid escape sequence \u self.check_string(b"'\u1f'") 0:04:11 load avg: 0.86 [ 77/427] test_collections /root/cpython/Lib/test/test_collections.py:1518: DeprecationWarning: Please use assertEqual instead. self.assertEquals(len(s), len(items) - 1) ---------- components: Tests messages: 390923 nosy: xtreak priority: normal severity: normal status: open title: Deprecation warnings in test cases type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 01:17:30 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 13 Apr 2021 05:17:30 +0000 Subject: [issue43825] Deprecation warnings in test cases In-Reply-To: <1618290915.84.0.96654876493.issue43825@roundup.psfhosted.org> Message-ID: <1618291050.78.0.0926684906681.issue43825@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- keywords: +patch pull_requests: +24112 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25380 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 01:28:54 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 13 Apr 2021 05:28:54 +0000 Subject: [issue43826] Resource warnings in test_subprocess Message-ID: <1618291734.0.0.346590897335.issue43826@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : It seems that some of the pipe objects were not closed properly causing resource warnings. Regarding "subprocess still running warning" I guess we need to call kill() on the subprocess before exiting test_send_signal_race2. I will raise a PR for this. ? cpython git:(master) ./python -X dev -Wall -m test test_subprocess 0:00:00 load avg: 0.06 Run tests sequentially 0:00:00 load avg: 0.06 [1/1] test_subprocess /root/cpython/Lib/subprocess.py:1066: ResourceWarning: subprocess 22107 is still running _warn("subprocess %s is still running" % self.pid, ResourceWarning: Enable tracemalloc to get the object allocation traceback /root/cpython/Lib/unittest/case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=5> method() ResourceWarning: Enable tracemalloc to get the object allocation traceback /root/cpython/Lib/unittest/case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=7> method() ResourceWarning: Enable tracemalloc to get the object allocation traceback /root/cpython/Lib/unittest/case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=5> method() ResourceWarning: Enable tracemalloc to get the object allocation traceback /root/cpython/Lib/unittest/case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=7> method() ResourceWarning: Enable tracemalloc to get the object allocation traceback /root/cpython/Lib/unittest/case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=5> method() ResourceWarning: Enable tracemalloc to get the object allocation traceback /root/cpython/Lib/unittest/case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=7> method() ResourceWarning: Enable tracemalloc to get the object allocation traceback /root/cpython/Lib/unittest/case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=5> method() ResourceWarning: Enable tracemalloc to get the object allocation traceback /root/cpython/Lib/unittest/case.py:549: ResourceWarning: unclosed file <_io.BufferedReader name=7> method() ResourceWarning: Enable tracemalloc to get the object allocation traceback == Tests result: SUCCESS == 1 test OK. Total duration: 28.9 sec Tests result: SUCCESS ---------- components: Tests messages: 390924 nosy: giampaolo.rodola, gregory.p.smith, xtreak priority: normal severity: normal status: open title: Resource warnings in test_subprocess type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 01:31:26 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 13 Apr 2021 05:31:26 +0000 Subject: [issue43826] Resource warnings in test_subprocess In-Reply-To: <1618291734.0.0.346590897335.issue43826@roundup.psfhosted.org> Message-ID: <1618291886.82.0.944369643223.issue43826@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- keywords: +patch pull_requests: +24113 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25381 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 02:10:25 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 13 Apr 2021 06:10:25 +0000 Subject: [issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring In-Reply-To: <1618106073.56.0.0553736134144.issue43803@roundup.psfhosted.org> Message-ID: <1618294225.57.0.199320054341.issue43803@roundup.psfhosted.org> Shreyan Avigyan added the comment: Ok...let me review again. Having different names for the same argument can cause confusion, right? So are you telling that we should change the name to "ptr" to avoid a breaking change? If this issue is confirmed, I'm ready to submit a PR to make this change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 02:17:34 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 13 Apr 2021 06:17:34 +0000 Subject: [issue43799] OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1 In-Reply-To: <1618047260.96.0.943530034595.issue43799@roundup.psfhosted.org> Message-ID: <1618294654.64.0.23098642667.issue43799@roundup.psfhosted.org> Christian Heimes added the comment: New changeset a4833883c9b81b6b272cc7c5b67fa1658b65304c by Christian Heimes in branch 'master': bpo-43799: OpenSSL 3.0.0: declare OPENSSL_API_COMPAT 1.1.1 (GH-25329) https://github.com/python/cpython/commit/a4833883c9b81b6b272cc7c5b67fa1658b65304c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 02:18:02 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Apr 2021 06:18:02 +0000 Subject: [issue43799] OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1 In-Reply-To: <1618047260.96.0.943530034595.issue43799@roundup.psfhosted.org> Message-ID: <1618294682.04.0.259419066756.issue43799@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +24114 pull_request: https://github.com/python/cpython/pull/25382 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 02:41:08 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Apr 2021 06:41:08 +0000 Subject: [issue43799] OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1 In-Reply-To: <1618047260.96.0.943530034595.issue43799@roundup.psfhosted.org> Message-ID: <1618296068.81.0.500993746473.issue43799@roundup.psfhosted.org> miss-islington added the comment: New changeset 7d9d5bf863bb0af26b74b0732ab89b2053d2fbec by Miss Islington (bot) in branch '3.9': [3.9] bpo-43799: OpenSSL 3.0.0: declare OPENSSL_API_COMPAT 1.1.1 (GH-25329) (GH-25382) https://github.com/python/cpython/commit/7d9d5bf863bb0af26b74b0732ab89b2053d2fbec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 02:44:40 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 13 Apr 2021 06:44:40 +0000 Subject: [issue43799] OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1 In-Reply-To: <1618047260.96.0.943530034595.issue43799@roundup.psfhosted.org> Message-ID: <1618296280.52.0.578818549612.issue43799@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24115 pull_request: https://github.com/python/cpython/pull/25383 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 02:50:29 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 13 Apr 2021 06:50:29 +0000 Subject: [issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring In-Reply-To: <1618106073.56.0.0553736134144.issue43803@roundup.psfhosted.org> Message-ID: <1618296629.0.0.694303562043.issue43803@roundup.psfhosted.org> Eryk Sun added the comment: > So are you telling that we should change the name to "ptr" to > avoid a breaking change? The function parameter name is "ptr". Changing that name could break existing code. I don't think it's likely, but it's not worth breaking even one script just for this. So change the docstring and documentation to refer to "ptr". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 02:51:48 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 13 Apr 2021 06:51:48 +0000 Subject: [issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring In-Reply-To: <1618106073.56.0.0553736134144.issue43803@roundup.psfhosted.org> Message-ID: <1618296708.21.0.898959277114.issue43803@roundup.psfhosted.org> Shreyan Avigyan added the comment: Ok..then submitting the PR in 10 minutes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 03:08:55 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 13 Apr 2021 07:08:55 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1618297735.46.0.995580647482.issue38820@roundup.psfhosted.org> Change by Christian Heimes : ---------- dependencies: +OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1, Run GHA CI with multiple OpenSSL versions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 03:09:29 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 13 Apr 2021 07:09:29 +0000 Subject: [issue43799] OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1 In-Reply-To: <1618047260.96.0.943530034595.issue43799@roundup.psfhosted.org> Message-ID: <1618297769.47.0.1181747127.issue43799@roundup.psfhosted.org> Christian Heimes added the comment: New changeset b71aaa0df0f3a9640b034b4774651cd8c54d2fb9 by Christian Heimes in branch '3.8': [3.8] bpo-43799: OpenSSL 3.0.0: declare OPENSSL_API_COMPAT 1.1.1 (GH-25329) (GH-25383) https://github.com/python/cpython/commit/b71aaa0df0f3a9640b034b4774651cd8c54d2fb9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 03:09:39 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 13 Apr 2021 07:09:39 +0000 Subject: [issue43799] OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1 In-Reply-To: <1618047260.96.0.943530034595.issue43799@roundup.psfhosted.org> Message-ID: <1618297779.52.0.422042008881.issue43799@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 03:09:58 2021 From: report at bugs.python.org (Andrew Ushakov) Date: Tue, 13 Apr 2021 07:09:58 +0000 Subject: [issue38755] Long unicode string causes SyntaxError: Non-UTF-8 code starting with '\xe2' in file ..., but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details In-Reply-To: <1573302408.95.0.156655994529.issue38755@roundup.psfhosted.org> Message-ID: <1618297798.03.0.467169516494.issue38755@roundup.psfhosted.org> Andrew Ushakov added the comment: Just tested again: D:\Downloads>py Python 3.9.4 (tags/v3.9.4:1f2e308, Apr 4 2021, 13:27:16) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or"license" for more information. >>> quit() D:\Downloads>py tst112.py SyntaxError: Non-UTF-8 code starting with '\xe2' in file D:\Downloads\tst112.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details P.S. No problems with Python 3.8.5 and Ubuntu 20.04.2 LTS. ---------- versions: +Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 03:10:33 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 13 Apr 2021 07:10:33 +0000 Subject: [issue43811] Run GHA CI with multiple OpenSSL versions In-Reply-To: <1618216687.81.0.190201617408.issue43811@roundup.psfhosted.org> Message-ID: <1618297833.33.0.447360947176.issue43811@roundup.psfhosted.org> Christian Heimes added the comment: The new checks are only executed when one or more OpenSSL-related files are modified. The checks run a handful of networking and hashing test suites. All SSL checks are optional. This PR also introduces ccache to speed up compilation. In common cases it speeds up configure and compile time from about 90 seconds to less than 30 seconds. ---------- dependencies: +Run GHA CI with multiple OpenSSL versions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 03:57:15 2021 From: report at bugs.python.org (Vlad Hoi) Date: Tue, 13 Apr 2021 07:57:15 +0000 Subject: [issue43827] abc conflicts with __init_subclass__ Message-ID: <1618300635.23.0.984081288048.issue43827@roundup.psfhosted.org> New submission from Vlad Hoi : from abc import ABC class A: def __init_subclass__(self): pass class B(ABC, A, name="name"): pass After initialising class B, this exception occurs, because multiple "name" arguments where provided: Traceback (most recent call last): File "test_abc", line 9, in class B(ABC, A, name="name"): TypeError: __new__() got multiple values for argument 'name' ---------- components: Extension Modules messages: 390933 nosy: vladhoi priority: normal severity: normal status: open title: abc conflicts with __init_subclass__ type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 03:59:11 2021 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 13 Apr 2021 07:59:11 +0000 Subject: [issue37179] asyncio loop.start_tls() provide support for TLS in TLS In-Reply-To: <1559843713.76.0.0171515478407.issue37179@roundup.psfhosted.org> Message-ID: <1618300751.02.0.78804857234.issue37179@roundup.psfhosted.org> Andrew Svetlov added the comment: Thanks for the reminder. You are correct, the mentioned PR should set _SSLProtocolTransport._start_tls_compatible to True ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 04:11:21 2021 From: report at bugs.python.org (Andy Maier) Date: Tue, 13 Apr 2021 08:11:21 +0000 Subject: [issue43828] MappingProxyType accepts string Message-ID: <1618301481.88.0.305881121954.issue43828@roundup.psfhosted.org> New submission from Andy Maier : MappingProxyType objects can currently be initialized from a string object. Given is purpose, I think this is a bug and should result in TypeError being raised. Example code (on CPython 3.9.1): >>> from types import MappingProxyType >>> mp = MappingProxyType('abc') >>> list(mp) ['a', 'b', 'c'] >>> mp.items() Traceback (most recent call last): File "", line 1, in AttributeError: 'str' object has no attribute 'items' Other invalid input types are properly checked: >>> mp = MappingProxyType(42) Traceback (most recent call last): File "", line 1, in TypeError: mappingproxy() argument must be a mapping, not int >>> mp = MappingProxyType(['a']) Traceback (most recent call last): File "", line 1, in TypeError: mappingproxy() argument must be a mapping, not list >>> mp = MappingProxyType(('a',)) Traceback (most recent call last): File "", line 1, in TypeError: mappingproxy() argument must be a mapping, not tuple ---------- components: Library (Lib) messages: 390935 nosy: andymaier priority: normal severity: normal status: open title: MappingProxyType accepts string versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 04:12:25 2021 From: report at bugs.python.org (Andy Maier) Date: Tue, 13 Apr 2021 08:12:25 +0000 Subject: [issue43828] MappingProxyType accepts string In-Reply-To: <1618301481.88.0.305881121954.issue43828@roundup.psfhosted.org> Message-ID: <1618301545.63.0.627485856414.issue43828@roundup.psfhosted.org> Change by Andy Maier : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 04:25:32 2021 From: report at bugs.python.org (Andy Maier) Date: Tue, 13 Apr 2021 08:25:32 +0000 Subject: [issue43829] MappingProxyType cannot hash a hashable underlying mapping Message-ID: <1618302332.9.0.266217619907.issue43829@roundup.psfhosted.org> New submission from Andy Maier : Objects of MappingProxyType do expose a __hash__() method, but if the underlying mapping is hashable, it still does not support hashing it. Example: Content of mp_hash.py: ------ #!/usr/bin/env python from nocasedict import NocaseDict, HashableMixin from types import MappingProxyType class HashableDict(HashableMixin, NocaseDict): """A hashable dictionary""" pass hd = HashableDict({'a': 1, 'b': 2}) print("hash(hd): {}".format(hash(hd))) mp = MappingProxyType(hd) print("hash(mp): {}".format(hash(mp))) ------- Running the mp_hash.py script: hash(hd): 3709951335832776636 Traceback (most recent call last): File "/Users/maiera/Projects/Python/cpython/issues/mappingproxy/./mp_hash.py", line 14, in print("hash(mp): {}".format(hash(mp))) TypeError: unhashable type: 'mappingproxy' There are use cases where a function wants to return an immutable view on an internal dictionary, and the caller of the function should be able to use the returned object like a dictionary, except that it is read-only. Note there is https://bugs.python.org/issue31209 on the inability to pickle MappingProxyType objects which was closed without adding the capability. That would fall under the same argument. ---------- components: Library (Lib) messages: 390936 nosy: andymaier priority: normal severity: normal status: open title: MappingProxyType cannot hash a hashable underlying mapping type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 04:34:04 2021 From: report at bugs.python.org (MingZhe Hu) Date: Tue, 13 Apr 2021 08:34:04 +0000 Subject: [issue43824] array.array.__deepcopy__() accepts a parameter of any type In-Reply-To: <1618282823.71.0.158081390215.issue43824@roundup.psfhosted.org> Message-ID: <1618302844.93.0.66628671133.issue43824@roundup.psfhosted.org> MingZhe Hu added the comment: copy.deepcopy() takes a memo argument for reason, but this memo object will not be used when passed to array.array.__deepcopy__(), that is, no matter called directly or not, as long as the C implementation of array.array.__deepcopy__() does not use the parameter(s) passed from the Python side, why not declare it using flag `METH_NOARGS`? If I understand right, in following code, the memo passed to __deepcopy__() is meaningless: https://github.com/python/cpython/blob/a4833883c9b81b6b272cc7c5b67fa1658b65304c/Lib/copy.py#L151-L153 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 04:52:16 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 13 Apr 2021 08:52:16 +0000 Subject: [issue43824] array.array.__deepcopy__() accepts a parameter of any type In-Reply-To: <1618282823.71.0.158081390215.issue43824@roundup.psfhosted.org> Message-ID: <1618303936.4.0.270814215018.issue43824@roundup.psfhosted.org> Serhiy Storchaka added the comment: I you declare a method as METH_NOARGS, you would not able to pass any argument to it. I concur with Josh. There is nothing wrong here. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 04:54:53 2021 From: report at bugs.python.org (Nathan Fallet) Date: Tue, 13 Apr 2021 08:54:53 +0000 Subject: [issue43830] (-1) ** 0.5 returns (6.123233995736766e-17+1j) instead of 1j Message-ID: <1618304093.14.0.191695728369.issue43830@roundup.psfhosted.org> New submission from Nathan Fallet : Complex exponentiation doesn't work as expected: ``` >>> (-1) ** 0.5 (6.123233995736766e-17+1j) ``` I think the issue is linked with this part of the code: https://github.com/python/cpython/blob/32bd68c839adb7b42af12366ab0892303115d1d1/Objects/complexobject.c#L142-L151 ---------- messages: 390939 nosy: NathanFallet priority: normal severity: normal status: open title: (-1) ** 0.5 returns (6.123233995736766e-17+1j) instead of 1j type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 04:55:52 2021 From: report at bugs.python.org (Carl Friedrich Bolz-Tereick) Date: Tue, 13 Apr 2021 08:55:52 +0000 Subject: [issue3451] Asymptotically faster divmod and str(long) In-Reply-To: <1217121065.64.0.642253571203.issue3451@psf.upfronthosting.co.za> Message-ID: <1618304152.97.0.847733307949.issue3451@roundup.psfhosted.org> Carl Friedrich Bolz-Tereick added the comment: FWIW, we have implemented a faster algorithm for divmod for big numbers using Mark's fast_div.py in PyPy. In particular, this speeds up str(long) for large numbers significantly (eg calling str on the result of math.factorial(2**17) is now 15x faster than CPython ;-)). ---------- nosy: +Carl.Friedrich.Bolz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 05:10:26 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 13 Apr 2021 09:10:26 +0000 Subject: [issue43830] (-1) ** 0.5 returns (6.123233995736766e-17+1j) instead of 1j In-Reply-To: <1618304093.14.0.191695728369.issue43830@roundup.psfhosted.org> Message-ID: <1618305026.36.0.230916335124.issue43830@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 05:17:32 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 13 Apr 2021 09:17:32 +0000 Subject: [issue43731] PEP 597: logging.fileConfig() uses locale encoding. In-Reply-To: <1617596968.06.0.267322224871.issue43731@roundup.psfhosted.org> Message-ID: <1618305452.28.0.513885000532.issue43731@roundup.psfhosted.org> Inada Naoki added the comment: New changeset c2b7a66b91cdb96fbfdb160f96797208ddc5e436 by Inada Naoki in branch 'master': bpo-43731: Add an `encoding` parameter to logging.fileConfig() (GH-25273) https://github.com/python/cpython/commit/c2b7a66b91cdb96fbfdb160f96797208ddc5e436 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 05:17:22 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 13 Apr 2021 09:17:22 +0000 Subject: [issue43731] PEP 597: logging.fileConfig() uses locale encoding. In-Reply-To: <1617596968.06.0.267322224871.issue43731@roundup.psfhosted.org> Message-ID: <1618305442.31.0.776479059244.issue43731@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 05:36:19 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 13 Apr 2021 09:36:19 +0000 Subject: [issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring In-Reply-To: <1618106073.56.0.0553736134144.issue43803@roundup.psfhosted.org> Message-ID: <1618306579.56.0.468665636169.issue43803@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- keywords: +patch pull_requests: +24116 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25384 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 05:37:31 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 13 Apr 2021 09:37:31 +0000 Subject: [issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring In-Reply-To: <1618106073.56.0.0553736134144.issue43803@roundup.psfhosted.org> Message-ID: <1618306651.41.0.158574855536.issue43803@roundup.psfhosted.org> Shreyan Avigyan added the comment: PR opened for this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 05:37:26 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 13 Apr 2021 09:37:26 +0000 Subject: [issue38755] Long unicode string causes SyntaxError: Non-UTF-8 code starting with '\xe2' in file ..., but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details In-Reply-To: <1573302408.95.0.156655994529.issue38755@roundup.psfhosted.org> Message-ID: <1618306646.43.0.0976888456209.issue38755@roundup.psfhosted.org> Eryk Sun added the comment: > P.S. No problems with Python 3.8.5 and Ubuntu 20.04.2 LTS. The issue is that the line length is limited to BUFSIZ, which ends up splitting the UTF-8 sequence b'\xe2\x96\x91'. BUFSIZ is only 512 bytes in Windows. It's 8192 bytes in Linux, in which case you need a line that's 16 times longer in order to reproduce the error. For example: $ stat -c "%s" test.py 8194 $ python3.9 test.py SyntaxError: Non-UTF-8 code starting with '\xe2' in file /home/someone/test.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details This has been fixed in a rewrite of the tokenizer (bpo-25643), for which the PR was recently merged into the main branch for 3.10a7+. Maybe a minimal backport to keep reading up to "\n" can be applied to 3.8 and 3.9. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 05:38:00 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 13 Apr 2021 09:38:00 +0000 Subject: [issue38755] Long unicode string causes SyntaxError: Non-UTF-8 code starting with '\xe2' in file ..., but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details In-Reply-To: <1573302408.95.0.156655994529.issue38755@roundup.psfhosted.org> Message-ID: <1618306680.0.0.293794704166.issue38755@roundup.psfhosted.org> Change by Eryk Sun : ---------- stage: test needed -> needs patch versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 05:48:02 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 09:48:02 +0000 Subject: [issue43731] PEP 597: logging.fileConfig() uses locale encoding. In-Reply-To: <1617596968.06.0.267322224871.issue43731@roundup.psfhosted.org> Message-ID: <1618307282.09.0.173216475463.issue43731@roundup.psfhosted.org> STINNER Victor added the comment: > fileConfig(fname, defaults=None, disable_existing_loggers=True, encoding=None) If "locale" is the intended default, why not being more explicit and use encoding="locale"? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 05:48:40 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 13 Apr 2021 09:48:40 +0000 Subject: [issue42904] get_type_hints does not provide localns for classes In-Reply-To: <1610427615.24.0.000795612365541.issue42904@roundup.psfhosted.org> Message-ID: <1618307320.37.0.296064333546.issue42904@roundup.psfhosted.org> Ken Jin added the comment: Yup I can! BTW, I agree with keeping the change in 3.10 only. I suspect it _may_ be backwards-incompatible in small edge cases (re: the long comment on the PR about suspicions with local and global scope). ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 05:51:26 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 13 Apr 2021 09:51:26 +0000 Subject: [issue43830] (-1) ** 0.5 returns (6.123233995736766e-17+1j) instead of 1j In-Reply-To: <1618304093.14.0.191695728369.issue43830@roundup.psfhosted.org> Message-ID: <1618307486.61.0.413812979877.issue43830@roundup.psfhosted.org> Steven D'Aprano added the comment: What do you mean? It works as I expected. Can you explain what you expected, and why? ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 05:55:28 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 13 Apr 2021 09:55:28 +0000 Subject: [issue43830] (-1) ** 0.5 returns (6.123233995736766e-17+1j) instead of 1j In-Reply-To: <1618304093.14.0.191695728369.issue43830@roundup.psfhosted.org> Message-ID: <1618307728.98.0.112071105134.issue43830@roundup.psfhosted.org> Steven D'Aprano added the comment: Before replying please read: https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate https://duckduckgo.com/?q=python+why+are+floating+point+so+inaccurate ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 05:58:30 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 13 Apr 2021 09:58:30 +0000 Subject: [issue43830] (-1) ** 0.5 returns (6.123233995736766e-17+1j) instead of 1j In-Reply-To: <1618304093.14.0.191695728369.issue43830@roundup.psfhosted.org> Message-ID: <1618307910.4.0.522912777042.issue43830@roundup.psfhosted.org> Steven D'Aprano added the comment: Sorry Nathan, I worded my first response awkwardly, of course mathematically we should expect a result of 1j, by why do you expect it in a floating point calculation? Do you have an alternative? (I promise this is my last comment until you have had a chance to reply.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 06:00:00 2021 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 13 Apr 2021 10:00:00 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618308000.7.0.190347751853.issue43816@roundup.psfhosted.org> Stefan Behnel added the comment: The macros were moved to "Includes/cpython/", not to "Includes/internal/". That suggests to me that they should use "extern C", so that C++ code that wants to make use of CPython internals can use them. Basically, the way I see it, *all* header files in "Includes/" and "Includes/cpython/" should work with C++ code and thus have an "extern C". Only the header files in "Includes/internal/" should not have them. Regardless, I've removed the macro usage from Cython so that the current state doesn't hurt our users. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 06:05:17 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 13 Apr 2021 10:05:17 +0000 Subject: [issue43646] ForwardRef name conflict during evaluation In-Reply-To: <1616925169.4.0.788953716536.issue43646@roundup.psfhosted.org> Message-ID: <1618308317.52.0.215023731806.issue43646@roundup.psfhosted.org> Ken Jin added the comment: @tefra, now that issue42904 has been solved, can you test your code again with 3.10.0a8? (it's not out yet, so you may have to pull the code from CPython's GitHub master branch and build CPython) Running your code again, it seems to be fixed: Python 3.10.0a7+ >>> from typing import get_type_hints, Optional >>> from a import Root as RootA, Person as PersonA >>> from b import Root as RootB, Person as PersonB >>> roota_hints = get_type_hints(RootA) >>> rootb_hints = get_type_hints(RootB) >>> print(roota_hints) {'a': typing.List[a.Person]} >>> print(rootb_hints) {'b': typing.List[b.Person]} However, it's still around for 3.9 and below if I use string annotations in classes. There's some discussion in that issue about why it may not be backported though. ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 06:08:31 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 13 Apr 2021 10:08:31 +0000 Subject: [issue43760] The DISPATCH() macro is not as efficient as it could be. In-Reply-To: <1617788149.78.0.581729826447.issue43760@roundup.psfhosted.org> Message-ID: <1618308511.59.0.782443609007.issue43760@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 9e7b2076fb4380987ad0262c4c0ca900b06475ad by Mark Shannon in branch 'master': bpo-43760: Speed up check for tracing in interpreter dispatch (#25276) https://github.com/python/cpython/commit/9e7b2076fb4380987ad0262c4c0ca900b06475ad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 06:11:14 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 13 Apr 2021 10:11:14 +0000 Subject: [issue43731] PEP 597: logging.fileConfig() uses locale encoding. In-Reply-To: <1617596968.06.0.267322224871.issue43731@roundup.psfhosted.org> Message-ID: <1618308674.32.0.567954842058.issue43731@roundup.psfhosted.org> Inada Naoki added the comment: If we use `encoding="locale"` by default, EncodingWarning will be not be emitted even when user omit `encoding` option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 06:15:57 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 13 Apr 2021 10:15:57 +0000 Subject: [issue14811] decoding_fgets() truncates long lines and fails with a SyntaxError("Non-UTF-8 code starting with...") In-Reply-To: <1337056300.81.0.374626607094.issue14811@psf.upfronthosting.co.za> Message-ID: <1618308957.23.0.754853262725.issue14811@roundup.psfhosted.org> Change by Eryk Sun : ---------- versions: +Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 06:19:57 2021 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Tue, 13 Apr 2021 10:19:57 +0000 Subject: [issue42722] Add --debug command line option to unittest to enable post-mortem debugging In-Reply-To: <1608680811.32.0.033035519481.issue42722@roundup.psfhosted.org> Message-ID: <1618309197.98.0.0740996307547.issue42722@roundup.psfhosted.org> Change by R?mi Lapeyre : ---------- nosy: +remi.lapeyre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 06:42:10 2021 From: report at bugs.python.org (Vlad Hoi) Date: Tue, 13 Apr 2021 10:42:10 +0000 Subject: [issue43827] abc conflicts with __init_subclass__ In-Reply-To: <1618300635.23.0.984081288048.issue43827@roundup.psfhosted.org> Message-ID: <1618310530.34.0.976629574408.issue43827@roundup.psfhosted.org> Change by Vlad Hoi : ---------- keywords: +patch pull_requests: +24117 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25385 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 06:59:55 2021 From: report at bugs.python.org (=?utf-8?q?Lum=C3=ADr_Balhar?=) Date: Tue, 13 Apr 2021 10:59:55 +0000 Subject: [issue43831] sqlite: convert_timestamp raises ValueError for empty columns Message-ID: <1618311594.99.0.0340525219314.issue43831@roundup.psfhosted.org> New submission from Lum?r Balhar : Hello. I've discovered this issue when I was debugging a test failure in IPython. See this issue for more details (not needed): https://github.com/ipython/ipython/issues/12906 I'm testing this on Fedora Linux with Python 3.10.0a7 from our RPM package with SQLite 3.35.4. I have a very simple SQLite database: # sqlite3 test.sqlite SQLite version 3.35.4 2021-04-02 15:20:15 Enter ".help" for usage hints. sqlite> .dump PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; CREATE TABLE sessions (session integer primary key autoincrement, start timestamp, end timestamp, num_cmds integer, remark text); INSERT INTO sessions VALUES(1,'2021-04-13 09:44:58.903345',NULL,NULL,''); DELETE FROM sqlite_sequence; INSERT INTO sqlite_sequence VALUES('sessions',1); COMMIT; When I query it without special converters, it works well: # python3 >>> import sqlite3 >>> conn = sqlite3.connect('test.sqlite') >>> c = conn.cursor() >>> c.execute("SELECT * from sessions where session == 1").fetchone() (1, '2021-04-13 09:44:58.903345', None, None, '') >>> but with detect_types=sqlite3.PARSE_DECLTYPES, it fails to parse the date and time: # python3 >>> import sqlite3 >>> conn = sqlite3.connect('test.sqlite', detect_types=sqlite3.PARSE_DECLTYPES) >>> c = conn.cursor() >>> c.execute("SELECT * from sessions where session == 1").fetchone() Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.10/sqlite3/dbapi2.py", line 67, in convert_timestamp datepart, timepart = val.split(b" ") ValueError: not enough values to unpack (expected 2, got 1) >>> With help of pdb in ipython, I've discovered that the value convert_timestamp gets to parse is an empty bytestring: In [5]: c.execute("SELECT * from sessions where session == 1").fetchone() --------------------------------------------------------------------------- ValueError Traceback (most recent call last) in ----> 1 c.execute("SELECT * from sessions where session == 1").fetchone() /usr/lib64/python3.10/sqlite3/dbapi2.py in convert_timestamp(val) 65 66 def convert_timestamp(val): ---> 67 datepart, timepart = val.split(b" ") 68 year, month, day = map(int, datepart.split(b"-")) 69 timepart_full = timepart.split(b".") ValueError: not enough values to unpack (expected 2, got 1) > /usr/lib64/python3.10/sqlite3/dbapi2.py(67)convert_timestamp() 65 66 def convert_timestamp(val): ---> 67 datepart, timepart = val.split(b" ") 68 year, month, day = map(int, datepart.split(b"-")) 69 timepart_full = timepart.split(b".") ipdb> val b'' ipdb> Is anything in my database wrong? It seems that the content of the start column is correct and covert_timestamp should be able to parse it. Is it possible that the troublemaker here is the empty column `end` of type timestamp? Answer to my own question: yes, the issue here is that the column `end` is of type timestamp and it's empty. If I update it with a date and time, everything works: # sqlite3 test.sqlite sqlite> update sessions set end='2021-04-14 09:44:58.903345' where session = 1; sqlite> select * from sessions; 1|2021-04-13 09:44:58.903345|2021-04-14 09:44:58.903345|| sqlite> # python3 >>> import sqlite3 >>> conn = sqlite3.connect('test.sqlite', detect_types=sqlite3.PARSE_DECLTYPES) >>> c = conn.cursor() >>> c.execute("SELECT * from sessions where session == 1").fetchone() (1, datetime.datetime(2021, 4, 13, 9, 44, 58, 903345), datetime.datetime(2021, 4, 14, 9, 44, 58, 903345), None, '') So, the final question is whether this is correct behavior. I believe that columns without content should not be passed to converters. ---------- components: Library (Lib) messages: 390953 nosy: frenzy priority: normal severity: normal status: open title: sqlite: convert_timestamp raises ValueError for empty columns versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 07:27:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 11:27:31 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618313251.21.0.2727980711.issue43816@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 54db51c9114ac49030832f5134979ca866ffd21c by Andrew V. Jones in branch 'master': bpo-43816: Add extern "C" to Include/cpython/pyctype.h (GH-25365) https://github.com/python/cpython/commit/54db51c9114ac49030832f5134979ca866ffd21c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 07:28:20 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Apr 2021 11:28:20 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618313300.67.0.217954991078.issue43816@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +24119 pull_request: https://github.com/python/cpython/pull/25386 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 07:28:51 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Apr 2021 11:28:51 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618313331.48.0.659978769694.issue43816@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24120 pull_request: https://github.com/python/cpython/pull/25387 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 07:33:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 11:33:40 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1618313620.09.0.568961279332.issue43770@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 65f058eb081c9e1fe44115d1ac7966067e3650c7 by Victor Stinner in branch 'master': bpo-43770: Reorder type_ready() (GH-25373) https://github.com/python/cpython/commit/65f058eb081c9e1fe44115d1ac7966067e3650c7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 07:44:59 2021 From: report at bugs.python.org (Florian Bruhin) Date: Tue, 13 Apr 2021 11:44:59 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1618314299.0.0.321366404994.issue40066@roundup.psfhosted.org> Florian Bruhin added the comment: I'm probably a bit late to the party as well, but as some additional datapoints: - This broke the tests for my project and I ended up adding a wrapper to stringify enums (since I actually prefer having the enum type in debug logs and such): https://github.com/qutebrowser/qutebrowser/commit/e2c5fe6262564d9d85806bfa9d4486a411cf5045 - This broke tests for pytest, and also changes its test IDs when enums are used for test parametrization, which might cause more breakage downstream: https://github.com/pytest-dev/pytest/issues/8546 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 07:45:32 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Apr 2021 11:45:32 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618314332.2.0.742741051902.issue43816@roundup.psfhosted.org> miss-islington added the comment: New changeset 47a894d338f436ea8f513f1ad2cc7e1b086e99cc by Miss Islington (bot) in branch '3.8': bpo-43816: Add extern "C" to Include/cpython/pyctype.h (GH-25365) https://github.com/python/cpython/commit/47a894d338f436ea8f513f1ad2cc7e1b086e99cc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 07:46:51 2021 From: report at bugs.python.org (Felix C. Stegerman) Date: Tue, 13 Apr 2021 11:46:51 +0000 Subject: [issue2824] zipfile to handle duplicate files in archive In-Reply-To: <1210537070.35.0.0613996133193.issue2824@psf.upfronthosting.co.za> Message-ID: <1618314411.22.0.243413901853.issue2824@roundup.psfhosted.org> Change by Felix C. Stegerman : ---------- nosy: +obfusk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 08:20:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 12:20:21 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618316421.54.0.307030830407.issue43816@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 15ad30d88fead718b7eeff8c54454b82753d520e by Miss Islington (bot) in branch '3.9': bpo-43816: Add extern "C" to Include/cpython/pyctype.h (GH-25365) (GH-25387) https://github.com/python/cpython/commit/15ad30d88fead718b7eeff8c54454b82753d520e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 08:21:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 12:21:07 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618316467.92.0.0677827689649.issue43816@roundup.psfhosted.org> STINNER Victor added the comment: It's now fixed. Thanks Andrew V. Jones for the fix. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 08:22:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 12:22:57 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618316577.71.0.16718034328.issue43816@roundup.psfhosted.org> STINNER Victor added the comment: The workaround for this issue is to put extern "C" around #include , or around the header file which includes . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 08:54:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 12:54:53 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1618318493.72.0.225485757225.issue43770@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24121 pull_request: https://github.com/python/cpython/pull/25388 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 09:03:06 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 13 Apr 2021 13:03:06 +0000 Subject: [issue43830] (-1) ** 0.5 returns (6.123233995736766e-17+1j) instead of 1j In-Reply-To: <1618304093.14.0.191695728369.issue43830@roundup.psfhosted.org> Message-ID: <1618318986.42.0.232621156464.issue43830@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is the same "gotcha" as >>> math.cos(math.pi/2) 6.123233995736766e-17 You can expect that cos(?/2) is exactly 0, but floating point value math.pi is only an approximation of the ? number. The difference between math.pi and exact value of ? leads to non-zero result of cos(math.pi/2). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 09:03:40 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 13 Apr 2021 13:03:40 +0000 Subject: [issue43830] (-1) ** 0.5 returns (6.123233995736766e-17+1j) instead of 1j In-Reply-To: <1618304093.14.0.191695728369.issue43830@roundup.psfhosted.org> Message-ID: <1618319020.85.0.134203404958.issue43830@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 09:25:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 13:25:24 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1618320324.77.0.487826941144.issue43770@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a328d73843cfd42d2aee1434c78df1ef2845931a by Victor Stinner in branch 'master': bpo-43770: Cleanup type_ready() (GH-25388) https://github.com/python/cpython/commit/a328d73843cfd42d2aee1434c78df1ef2845931a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 09:31:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 13:31:26 +0000 Subject: [issue43816] Missing 'extern "C"' for _Py_ctype_table In-Reply-To: <1618240583.63.0.52966531603.issue43816@roundup.psfhosted.org> Message-ID: <1618320686.62.0.493255561424.issue43816@roundup.psfhosted.org> STINNER Victor added the comment: St?phane Wirtel: "In fact, _Py_ctype_table is limited to the internal parts of the interpreter. So in this case, this one could not be used in an external tool. You can read: https://docs.python.org/3/c-api/stable.html" You're right that pyctype.h is excluded from the limited C API. But almost all C extensions use the "regular" C API which includes header files in Include/cpython/. The internal C API is something different: header files in Include/internal/. I know that it's complicated, that why a README was written :-) https://github.com/python/cpython/blob/master/Include/README.rst ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 09:34:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 13:34:46 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1618320886.21.0.746257004386.issue43770@roundup.psfhosted.org> STINNER Victor added the comment: If I modify type_ready() to call type_ready_inherit() before type_ready_fill_dict(), some types create a between between their C slot (tp_init) and the Python API in tp_dict (tp_dict["__init__"]). Example with importlib: class FileLoader(...): def __init__(...): ... => FileLoader.tp_init = slot_tp_init class SourceFileLoader(FileLoader): ... When PyType_Ready() is called on SourceFileLoader, we get: * SourceFileLoader.tp_base = FileLoader * SourceFileLoader.tp_init = NULL * SourceFileLoader.tp_dict has no "__init__" key When inherit_slots() is called, SourceFileLoader.tp_init is set to slot_tp_init(). When add_operators() is called, SourceFileLoader.tp_dict["__init__"] is set to PyDescr_NewWrapper(slot_tp_init). Problem: we a loop! tp_dict["__init__"] => slot_tp_init => tp_dict["__init__"] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 09:42:08 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 13 Apr 2021 13:42:08 +0000 Subject: [issue43817] Add typing.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1618321328.03.0.921672754459.issue43817@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 09:48:06 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 13 Apr 2021 13:48:06 +0000 Subject: [issue43830] (-1) ** 0.5 returns (6.123233995736766e-17+1j) instead of 1j In-Reply-To: <1618304093.14.0.191695728369.issue43830@roundup.psfhosted.org> Message-ID: <1618321686.11.0.431968211267.issue43830@roundup.psfhosted.org> Mark Dickinson added the comment: FWIW, if you're specifically interested in complex square roots rather than powers in general, I'd recommend using `cmath.sqrt(value)` rather than `value**0.5` - there are fewer intermediate steps involved in computing `cmath.sqrt`, and the returned value will in general be a bit more accurate, and better defined in corner cases. (And probably slightly faster too, in the rare situations where that matters.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 09:55:02 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 13 Apr 2021 13:55:02 +0000 Subject: [issue3451] Asymptotically faster divmod and str(long) In-Reply-To: <1217121065.64.0.642253571203.issue3451@psf.upfronthosting.co.za> Message-ID: <1618322102.25.0.70694441347.issue3451@roundup.psfhosted.org> Mark Dickinson added the comment: > we have implemented a faster algorithm for divmod for big numbers using Mark's fast_div.py in PyPy Urk! I hope your implementation included a healthy dose of validation, testing and cleanup. :-) (I have no doubts that it did.) I'd consider fast_div.py to be proof-of-concept code rather than something suitable for immediate use. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 10:10:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 14:10:37 +0000 Subject: [issue14811] decoding_fgets() truncates long lines and fails with a SyntaxError("Non-UTF-8 code starting with...") In-Reply-To: <1337056300.81.0.374626607094.issue14811@psf.upfronthosting.co.za> Message-ID: <1618323037.5.0.629907487072.issue14811@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +BTaskaya, lys.nikolaou, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 10:11:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 14:11:51 +0000 Subject: [issue43731] PEP 597: logging.fileConfig() uses locale encoding. In-Reply-To: <1617596968.06.0.267322224871.issue43731@roundup.psfhosted.org> Message-ID: <1618323111.18.0.547354775471.issue43731@roundup.psfhosted.org> STINNER Victor added the comment: Ah, so you want to emit an EncodingWarning when fileConfig(filename) is called without specifying an encoding, right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 10:57:33 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 13 Apr 2021 14:57:33 +0000 Subject: [issue3451] Asymptotically faster divmod and str(long) In-Reply-To: <1217121065.64.0.642253571203.issue3451@psf.upfronthosting.co.za> Message-ID: <1618325853.9.0.461388833596.issue3451@roundup.psfhosted.org> Mark Dickinson added the comment: FWIW, I think we should close this; the same comments as in issue 26256 apply. See msg259408 onwards in that discussion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 10:57:45 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 14:57:45 +0000 Subject: [issue14811] decoding_fgets() truncates long lines and fails with a SyntaxError("Non-UTF-8 code starting with...") In-Reply-To: <1337056300.81.0.374626607094.issue14811@psf.upfronthosting.co.za> Message-ID: <1618325865.98.0.38995708487.issue14811@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I don't get any error executing the t33a.py script ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 11:01:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 15:01:38 +0000 Subject: [issue40432] Pegen regenerate project for Windows not working In-Reply-To: <1588127830.15.0.595745305392.issue40432@roundup.psfhosted.org> Message-ID: <1618326098.17.0.656840432397.issue40432@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Seems that the regeneration script is not detecting correctly that needs Python3.8+ for regenerating pegen. Check for instance: https://buildbot.python.org/all/#/builders/596/builds/2/steps/2/logs/stdio ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 11:05:16 2021 From: report at bugs.python.org (Mark Lawrence) Date: Tue, 13 Apr 2021 15:05:16 +0000 Subject: [issue3451] Asymptotically faster divmod and str(long) In-Reply-To: <1217121065.64.0.642253571203.issue3451@psf.upfronthosting.co.za> Message-ID: <1618326316.67.0.429014388984.issue3451@roundup.psfhosted.org> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 11:15:15 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 13 Apr 2021 15:15:15 +0000 Subject: [issue40432] Pegen regenerate project for Windows not working In-Reply-To: <1588127830.15.0.595745305392.issue40432@roundup.psfhosted.org> Message-ID: <1618326915.39.0.726838598664.issue40432@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj nosy_count: 2.0 -> 3.0 pull_requests: +24122 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/25389 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 11:29:44 2021 From: report at bugs.python.org (Carl Friedrich Bolz-Tereick) Date: Tue, 13 Apr 2021 15:29:44 +0000 Subject: [issue3451] Asymptotically faster divmod and str(long) In-Reply-To: <1217121065.64.0.642253571203.issue3451@psf.upfronthosting.co.za> Message-ID: <1618327784.33.0.0360058143123.issue3451@roundup.psfhosted.org> Carl Friedrich Bolz-Tereick added the comment: yes, that sounds fair. In PyPy we improve things occasionally if somebody feels like working on it, but in general competing against GMP is a fools errand. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 11:47:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 15:47:42 +0000 Subject: [issue3451] Asymptotically faster divmod and str(long) In-Reply-To: <1217121065.64.0.642253571203.issue3451@psf.upfronthosting.co.za> Message-ID: <1618328862.65.0.47998587721.issue3451@roundup.psfhosted.org> STINNER Victor added the comment: Python has a reasonable efficiency up to 1000 decimal digits (according to benchmark) which is already really great! Operations with more than 1000 decimal digits is an uncommon. IMO you should use a dedicated library like GMP for that. I would prefer to keep CPython code simple enough to maintain. Objects/longobject.c is already 5744 lines of C code. longformat_BZ.diff adds around 700 lines of code, but it only makes str(int) starting at 2000 decimal digits. Yeah, we could do better for integers with , but I would prefer not to :-) Python has a limited number of volunteers working on it, and it's not specialized in numbers. We should keep the maintenance burden at an acceptable level ;-) ---------- resolution: -> wont fix stage: patch review -> resolved status: languishing -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 11:50:47 2021 From: report at bugs.python.org (Andrei Pozolotin) Date: Tue, 13 Apr 2021 15:50:47 +0000 Subject: [issue43832] asyncio + multiprocessing = core dump in sem_trywait Message-ID: <1618329047.14.0.057176308941.issue43832@roundup.psfhosted.org> New submission from Andrei Pozolotin : every attempt to touch multiprocessing.Event.is_set() from asyncio.run() results in reproducible core dump in sem_trywait system: Linux 5.11.8 Linux work3 5.11.8-arch1-1 #1 SMP PREEMPT Sun, 21 Mar 2021 01:55:51 +0000 x86_64 GNU/Linux Python: 3.9.2 https://archlinux.org/packages/extra/x86_64/python/ ---------- components: asyncio files: dump_core.py messages: 390973 nosy: Andrei Pozolotin, asvetlov, yselivanov priority: normal severity: normal status: open title: asyncio + multiprocessing = core dump in sem_trywait type: crash versions: Python 3.9 Added file: https://bugs.python.org/file49956/dump_core.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 11:51:47 2021 From: report at bugs.python.org (Andrei Pozolotin) Date: Tue, 13 Apr 2021 15:51:47 +0000 Subject: [issue43832] asyncio + multiprocessing = core dump in sem_trywait In-Reply-To: <1618329047.14.0.057176308941.issue43832@roundup.psfhosted.org> Message-ID: <1618329107.12.0.50430907364.issue43832@roundup.psfhosted.org> Change by Andrei Pozolotin : Added file: https://bugs.python.org/file49957/dump_core.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 12:06:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 16:06:36 +0000 Subject: [issue43797] Improve syntax error for invalid comparisons In-Reply-To: <1617995491.91.0.835586864843.issue43797@roundup.psfhosted.org> Message-ID: <1618329996.77.0.544535386051.issue43797@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24123 pull_request: https://github.com/python/cpython/pull/25390 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 12:14:07 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 13 Apr 2021 16:14:07 +0000 Subject: [issue14811] decoding_fgets() truncates long lines and fails with a SyntaxError("Non-UTF-8 code starting with...") In-Reply-To: <1337056300.81.0.374626607094.issue14811@psf.upfronthosting.co.za> Message-ID: <1618330447.92.0.830970795021.issue14811@roundup.psfhosted.org> Eryk Sun added the comment: > I don't get any error executing the t33a.py script The second line in t33a.py is 1618 bytes. The standard I/O BUFSIZ in Linux is 8192 bytes, but it's only 512 bytes in Windows. The latest alpha release, 3.10a7, includes your rewrite of the tokenizer, and in that case t33a.py no longer fails in Windows. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 12:42:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 16:42:16 +0000 Subject: [issue14811] decoding_fgets() truncates long lines and fails with a SyntaxError("Non-UTF-8 code starting with...") In-Reply-To: <1337056300.81.0.374626607094.issue14811@psf.upfronthosting.co.za> Message-ID: <1618332136.61.0.0105556245829.issue14811@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > no longer fails in Windows. So that means we can close the issue, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 12:44:06 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 13 Apr 2021 16:44:06 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1618332246.0.0.0960389911159.issue40066@roundup.psfhosted.org> Ethan Furman added the comment: Thank you for the feedback. The new str() and repr() make more sense for Flag-based enumerations, and I'm hesitant to have different formats for Enum- vs Flag-based enums. Would it be helpful to have another base Enum class to derive from that maintained the original str() and repr() formats? ---------- resolution: fixed -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 12:51:41 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 16:51:41 +0000 Subject: [issue43797] Improve syntax error for invalid comparisons In-Reply-To: <1617995491.91.0.835586864843.issue43797@roundup.psfhosted.org> Message-ID: <1618332701.83.0.924054144888.issue43797@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 30ed93bfec5dfa7ee05982e2df8fd810f3f49305 by Pablo Galindo in branch 'master': bpo-43797: Handle correctly invalid assignments inside function calls and generators (GH-25390) https://github.com/python/cpython/commit/30ed93bfec5dfa7ee05982e2df8fd810f3f49305 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 13:07:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 17:07:04 +0000 Subject: [issue14811] decoding_fgets() truncates long lines and fails with a SyntaxError("Non-UTF-8 code starting with...") In-Reply-To: <1337056300.81.0.374626607094.issue14811@psf.upfronthosting.co.za> Message-ID: <1618333624.62.0.573389747421.issue14811@roundup.psfhosted.org> STINNER Victor added the comment: With https://bugs.python.org/issue14811#msg160706 I get a SyntaxError on Python 3.7, 3.8, 3.9 and 3.10.0a6. But I don't get an error on the master branch (Python 3.10.0a7+). Eryk: > The latest alpha release, 3.10a7, includes your rewrite of the tokenizer, and in that case t33a.py no longer fails in Windows. Oh ok, this issue was fixed by the following commit which is part of v3.10.0a7 release: commit 261a452a1300eeeae1428ffd6e6623329c085e2c Author: Pablo Galindo Date: Sun Mar 28 23:48:05 2021 +0100 bpo-25643: Refactor the C tokenizer into smaller, logical units (GH-25050) ---------- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> Python tokenizer rewriting _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 13:15:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 17:15:45 +0000 Subject: [issue41515] typing.get_type_hints generates KeyError In-Reply-To: <1597067038.73.0.335844562656.issue41515@roundup.psfhosted.org> Message-ID: <1618334145.3.0.526689872609.issue41515@roundup.psfhosted.org> STINNER Victor added the comment: I see that all PRs are merged, and the CI issue is fixed as well. I close the issue. commit eb77133564d74eb09ed63872a69b9827d4841b49 Author: Karthikeyan Singaravelan Date: Tue Apr 13 19:24:23 2021 +0530 bpo41515: Fix assert in test which throws SyntaxWarning. (#25379) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 13:23:58 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Apr 2021 17:23:58 +0000 Subject: [issue43811] Run GHA CI with multiple OpenSSL versions In-Reply-To: <1618216687.81.0.190201617408.issue43811@roundup.psfhosted.org> Message-ID: <1618334638.01.0.788907581661.issue43811@roundup.psfhosted.org> miss-islington added the comment: New changeset 8fa1489365e7af8b90286c97db55a2dc60a05cde by Christian Heimes in branch 'master': bpo-43811: Test multiple OpenSSL versions on GHA (GH-25360) https://github.com/python/cpython/commit/8fa1489365e7af8b90286c97db55a2dc60a05cde ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 13:24:14 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Apr 2021 17:24:14 +0000 Subject: [issue43811] Run GHA CI with multiple OpenSSL versions In-Reply-To: <1618216687.81.0.190201617408.issue43811@roundup.psfhosted.org> Message-ID: <1618334654.07.0.88524653207.issue43811@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24124 pull_request: https://github.com/python/cpython/pull/25391 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 13:24:23 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Apr 2021 17:24:23 +0000 Subject: [issue43811] Run GHA CI with multiple OpenSSL versions In-Reply-To: <1618216687.81.0.190201617408.issue43811@roundup.psfhosted.org> Message-ID: <1618334663.32.0.455676083566.issue43811@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24125 pull_request: https://github.com/python/cpython/pull/25392 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 14:27:19 2021 From: report at bugs.python.org (sco1) Date: Tue, 13 Apr 2021 18:27:19 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators Message-ID: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> New submission from sco1 : Came across this riddle today: >>> [0x_for x in (1, 2, 3)] [15] Initially I thought this was related to PEP 515 but the unexpected behavior extends to simpler examples as well, such as: >>> x = 5 >>> 123or x 123 >>> 123and x 5 I'm not familiar enough with C to understand why this is being parsed/tokenized this way, but this seems like it should instead be a SyntaxError. This appears to be fairly old behavior, as the non-underscored version works back to at least 2.7. And a bonus: >>> 0x1decade or more 31378142 ---------- messages: 390981 nosy: sco1 priority: normal severity: normal status: open title: Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators type: behavior versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 14:29:42 2021 From: report at bugs.python.org (Rene Visser) Date: Tue, 13 Apr 2021 18:29:42 +0000 Subject: [issue43810] os.path.abspath returns invalid path (resolves symbolic link) In-Reply-To: <1618206006.96.0.200287455575.issue43810@roundup.psfhosted.org> Message-ID: Rene Visser added the comment: Thanks Eryk for your fast response. Apparently I somehow skipped the remark about symbolic links in combination with abspath. Thank you for pointing this out and apologies for wasting some of your time!! Best wishes, Rene Visser On Mon, Apr 12, 2021 at 7:40 AM Eryk Sun wrote: > > Eryk Sun added the comment: > > In POSIX, os.path.abspath(p) is normpath(join(os.getcwd(), p)). normpath() > doesn't touch the filesystem, and it's documented that its "string > manipulation may change the meaning of a path that contains symbolic > links". You can use os.path.realpath() to resolve symbolic links in a path. > > ---------- > nosy: +eryksun > resolution: -> not a bug > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > -- ------------------------------------------------------- Ren? Visser Stuttgart, Germany email: renevisser at gmail.com ------------------------------------------------------- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 14:29:44 2021 From: report at bugs.python.org (Ned Batchelder) Date: Tue, 13 Apr 2021 18:29:44 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618338584.01.0.852566959412.issue43833@roundup.psfhosted.org> Change by Ned Batchelder : ---------- nosy: +nedbat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 14:41:10 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 13 Apr 2021 18:41:10 +0000 Subject: [issue43831] sqlite: convert_timestamp raises ValueError for empty columns In-Reply-To: <1618311594.99.0.0340525219314.issue43831@roundup.psfhosted.org> Message-ID: <1618339270.42.0.780237591146.issue43831@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Hi Lum?r, thank you for your report. This is a duplicate of bpo-43752. The bugfix currently is awaiting review, and will be included in python3.10b1 (expected in approx. three weeks). ---------- nosy: +berker.peksag, erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 14:43:04 2021 From: report at bugs.python.org (Rich rauenzahn) Date: Tue, 13 Apr 2021 18:43:04 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618339384.62.0.694452708415.issue43833@roundup.psfhosted.org> Change by Rich rauenzahn : ---------- nosy: +rrauenza _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 14:43:51 2021 From: report at bugs.python.org (sco1) Date: Tue, 13 Apr 2021 18:43:51 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618339431.14.0.552054899082.issue43833@roundup.psfhosted.org> sco1 added the comment: Sorry, the bonus, while fun, I don't think is related ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 14:44:34 2021 From: report at bugs.python.org (Michael Hall) Date: Tue, 13 Apr 2021 18:44:34 +0000 Subject: [issue39232] asyncio crashes when tearing down the proactor event loop In-Reply-To: <1578335360.75.0.333919607495.issue39232@roundup.psfhosted.org> Message-ID: <1618339474.09.0.866248386145.issue39232@roundup.psfhosted.org> Change by Michael Hall : ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 14:55:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 18:55:24 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1618340124.3.0.609041395435.issue43725@roundup.psfhosted.org> STINNER Victor added the comment: > Oh wow, that's terrible... yet another good reason not to export data values. _Py_M__importlib_bootstrap_external symbol doesn't seem to be exported. Why is it seen as a public symbol? $ objdump -T /lib64/libpython3.10.so.1.0|grep _Py_M__importlib_bootstrap_external # empty output ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 14:58:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 18:58:09 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1618340289.67.0.54070329198.issue43725@roundup.psfhosted.org> STINNER Victor added the comment: > We could ignore all functions that start with _Py. Some symbols starting with _Py are indirectly part of the ABI. Example of Include/cpython/pyctype.h: #define Py_ISLOWER(c) (_Py_ctype_table[Py_CHARMASK(c)] & PY_CTF_LOWER) PyAPI_DATA(const unsigned int) _Py_ctype_table[256]; Even if "_Py_ctype_table" is not directly part of the C API, it's technically part of the ABI. If tomorrow, _Py_ctype_table is truncated to 128 items, it would be an incompatible ABI change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 15:00:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 19:00:41 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1618340441.69.0.874011532984.issue43725@roundup.psfhosted.org> STINNER Victor added the comment: In a Python stable version, I would suggest to only ignore an ABI change after a manual validation .Otherwise, we can miss real issues. Well, I expect that at the beginning, we will discover many issues like _Py_M__importlib_bootstrap_external ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 15:07:29 2021 From: report at bugs.python.org (Alistair Muldal) Date: Tue, 13 Apr 2021 19:07:29 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618340849.2.0.13272564706.issue43833@roundup.psfhosted.org> Alistair Muldal added the comment: Several other keywords seem to be affected, including `if`, `else`, `is`, and `in` ---------- nosy: +alimuldal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 15:14:48 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Apr 2021 19:14:48 +0000 Subject: [issue43811] Run GHA CI with multiple OpenSSL versions In-Reply-To: <1618216687.81.0.190201617408.issue43811@roundup.psfhosted.org> Message-ID: <1618341288.19.0.0848674169288.issue43811@roundup.psfhosted.org> miss-islington added the comment: New changeset 5ce227f3a767e6e44e7c41e0c845a83cf7777ca4 by Miss Islington (bot) in branch '3.9': [3.9] bpo-43811: Test multiple OpenSSL versions on GHA (GH-25360) (GH-25391) https://github.com/python/cpython/commit/5ce227f3a767e6e44e7c41e0c845a83cf7777ca4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 15:15:40 2021 From: report at bugs.python.org (Jordan Borean) Date: Tue, 13 Apr 2021 19:15:40 +0000 Subject: [issue37179] asyncio loop.start_tls() provide support for TLS in TLS In-Reply-To: <1559843713.76.0.0171515478407.issue37179@roundup.psfhosted.org> Message-ID: <1618341340.16.0.0970610683942.issue37179@roundup.psfhosted.org> Jordan Borean added the comment: Fantastic thanks, I'll keep watching the issue in the background as it sounds like it's under control. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 15:18:45 2021 From: report at bugs.python.org (Carl Friedrich Bolz-Tereick) Date: Tue, 13 Apr 2021 19:18:45 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618341525.33.0.105474234609.issue43833@roundup.psfhosted.org> Carl Friedrich Bolz-Tereick added the comment: It's not just about keywords. Eg '1x' tokenizes too but then produces a syntax error in the parser. Keywords are only special in that they can be used to write syntactically meaningful things with these concatenated numbers. ---------- nosy: +Carl.Friedrich.Bolz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 15:27:10 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Apr 2021 19:27:10 +0000 Subject: [issue43811] Run GHA CI with multiple OpenSSL versions In-Reply-To: <1618216687.81.0.190201617408.issue43811@roundup.psfhosted.org> Message-ID: <1618342030.98.0.495244059412.issue43811@roundup.psfhosted.org> miss-islington added the comment: New changeset a607815eb07582deb3c5818be881a98abe25a100 by Miss Islington (bot) in branch '3.8': [3.8] bpo-43811: Test multiple OpenSSL versions on GHA (GH-25360) (GH-25392) https://github.com/python/cpython/commit/a607815eb07582deb3c5818be881a98abe25a100 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 15:33:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 19:33:50 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618342430.8.0.895990934768.issue43833@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This is know behaviour unfortunately and cannot be changed because of backwards compatibility. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 15:37:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 19:37:13 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1618342633.3.0.139850639549.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ok, then we need to revert by latest 2 PRs and add a new label or something to skip ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 15:43:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 13 Apr 2021 19:43:02 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618342982.85.0.365811545771.issue43833@roundup.psfhosted.org> Serhiy Storchaka added the comment: Good example! Similar issue was discussed on the mailing list 3 years ago (https://mail.python.org/archives/list/python-dev at python.org/thread/D2WPCITHG2LBQAP7DBTC6CY26WQUBAKP/#D2WPCITHG2LBQAP7DBTC6CY26WQUBAKP). Now with new example it perhaps should be reconsidered. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 15:50:18 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 13 Apr 2021 19:50:18 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618343418.68.0.371654550196.issue43833@roundup.psfhosted.org> Shreyan Avigyan added the comment: Hi. I'm totally confused about other keywords but I'm a little concerned about the "and", "or" operator when used on, not only "int" (also known as "long") but also most Python objects other then bool type. Mostly when used on Python built-in objects "and", "or" keyword returns a very peculiar result. The "and" keyword returns the Python object on the left hand side while "or" returns the Python object on the right hand side. This applies to all Python object, built-in or user-defined, unless it has a specific __and__ or __or__ method defined. What is actually going on? ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 15:58:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 19:58:09 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618343889.37.0.00961846711837.issue43833@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: We tried changing this IIRC and it broke code in the stdlib (now reformatted) so it will break code in the wild. I am not sure the gains are worth it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 15:58:46 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 13 Apr 2021 19:58:46 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618343926.33.0.650823729349.issue43833@roundup.psfhosted.org> Serhiy Storchaka added the comment: Better example: >>> [0x1for x in (1,2)] [31] The code is parsed as [0x1f or x in (1,2)] instead of [0x1 for x in (1,2)] as you may expect. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 16:00:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 20:00:57 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618344057.31.0.686139527213.issue43833@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Precisely because examples like that changing this is a breaking change. Don't get me wrong: I would love to change it, but I don't know if is worth the risk ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 16:02:35 2021 From: report at bugs.python.org (John Hagen) Date: Tue, 13 Apr 2021 20:02:35 +0000 Subject: [issue43834] Use context manager in StringIO example Message-ID: <1618344155.0.0.639710984937.issue43834@roundup.psfhosted.org> New submission from John Hagen : The example for StringIO currently manually closes the object rather than using a context manager. Since this is likely the first code that a new user encounters and context managers reduce error-prone situations, I think it would be helpful to show usage as a context manager. https://docs.python.org/3/library/io.html#io.StringIO.getvalue Something like: import io with io.StringIO() as output: output.write('First line.\n') print('Second line.', file=output) # Retrieve file contents -- this will be # 'First line.\nSecond line.\n' contents = output.getvalue() # Context manager will automatically close # object and discard memory buffer -- # .getvalue() will now raise an exception. ---------- assignee: docs at python components: Documentation messages: 391000 nosy: John Hagen, docs at python priority: normal severity: normal status: open title: Use context manager in StringIO example type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 16:09:00 2021 From: report at bugs.python.org (sco1) Date: Tue, 13 Apr 2021 20:09:00 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618344540.76.0.615732743974.issue43833@roundup.psfhosted.org> sco1 added the comment: Appreciate the additional historical context, I also was pointed to this in the documentation: https://docs.python.org/3/reference/lexical_analysis.html#whitespace-between-tokens If a parsing change is undesired from a backwards compatibility standpoint, would it be something that could be included in PEP 8? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 16:23:38 2021 From: report at bugs.python.org (Anthony Sottile) Date: Tue, 13 Apr 2021 20:23:38 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618345418.46.0.606551249307.issue43833@roundup.psfhosted.org> Anthony Sottile added the comment: here's quite a few other cases as well -- I'd love for this to be clarified in PEP8 such that I can rationalize crafting a rule for it in `pycodestyle` -- https://github.com/PyCQA/pycodestyle/issues/371 ---------- nosy: +Anthony Sottile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 16:25:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 20:25:20 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618345520.01.0.102443486299.issue43833@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: One thing we could consider as Serhiy proposed on the mailing list is to emit a Syntax Warning. The ambiguous cases are specially scary so I think that makes sense ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 16:49:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 20:49:22 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1618346962.07.0.139056070947.issue40137@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24126 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/25393 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 16:49:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 20:49:54 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1618346994.87.0.943307654247.issue40137@roundup.psfhosted.org> STINNER Victor added the comment: > ./python -m pyperf timeit "from functools import lru_cache; f = lru_cache(lambda: 42)" "f()" --compare-to ../3.9/python > /home/pablogsal/github/3.9/python: ..................... 2.60 us +- 0.05 us You misused pyperf timeit: the two statements are run at each iteration of the benchmark. I rerun the benchmark on Linux with PGO+LTO and CPU isolation: Mean +- std dev: [py39] 37.5 ns +- 1.0 ns -> [master] 43.2 ns +- 0.7 ns: 1.15x slower I understand that adding get_functools_state_by_type() has a cost of +5.7 ns on the performance of functions decorated with @lru_cache. I used the commands: ./configure --enable-optimizations --with-lto make ./python -m venv env env/bin/python -m pip install pyperf ./env/bin/python -m pyperf timeit -s "from functools import lru_cache; f = lru_cache(lambda: 42)" "f()" -o master.json -v --duplicate=4096 ---------- stage: patch review -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 16:53:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 20:53:46 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1618347226.03.0.907724980369.issue40137@roundup.psfhosted.org> STINNER Victor added the comment: I wrote PR 25393 to micro-optimize _PyType_GetModuleByDef(). It reduces the overhead from +5.7 ns to +3.4 ns (-2.3 ns). Well, I didn't check in depth if _PyType_GetModuleByDef() is the only change in functools.lru_cache() from Python 3.9 to master. Compare master to Python 3.9: Mean +- std dev: [py39] 37.5 ns +- 1.0 ns -> [master] 43.2 ns +- 0.7 ns: 1.15x slower Compare PR 25393 to Python 3.9: Mean +- std dev: [py39] 37.5 ns +- 1.0 ns -> [inline] 40.9 ns +- 1.0 ns: 1.09x slower Compare PR 25393 to master: Mean +- std dev: [master] 43.2 ns +- 0.7 ns -> [inline] 40.9 ns +- 1.0 ns: 1.05x faster ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 18:21:40 2021 From: report at bugs.python.org (Paul Pinterits) Date: Tue, 13 Apr 2021 22:21:40 +0000 Subject: [issue43835] Dataclasses don't call base class __init__ Message-ID: <1618352500.63.0.0280826468162.issue43835@roundup.psfhosted.org> New submission from Paul Pinterits : It's documented behavior that @dataclass won't generate an __init__ method if the class already defines one. It's also documented that a dataclass may inherit from another dataclass. But what happens if you inherit from a dataclass that implements a custom __init__? Well, that custom __init__ is never called: ``` import dataclasses @dataclasses.dataclass class Foo: foo: int def __init__(self, *args, **kwargs): print('Foo.__init__') # This is never printed @dataclasses.dataclass class Bar(Foo): bar: int obj = Bar(1, 2) print(vars(obj)) # {'foo': 1, 'bar': 2} ``` So if a dataclass uses a custom __init__, all its child classes must also use a custom __init__. This is 1) incredibly inconvenient, and 2) bad OOP. A child class should (almost) always chain-call its base class's __init__. ---------- components: Library (Lib) messages: 391006 nosy: Paul Pinterits priority: normal severity: normal status: open title: Dataclasses don't call base class __init__ versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 18:36:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 22:36:42 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1618353402.83.0.216858871932.issue43725@roundup.psfhosted.org> STINNER Victor added the comment: > Ok, then we need to revert by latest 2 PRs and add a new label or something to skip To skip ABI tests? I proposed to ignore ABI changes if they can be ignored safely. But I don't know right now which changes can be ignored or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 18:39:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 22:39:01 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1618353541.22.0.522826987939.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > To skip ABI tests? I proposed to ignore ABI changes if they can be ignored safely. But I don't know right now which changes can be ignored or not. As the situation stands we need to choose on keeping my changes to ignore _Py function changes or revert it. Further than that is unexplored land ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 18:42:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 22:42:25 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1618353745.47.0.724468939175.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > $ objdump -T /lib64/libpython3.10.so.1.0|grep _Py_M__importlib_bootstrap_external # empty output This was happening on 3.8 Victor: root at d9c5942e274b:/src# objdump -T libpython3.8.so | grep _Py_M__importlib_bootstrap_external 0000000000335740 g DO .rodata 000000000000b062 Base _Py_M__importlib_bootstrap_external ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 18:44:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 22:44:25 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1618353865.29.0.248513661426.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I am going to revert the 3.9 PR as 3.9+ is hiding symbols by default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 18:45:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 22:45:46 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1618353946.03.0.322780799429.issue43725@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24127 pull_request: https://github.com/python/cpython/pull/25394 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 19:07:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 23:07:32 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1618355252.85.0.160644465429.issue43725@roundup.psfhosted.org> STINNER Victor added the comment: > I got a false positive on my PR at https://github.com/python/cpython/pull/25318/checks?check_run_id=2308871807 Oh, this CI failure was on Python 3.8. Since Python 3.9, Python is now built with -fvisibility=hidden to avoid exporting symbols which are not explicitly exported. So in 3.9, we no longer have to ignore all symbols prefixed by "_Py". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 19:21:20 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 13 Apr 2021 23:21:20 +0000 Subject: [issue43810] os.path.abspath returns invalid path (resolves symbolic link) In-Reply-To: <1618205085.71.0.310776377701.issue43810@roundup.psfhosted.org> Message-ID: <1618356080.35.0.597835910861.issue43810@roundup.psfhosted.org> Eryk Sun added the comment: If realpath() resolves too much, you'll have to resolve manually via os.path.islink() and os.readlink(). If you need strict resolution, use pathlib.Path.resolve(). In strict mode it raises FileNotFoundError if a path component doesn't exist. Also, even in non-strict mode, it raises RuntimeError for a symlink loop. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 19:23:08 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 13 Apr 2021 23:23:08 +0000 Subject: [issue43785] Remove RLock from BZ2File In-Reply-To: <1617946936.07.0.338866506245.issue43785@roundup.psfhosted.org> Message-ID: <1618356188.07.0.361958154835.issue43785@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 19:23:10 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 13 Apr 2021 23:23:10 +0000 Subject: [issue43785] Remove RLock from BZ2File In-Reply-To: <1617946936.07.0.338866506245.issue43785@roundup.psfhosted.org> Message-ID: <1618356190.85.0.750963874768.issue43785@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 695d47b51e3e197de5448a1eb2f618bef6d59ac8 by Inada Naoki in branch 'master': bpo-43785: Update bz2 document (GH-25351) https://github.com/python/cpython/commit/695d47b51e3e197de5448a1eb2f618bef6d59ac8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 19:29:32 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 13 Apr 2021 23:29:32 +0000 Subject: [issue43835] Dataclasses don't call base class __init__ In-Reply-To: <1618352500.63.0.0280826468162.issue43835@roundup.psfhosted.org> Message-ID: <1618356572.28.0.281474194482.issue43835@roundup.psfhosted.org> Eric V. Smith added the comment: dataclasses doesn't know the signature of the base class's __init__, so it can't know how to call it. I realize you've given an example that would accept any parameters, but that isn't typical. What if the base class was: @dataclasses.dataclass class Foo: foo: int def __init__(self, baz): ... pass What would the generated Bar.__init__() look like if it were calling the base class __init__()? What would get passed to baz? > So if a dataclass uses a custom __init__, all its child classes must also use a custom __init__ This isn't true. The typical way to handle this is for the derived class to add a __post_init__() that calls into the base class's __init__(). This way, you can use the normally generated __init__() in the derived class, yet still call the base class's __init__() (which presumably you have some knowledge of). If that doesn't work for some reason (for example, you strictly require that the base class is initialized before the derived class, for some reason), then yes, you'd need to write a custom __init__() in the derived class. dataclasses isn't designed to handle every case: just the most common ones. In your case, you could do: @dataclasses.dataclass class Bar(Foo): bar: int def __post_init__(self): Foo.__init__(self, baz=self.bar) # or whatever ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 19:29:45 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 13 Apr 2021 23:29:45 +0000 Subject: [issue14811] decoding_fgets() truncates long lines and fails with a SyntaxError("Non-UTF-8 code starting with...") In-Reply-To: <1337056300.81.0.374626607094.issue14811@psf.upfronthosting.co.za> Message-ID: <1618356585.97.0.848273129348.issue14811@roundup.psfhosted.org> Eryk Sun added the comment: > So that means we can close the issue, no? This is a bug in 3.8 and 3.9, which need the fix to keep reading until "\n" is seen on the line. I arrived at this issue via bpo-38755 if you think it should be addressed there, but it's the same bug that's reported here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 19:33:39 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 13 Apr 2021 23:33:39 +0000 Subject: [issue43731] PEP 597: logging.fileConfig() uses locale encoding. In-Reply-To: <1617596968.06.0.267322224871.issue43731@roundup.psfhosted.org> Message-ID: <1618356819.69.0.216213399848.issue43731@roundup.psfhosted.org> Inada Naoki added the comment: > Ah, so you want to emit an EncodingWarning when fileConfig(filename) is called without specifying an encoding, right? Yes, but only when the user uses `PYTHONWARNDEFAULTENCODING`. I already added `export PYTHONWARNDEFAULTENCODING=1` in `.bashrc` in my mac and Linux machine. In the future, config file should be read with UTF-8 by default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 19:35:33 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Apr 2021 23:35:33 +0000 Subject: [issue14811] decoding_fgets() truncates long lines and fails with a SyntaxError("Non-UTF-8 code starting with...") In-Reply-To: <1337056300.81.0.374626607094.issue14811@psf.upfronthosting.co.za> Message-ID: <1618356933.08.0.452970114207.issue14811@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ok, let's continue the discussion on https://bugs.python.org/issue38755 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 19:52:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 23:52:57 +0000 Subject: [issue38755] Long unicode string causes SyntaxError: Non-UTF-8 code starting with '\xe2' in file ..., but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details In-Reply-To: <1573302408.95.0.156655994529.issue38755@roundup.psfhosted.org> Message-ID: <1618357977.12.0.169496711635.issue38755@roundup.psfhosted.org> STINNER Victor added the comment: The bpo-14811 issue was fixed in Python 3.10 by bpo-25643, but is not fixed in Python 3.8 and 3.9. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 19:54:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 13 Apr 2021 23:54:10 +0000 Subject: [issue38755] Long unicode string causes SyntaxError: Non-UTF-8 code starting with '\xe2' in file ..., but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details In-Reply-To: <1573302408.95.0.156655994529.issue38755@roundup.psfhosted.org> Message-ID: <1618358050.14.0.784950809318.issue38755@roundup.psfhosted.org> STINNER Victor added the comment: In 2012, I wrote detect_truncate.patch in bpo-14811. Does someone want to convert it to a PR for Python 3.9? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 19:59:32 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 13 Apr 2021 23:59:32 +0000 Subject: [issue43080] pprint for dataclass instances In-Reply-To: <1612052078.12.0.741479641556.issue43080@roundup.psfhosted.org> Message-ID: <1618358372.2.0.0605711055045.issue43080@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 11159d2c9d6616497ef4cc62953a5c3cc8454afb by Lewis Gaul in branch 'master': bpo-43080: pprint for dataclass instances (GH-24389) https://github.com/python/cpython/commit/11159d2c9d6616497ef4cc62953a5c3cc8454afb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 20:03:44 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 14 Apr 2021 00:03:44 +0000 Subject: [issue43080] pprint for dataclass instances In-Reply-To: <1612052078.12.0.741479641556.issue43080@roundup.psfhosted.org> Message-ID: <1618358624.79.0.985254448639.issue43080@roundup.psfhosted.org> Eric V. Smith added the comment: Thanks for all of the work, LewisGaul. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 20:17:12 2021 From: report at bugs.python.org (Paul Pinterits) Date: Wed, 14 Apr 2021 00:17:12 +0000 Subject: [issue43835] Dataclasses don't call base class __init__ In-Reply-To: <1618352500.63.0.0280826468162.issue43835@roundup.psfhosted.org> Message-ID: <1618359432.74.0.542044027686.issue43835@roundup.psfhosted.org> Paul Pinterits added the comment: > dataclasses doesn't know the signature of the base class's __init__, so it can't know how to call it. The dataclass doesn't need to know what arguments the parent __init__ accepts. It should consume the arguments it needs to initialize its instance attributes, and forward the rest to the parent __init__. > The typical way to handle this is for the derived class to add a __post_init__() that calls into the base class's __init__(). How is that supposed to work? Like you said, the class doesn't know what arguments its parent constructor requires. If the derived class doesn't implement a custom __init__, @dataclass will generate one with an (probably) incorrect signature. Changing the signature is pretty much the only reason why you would need to implement a custom __init__, after all. For example: ``` @dataclasses.dataclass class Foo: foo: int def __init__(self): self.foo = 5 @dataclasses.dataclass class Bar(Foo): bar: int def __post_init__(self): super().__init__() bar = Bar(1) # TypeError: __init__() missing 1 required positional argument: 'bar' ``` And even if this workaround actually worked, it would only be applicable if you *know* you're dealing with a dataclass and you'll have this problem. If you're writing something like a class decorator (similar to @dataclass), you don't know if the decorated class will be a dataclass or not. If it's a regular class, you can rely on the __init__s being chain-called. If it's a dataclass, you can't. Therefore, a class decorator that generates/replaces the __init__ method would need to take special care to be compatible with dataclasses, just because dataclasses don't follow basic OOP design principles. Consider this trivial class decorator that generates an __init__ method: ``` def log_init(cls): try: original_init = vars(cls)['__init__'] except KeyError: def original_init(self, *args, **kwargs): super(cls, self).__init__(*args, **kwargs) def __init__(self, *args, **kwargs): print(f'{cls.__name__}.__init__ was called') original_init(self, *args, **kwargs) cls.__init__ = __init__ return cls @log_init @dataclasses.dataclass class Foo: foo: int @dataclasses.dataclass class Bar(Foo): bar: int Foo(1) # Prints "Foo.__init__ was called" Bar(1, 2) # Prints nothing ``` How do you implement this in a way that is compatible with @dataclass? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 20:26:11 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 14 Apr 2021 00:26:11 +0000 Subject: [issue43835] Dataclasses don't call base class __init__ In-Reply-To: <1618352500.63.0.0280826468162.issue43835@roundup.psfhosted.org> Message-ID: <1618359971.21.0.851002062939.issue43835@roundup.psfhosted.org> Eric V. Smith added the comment: > The dataclass doesn't need to know what arguments the parent __init__ accepts. It should consume the arguments it needs to initialize its instance attributes, and forward the rest to the parent __init__. The generated __init__() uses every parameter to initialize instance attributes (if we ignore InitVar). So are you saying it should call the base class with no parameters? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 20:48:59 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 14 Apr 2021 00:48:59 +0000 Subject: [issue43682] Make static methods created by @staticmethod callable In-Reply-To: <1617201081.91.0.895015962683.issue43682@roundup.psfhosted.org> Message-ID: <1618361339.57.0.692482831345.issue43682@roundup.psfhosted.org> Inada Naoki added the comment: Strictly speaking, adding any method is "potential" breaking change because hasattr(obj, "new_method") become from False to True. And since Python is dynamic language, any change is "potential" breaking change. But we don't treat such change as breaking change. Practical beats purity. We can use beta period to see is this change breaks real world application. In case of staticmethod, I think creating a new thread in python-dev is ideal because it is language core feature. I will post a thread. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 21:23:47 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 14 Apr 2021 01:23:47 +0000 Subject: [issue43680] Remove undocumented io.OpenWrapper and _pyio.OpenWrapper In-Reply-To: <1617195561.83.0.0407283597649.issue43680@roundup.psfhosted.org> Message-ID: <1618363427.68.0.787458863411.issue43680@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +24128 pull_request: https://github.com/python/cpython/pull/25395 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 21:24:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 01:24:37 +0000 Subject: [issue43680] Remove undocumented io.OpenWrapper and _pyio.OpenWrapper In-Reply-To: <1617195561.83.0.0407283597649.issue43680@roundup.psfhosted.org> Message-ID: <1618363477.04.0.891856392386.issue43680@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3bc694d5f3d4eb2e5d2f0b83e498b19662845d4e by Victor Stinner in branch 'master': bpo-43680: Deprecate io.OpenWrapper (GH-25357) https://github.com/python/cpython/commit/3bc694d5f3d4eb2e5d2f0b83e498b19662845d4e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 21:26:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 01:26:31 +0000 Subject: [issue43680] Deprecate undocumented io.OpenWrapper and _pyio.OpenWrapper In-Reply-To: <1617195561.83.0.0407283597649.issue43680@roundup.psfhosted.org> Message-ID: <1618363591.5.0.621269443189.issue43680@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: Remove undocumented io.OpenWrapper and _pyio.OpenWrapper -> Deprecate undocumented io.OpenWrapper and _pyio.OpenWrapper _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 21:36:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Apr 2021 01:36:14 +0000 Subject: [issue38530] Offer suggestions on AttributeError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618364174.82.0.554854265491.issue38530@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 37494b441aced0362d7edd2956ab3ea7801e60c8 by Pablo Galindo in branch 'master': bpo-38530: Offer suggestions on AttributeError (#16856) https://github.com/python/cpython/commit/37494b441aced0362d7edd2956ab3ea7801e60c8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 22:17:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Apr 2021 02:17:58 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618366678.62.0.41282365233.issue38530@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- title: Offer suggestions on AttributeError -> Offer suggestions on AttributeError and NameError _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 22:56:44 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Apr 2021 02:56:44 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618369004.53.0.106102170974.issue38530@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24129 pull_request: https://github.com/python/cpython/pull/25397 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 23:09:09 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 14 Apr 2021 03:09:09 +0000 Subject: [issue43828] MappingProxyType accepts string In-Reply-To: <1618301481.88.0.305881121954.issue43828@roundup.psfhosted.org> Message-ID: <1618369749.33.0.0570221783503.issue43828@roundup.psfhosted.org> Raymond Hettinger added the comment: This isn't a bug because the MappingProxy doesn't promise to do early detection and because it can't really be accomplished cleanly. Perfect detection of non-mappings isn't possible. Some easy, minimal checks are made for early detection using PyMapping_Check, PyList_Check, and PyTuple_Check. Anything that gets past those checks will just need to be duck-typed downstream when it is used. We could add a few other specific exclusions but that isn't a general solution and it slows down instantiation. Further it could break code that is intended to work (subclasses of str that mapping methods) or that just happen to work: >>> from types import MappingProxyType >>> mp = MappingProxyType('abc') >>> mp[0] 'a' ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 23:12:29 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 14 Apr 2021 03:12:29 +0000 Subject: [issue43829] MappingProxyType cannot hash a hashable underlying mapping In-Reply-To: <1618302332.9.0.266217619907.issue43829@roundup.psfhosted.org> Message-ID: <1618369949.27.0.0539978651441.issue43829@roundup.psfhosted.org> Raymond Hettinger added the comment: Serhiy, what do you think? Would it make sense to pass through the underlying hash? I don't think there is much use for this but don't see any particular reason to block it. ---------- nosy: +rhettinger, serhiy.storchaka priority: normal -> low versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 13 23:36:46 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 14 Apr 2021 03:36:46 +0000 Subject: [issue43813] Denial of service on http.server module with large request method. In-Reply-To: <1618233428.41.0.905190325792.issue43813@roundup.psfhosted.org> Message-ID: <1618371406.58.0.25414843376.issue43813@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 00:11:46 2021 From: report at bugs.python.org (Kaleb Barrett) Date: Wed, 14 Apr 2021 04:11:46 +0000 Subject: [issue43836] range.index doesn't support start/stop optional arguments Message-ID: <1618373506.04.0.457958304296.issue43836@roundup.psfhosted.org> New submission from Kaleb Barrett : The range builtin type is a collections.abc.Sequence, which in Python 3.5 added the optional start and stop arguments to the index method of Sequences. However, range.index does not support these optional arguments required by Sequence. I noticed this when creating a wrapper type around range which was a Sequence. mypy complained 'Signature of "index" incompatible with supertype "Sequence"', but attempting to pass the values raised 'TypeError: index() takes exactly one argument (3 given)'. ---------- components: Library (Lib) messages: 391029 nosy: ktbarrett priority: normal severity: normal status: open title: range.index doesn't support start/stop optional arguments type: behavior versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 00:29:37 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Wed, 14 Apr 2021 04:29:37 +0000 Subject: [issue32891] Add 'Integer' as synonym for 'Integral' in numbers module. In-Reply-To: <1519191292.27.0.467229070634.issue32891@psf.upfronthosting.co.za> Message-ID: <1618374577.62.0.0404660346638.issue32891@roundup.psfhosted.org> Change by Sergey B Kirpichev : ---------- nosy: +Sergey.Kirpichev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 00:38:05 2021 From: report at bugs.python.org (Aidan Feldman) Date: Wed, 14 Apr 2021 04:38:05 +0000 Subject: [issue43837] Operator precedence documentation could be more clear Message-ID: <1618375085.85.0.211628673766.issue43837@roundup.psfhosted.org> New submission from Aidan Feldman : I am teaching a class on Python for people who are new to coding, and I was talking them through the operator precedence table: https://docs.python.org/3/reference/expressions.html#operator-precedence A couple things that confused the students: - "Highest precedence" is on the bottom, while "lowest precedence" is on top - There isn't any mention of variables. While not operators, probably worth mentioning that they (effectively?) have higher precedence than any of the operators. I'd be happy to try making my first contribution to Python if there's interest in those edits. Also, I have an example breaking down operator precedence in practice here, which I could include: https://colab.research.google.com/github/afeld/python-public-policy/blob/main/lecture_2.ipynb#scrollTo=UTxeT5RvqSFl Thanks! ---------- assignee: docs at python components: Documentation messages: 391030 nosy: aidan.feldman, docs at python priority: normal severity: normal status: open title: Operator precedence documentation could be more clear type: enhancement versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 01:09:55 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 14 Apr 2021 05:09:55 +0000 Subject: [issue43777] Remove description of "pip search" command from tutorial In-Reply-To: <1617913394.59.0.105021549467.issue43777@roundup.psfhosted.org> Message-ID: <1618376995.06.0.705727051387.issue43777@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 133705b85cc25d1e6684d32f8943ca288fadfda0 by Bob Kline in branch 'master': bpo-43777: Drop description of "pip search" command from tutorial (GH-25287) https://github.com/python/cpython/commit/133705b85cc25d1e6684d32f8943ca288fadfda0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 01:10:19 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Apr 2021 05:10:19 +0000 Subject: [issue43777] Remove description of "pip search" command from tutorial In-Reply-To: <1617913394.59.0.105021549467.issue43777@roundup.psfhosted.org> Message-ID: <1618377019.08.0.416077290821.issue43777@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24130 pull_request: https://github.com/python/cpython/pull/25398 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 01:10:50 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Apr 2021 05:10:50 +0000 Subject: [issue43777] Remove description of "pip search" command from tutorial In-Reply-To: <1617913394.59.0.105021549467.issue43777@roundup.psfhosted.org> Message-ID: <1618377050.54.0.400771537154.issue43777@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24131 pull_request: https://github.com/python/cpython/pull/25399 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 01:13:05 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 14 Apr 2021 05:13:05 +0000 Subject: [issue43712] PEP 597: fileinput uses locale encoding In-Reply-To: <1617450057.65.0.948181942157.issue43712@roundup.psfhosted.org> Message-ID: <1618377185.73.0.494973559946.issue43712@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 333d10cbb53dd5f28d76f659a49bf0735f8509d8 by Inada Naoki in branch 'master': bpo-43712 : fileinput: Add encoding parameter (GH-25272) https://github.com/python/cpython/commit/333d10cbb53dd5f28d76f659a49bf0735f8509d8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 01:13:22 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 14 Apr 2021 05:13:22 +0000 Subject: [issue43712] PEP 597: fileinput uses locale encoding In-Reply-To: <1617450057.65.0.948181942157.issue43712@roundup.psfhosted.org> Message-ID: <1618377202.02.0.357747621351.issue43712@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 01:13:39 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 14 Apr 2021 05:13:39 +0000 Subject: [issue5758] fileinput.hook_compressed returning bytes from gz file In-Reply-To: <1239752882.45.0.853698903963.issue5758@psf.upfronthosting.co.za> Message-ID: <1618377219.99.0.705461819827.issue5758@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 01:14:52 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 14 Apr 2021 05:14:52 +0000 Subject: [issue42152] Use PyDict_Contains() and PyDict_SetDefault() instead of PyDict_GetItemWithError() In-Reply-To: <1603697978.15.0.873588402489.issue42152@roundup.psfhosted.org> Message-ID: <1618377292.22.0.343591900073.issue42152@roundup.psfhosted.org> Inada Naoki added the comment: May I close this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 01:16:01 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 14 Apr 2021 05:16:01 +0000 Subject: [issue41098] Deprecating PyUnicodeEncodeError_Create In-Reply-To: <1592988158.78.0.202358099858.issue41098@roundup.psfhosted.org> Message-ID: <1618377361.33.0.940316499539.issue41098@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 01:17:03 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 14 Apr 2021 05:17:03 +0000 Subject: [issue42578] Add tip when encountering UnicodeDecode/EncodeError in open() In-Reply-To: <1607181755.9.0.464136103954.issue42578@roundup.psfhosted.org> Message-ID: <1618377423.07.0.176306316786.issue42578@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 01:17:32 2021 From: report at bugs.python.org (=?utf-8?q?Lum=C3=ADr_Balhar?=) Date: Wed, 14 Apr 2021 05:17:32 +0000 Subject: [issue43752] [sqlite3] Fetching an empty value from date column raises ValueError In-Reply-To: <1617733774.24.0.888180861121.issue43752@roundup.psfhosted.org> Message-ID: <1618377452.01.0.0198046165001.issue43752@roundup.psfhosted.org> Change by Lum?r Balhar : ---------- nosy: +frenzy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 01:18:49 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 14 Apr 2021 05:18:49 +0000 Subject: [issue43733] PEP 597: netrc uses locale encoding. In-Reply-To: <1617626810.53.0.0987972947565.issue43733@roundup.psfhosted.org> Message-ID: <1618377529.65.0.608401404903.issue43733@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +xiang.zhang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 01:19:53 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Apr 2021 05:19:53 +0000 Subject: [issue43777] Remove description of "pip search" command from tutorial In-Reply-To: <1617913394.59.0.105021549467.issue43777@roundup.psfhosted.org> Message-ID: <1618377593.5.0.977016616593.issue43777@roundup.psfhosted.org> miss-islington added the comment: New changeset 6ac1ea25a2ba2aae742e191784cf73033b3ab332 by Miss Islington (bot) in branch '3.8': bpo-43777: Drop description of "pip search" command from tutorial (GH-25287) https://github.com/python/cpython/commit/6ac1ea25a2ba2aae742e191784cf73033b3ab332 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 01:34:49 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Apr 2021 05:34:49 +0000 Subject: [issue43777] Remove description of "pip search" command from tutorial In-Reply-To: <1617913394.59.0.105021549467.issue43777@roundup.psfhosted.org> Message-ID: <1618378489.87.0.226022224232.issue43777@roundup.psfhosted.org> miss-islington added the comment: New changeset 57873af35aad98c6428b1718aaee4b16a82ea3f5 by Miss Islington (bot) in branch '3.9': bpo-43777: Drop description of "pip search" command from tutorial (GH-25287) https://github.com/python/cpython/commit/57873af35aad98c6428b1718aaee4b16a82ea3f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 01:41:03 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 14 Apr 2021 05:41:03 +0000 Subject: [issue43777] Remove description of "pip search" command from tutorial In-Reply-To: <1617913394.59.0.105021549467.issue43777@roundup.psfhosted.org> Message-ID: <1618378863.57.0.943237031039.issue43777@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 01:48:35 2021 From: report at bugs.python.org (Andy Maier) Date: Wed, 14 Apr 2021 05:48:35 +0000 Subject: [issue43828] MappingProxyType accepts string In-Reply-To: <1618301481.88.0.305881121954.issue43828@roundup.psfhosted.org> Message-ID: <1618379315.45.0.545760273123.issue43828@roundup.psfhosted.org> Andy Maier added the comment: I accept that the issue was closed, but wanted to document some things: 1. The dict class manages very well to detect that a string is invalid input: >>> d = dict('abc') Traceback (most recent call last): File "", line 1, in ValueError: dictionary update sequence element #0 has length 1; 2 is required 2. When initialized with strings, it looses some of its dictionary methods, but does a quite reasonable job in pointing that out in the error message: >>> mp = MappingProxyType('abc') >>> mp.items() Traceback (most recent call last): File "", line 1, in AttributeError: 'str' object has no attribute 'items' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 03:12:00 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Apr 2021 07:12:00 +0000 Subject: [issue42152] Use PyDict_Contains() and PyDict_SetDefault() instead of PyDict_GetItemWithError() In-Reply-To: <1603697978.15.0.873588402489.issue42152@roundup.psfhosted.org> Message-ID: <1618384320.86.0.384095950738.issue42152@roundup.psfhosted.org> Serhiy Storchaka added the comment: Sure. Thanks for reminder. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 03:24:00 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Apr 2021 07:24:00 +0000 Subject: [issue43829] MappingProxyType cannot hash a hashable underlying mapping In-Reply-To: <1618302332.9.0.266217619907.issue43829@roundup.psfhosted.org> Message-ID: <1618385040.8.0.920550415513.issue43829@roundup.psfhosted.org> Serhiy Storchaka added the comment: Perhaps MappingProxyType is unhashable by accident. It implements __eq__, and it makes it unhashable by default. And nobody made request for this feature before. I think that implementing __hash__ would not make anything wrong. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 03:34:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Apr 2021 07:34:28 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType Message-ID: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> New submission from Serhiy Storchaka : The purpose of MappingProxyType is to provide a read-only proxy for mapping. It should not expose the underlying mapping because it would invalidate the purpose of read-only proxy. But there is a way to do this using comparison operator: from types import MappingProxyType orig = {1: 2} proxy = MappingProxyType(orig) class X: def __eq__(self, other): other[1] = 3 assert proxy[1] == 2 proxy == X() assert proxy[1] == 3 assert orig[1] == 3 In particularly it allows to modify __dict__ of builtin types. ---------- components: Interpreter Core messages: 391039 nosy: rhettinger, serhiy.storchaka priority: normal severity: normal status: open title: There is a way to access an underlying mapping in MappingProxyType type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 03:42:03 2021 From: report at bugs.python.org (Paul Pinterits) Date: Wed, 14 Apr 2021 07:42:03 +0000 Subject: [issue43835] Dataclasses don't call base class __init__ In-Reply-To: <1618352500.63.0.0280826468162.issue43835@roundup.psfhosted.org> Message-ID: <1618386123.55.0.62448750627.issue43835@roundup.psfhosted.org> Paul Pinterits added the comment: No, I'm saying Bar should initialize the 'bar' attribute, and then call Foo.__init__ to let it initialize the 'foo' attribute. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 03:46:45 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Apr 2021 07:46:45 +0000 Subject: [issue43829] MappingProxyType cannot hash a hashable underlying mapping In-Reply-To: <1618302332.9.0.266217619907.issue43829@roundup.psfhosted.org> Message-ID: <1618386405.09.0.026475184622.issue43829@roundup.psfhosted.org> Serhiy Storchaka added the comment: But there is an issue with comparison implementation in MappingProxyType (see issue43838). Resolving that issue can affect the decision about hashability. There should be always true the following predicate: if x == y then hash(x) == hash(y). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 04:09:26 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 14 Apr 2021 08:09:26 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618387766.76.0.0690901147133.issue43833@roundup.psfhosted.org> Shreyan Avigyan added the comment: Hi. I just want to know why is and, or operators behaving like this. The behavior is described in https://bugs.python.org/issue43833#msg390996. Moreover I researched a little more and found out even if __and__, __or__ methods are defined the and, or operators doesn't seem to work. As Serhiy described in https://bugs.python.org/issue43833#msg390998 the parser reads [0x1for x in (1,2)] as [0x1f or x in (1,2)] which is the parser's fault but why is the or operator behaving like that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 04:11:15 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 14 Apr 2021 08:11:15 +0000 Subject: [issue43733] PEP 597: netrc uses locale encoding. In-Reply-To: <1617626810.53.0.0987972947565.issue43733@roundup.psfhosted.org> Message-ID: <1618387875.23.0.869209410888.issue43733@roundup.psfhosted.org> Inada Naoki added the comment: I googled "netrc UnicodeDecodeError". It is very rare, but I found two cases. * https://stackoverflow.com/questions/54748450/macos-python-3-netrc-operations-end-up-with-unicodedecodeerror This user uses macOS and Python tried UTF-8. But .netrc was not UTF-8. * https://qiita.com/yuji38kwmt/items/5472c98cb800ccaab093 This user uses Windows. They write .netrc with UTF-8, but Python used cp932. --- There are several options: * Use UTF-8. If user encountered UnicodeDecodeError, user need to change the .netrc encoding. * Use UTF-8 with "surrogateescape" or "replace" error handler. non-UTF-8 in comments are ignored. * Use latin-1. non-ASCII characters in comments are ignored. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 04:16:45 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 14 Apr 2021 08:16:45 +0000 Subject: [issue43837] Operator precedence documentation could be more clear In-Reply-To: <1618375085.85.0.211628673766.issue43837@roundup.psfhosted.org> Message-ID: <1618388205.8.0.821461323849.issue43837@roundup.psfhosted.org> Steven D'Aprano added the comment: > There isn't any mention of variables. While not operators, probably worth mentioning that they (effectively?) have higher precedence than any of the operators. I'm sorry, I don't understand what that means. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 04:24:46 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 14 Apr 2021 08:24:46 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1618388686.45.0.658208805533.issue40137@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Raymond: > 1) move the expensive get_functools_state_by_type() inside the code block that creates new links, so that it won't affect a full cache. This should be as easy as adding a _functools_state pointer to struct lru_cache_object, init that pointer in lru_cache_new(), and then fetch it from self in infinite_lru_cache_wrapper() and bounded_lru_cache_wrapper(), no? Diff attached. ---------- nosy: +erlendaasland Added file: https://bugs.python.org/file49958/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 04:36:52 2021 From: report at bugs.python.org (Paul Pinterits) Date: Wed, 14 Apr 2021 08:36:52 +0000 Subject: [issue43835] Dataclasses don't call base class __init__ In-Reply-To: <1618352500.63.0.0280826468162.issue43835@roundup.psfhosted.org> Message-ID: <1618389412.6.0.122073938491.issue43835@roundup.psfhosted.org> Paul Pinterits added the comment: Admittedly, with the way dataclasses accept their __init__ arguments, figuring out which arguments to consume and which to pass on isn't a trivial task. If a dataclass Bar inherits from a dataclass Foo, then Bar.__init__ is (for all intents and purposes) defined as def __init__(self, foo, bar): Because the arguments for the parents *precede* the arguments for Bar, it's not easy to create an equivalent __init__ without knowing anything about the base class(es)'s constructor arguments. But that doesn't mean it's impossible: ``` class Foo: foo: int def __init__(self): self.foo = 5 class Bar(Foo): bar: int def __init__(self, *args, **kwargs): if 'bar' in kwargs: self.bar = kwargs.pop('bar') else: *args, self.bar = args super().__init__(*args, **kwargs) print([Bar(1), Bar(bar=1)]) ``` Essentially, Bar.__init__ looks for a keyword argument named 'bar', and if that doesn't exist, it uses the last positional argument as the value for 'bar'. This is backwards compatible with "normal" dataclasses, and improves support for dataclasses with custom __init__s. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 04:55:47 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 14 Apr 2021 08:55:47 +0000 Subject: [issue43835] Dataclasses don't call base class __init__ In-Reply-To: <1618352500.63.0.0280826468162.issue43835@roundup.psfhosted.org> Message-ID: <1618390547.48.0.842885724831.issue43835@roundup.psfhosted.org> Eric V. Smith added the comment: But Bar(1, 2), Bar(1, foo=2), Bar(bar=1, foo=2) all give errors. These are all valid if both Foo and Bar are decorated with @dataclass. Calling base class __init__() functions is an incompatible change, and I don't think we'll make any change to do so. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 05:09:53 2021 From: report at bugs.python.org (Paul Pinterits) Date: Wed, 14 Apr 2021 09:09:53 +0000 Subject: [issue43835] Dataclasses don't call base class __init__ In-Reply-To: <1618352500.63.0.0280826468162.issue43835@roundup.psfhosted.org> Message-ID: <1618391393.9.0.973256061472.issue43835@roundup.psfhosted.org> Paul Pinterits added the comment: You're telling me that some people out there rely on their custom __init__ *not* being called? O.o ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 05:11:54 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 14 Apr 2021 09:11:54 +0000 Subject: [issue43835] Dataclasses don't call base class __init__ In-Reply-To: <1618352500.63.0.0280826468162.issue43835@roundup.psfhosted.org> Message-ID: <1618391514.65.0.777110029744.issue43835@roundup.psfhosted.org> Eric V. Smith added the comment: Yes, I'm sure it happens. from dataclasses import dataclass @dataclass class Foo: foo: int def __init__(self, a, b, c): self.foo = a * b * c @dataclass class Bar(Foo): bar: int print(Bar(1, 2)) print(Foo(1, 2, 3)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 05:14:48 2021 From: report at bugs.python.org (Carl Friedrich Bolz-Tereick) Date: Wed, 14 Apr 2021 09:14:48 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618391688.86.0.600197251857.issue43833@roundup.psfhosted.org> Carl Friedrich Bolz-Tereick added the comment: @shreyanavigyan This is a bit off-topic, but it's called "short-circuiting", described here: https://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-not (or/and aren't really "operators", like +/- etc, they cannot be overridden, they evaluate their components lazily and are therefore almost control flow) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 05:18:36 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 14 Apr 2021 09:18:36 +0000 Subject: [issue43831] sqlite: convert_timestamp raises ValueError for empty columns In-Reply-To: <1618311594.99.0.0340525219314.issue43831@roundup.psfhosted.org> Message-ID: <1618391916.8.0.32915055321.issue43831@roundup.psfhosted.org> Change by Petr Viktorin : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 05:20:12 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 14 Apr 2021 09:20:12 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618392012.13.0.316656549259.issue43833@roundup.psfhosted.org> Shreyan Avigyan added the comment: @Carl.Friedrich.Bolz Thanks a lot for clarifying. For a second, I thought it was maybe a bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 06:01:09 2021 From: report at bugs.python.org (Andre Roberge) Date: Wed, 14 Apr 2021 10:01:09 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618394469.07.0.804013232584.issue38530@roundup.psfhosted.org> Change by Andre Roberge : ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 06:06:37 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 14 Apr 2021 10:06:37 +0000 Subject: [issue43804] Add more info about building C/C++ Extensions on Windows using MSVC In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1618394797.08.0.603669691991.issue43804@roundup.psfhosted.org> Shreyan Avigyan added the comment: Kindly have a review of my PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 06:59:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 10:59:49 +0000 Subject: [issue43839] [easy] test_cmd_line: DeprecationWarning: invalid escape sequence \u Message-ID: <1618397989.34.0.985444339357.issue43839@roundup.psfhosted.org> New submission from STINNER Victor : Does someone want to propose a fix for the following warning? $ ./python -m test test_cmd_line 0:00:00 load avg: 6.45 Run tests sequentially 0:00:00 load avg: 6.45 [1/1] test_cmd_line /home/vstinner/python/master/Lib/test/test_cmd_line.py:865: DeprecationWarning: invalid escape sequence \u self.check_string(b"'\u1f'") == Tests result: SUCCESS == 1 test OK. Total duration: 15.9 sec Tests result: SUCCESS ---------- components: Tests keywords: easy, newcomer friendly messages: 391053 nosy: vstinner priority: normal severity: normal status: open title: [easy] test_cmd_line: DeprecationWarning: invalid escape sequence \u versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:05:22 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 14 Apr 2021 11:05:22 +0000 Subject: [issue43839] [easy] test_cmd_line: DeprecationWarning: invalid escape sequence \u In-Reply-To: <1618397989.34.0.985444339357.issue43839@roundup.psfhosted.org> Message-ID: <1618398322.02.0.734167824103.issue43839@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:06:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 11:06:17 +0000 Subject: [issue43840] [easy] test_distutils logs 3 DeprecationWarning warnings Message-ID: <1618398377.82.0.479453704615.issue43840@roundup.psfhosted.org> New submission from STINNER Victor : test_distutils logs 3 DeprecationWarning warnings. They are emitted on purpose and related to PEP 632. Does someone want to propose a fix for that? "with self.assertWarns(DeprecationWarning):" or warnings_helper.check_warnings() of test.support.warnings_helper can be used. $ ./python -m test -v test_distutils (...) 0:00:00 load avg: 5.49 [1/1] test_distutils /home/vstinner/python/master/Lib/test/test_distutils.py:8: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives import distutils.tests (...) test_byte_compile_optimized (distutils.tests.test_build_py.BuildPyTestCase) ... /tmp/tmpptdx9r50.py:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.util import byte_compile ok (...) test_byte_compile (distutils.tests.test_install_lib.InstallLibTestCase) ... /tmp/tmpk_cfc09q.py:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.util import byte_compile ok (...) Tests result: SUCCESS -- By the way, it would be nice to ignore the DeprecationWarning in setup.py as well for now: $ make (...) /home/vstinner/python/master/./setup.py:33: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils import log (...) This warning is annoying. ---------- components: Tests keywords: easy, newcomer friendly messages: 391054 nosy: vstinner priority: normal severity: normal status: open title: [easy] test_distutils logs 3 DeprecationWarning warnings _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:07:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 11:07:11 +0000 Subject: [issue43840] [easy] test_distutils logs 3 DeprecationWarning warnings In-Reply-To: <1618398377.82.0.479453704615.issue43840@roundup.psfhosted.org> Message-ID: <1618398431.82.0.130035543285.issue43840@roundup.psfhosted.org> STINNER Victor added the comment: Another warning: $ ./python -m test -v test_check_c_globals (...) DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives import distutils.ccompiler (...) Tests result: SUCCESS ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:09:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 11:09:23 +0000 Subject: [issue43841] [easy] test_collections: DeprecationWarning: Please use assertEqual instead Message-ID: <1618398563.11.0.755110442609.issue43841@roundup.psfhosted.org> New submission from STINNER Victor : Does someone want to propose a fix? $ ./python -m test -v test_collections (...) test_issue_4920 (test.test_collections.TestCollectionABCs) ... /home/vstinner/python/master/Lib/test/test_collections.py:1518: DeprecationWarning: Please use assertEqual instead. self.assertEquals(len(s), len(items) - 1) ok (...) Tests result: SUCCESS Warning introduced by PR 25209: commit 453074c8daf996b1815a0cd2218f0dbf1801056c Author: Stepan Sindelar Date: Thu Apr 8 01:31:55 2021 +0200 Fix broken test for MutableSet.pop() (GH-25209) Changes the test to not assert concrete result of pop, but just that it was an item from the set, and that the set shrunk by one. ---------- components: Tests keywords: easy, newcomer friendly messages: 391056 nosy: vstinner priority: normal severity: normal status: open title: [easy] test_collections: DeprecationWarning: Please use assertEqual instead versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:15:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 11:15:16 +0000 Subject: [issue43842] test_logging: "OSError: [Errno 9] Bad file descriptor" logged on FreeBSD Message-ID: <1618398916.84.0.57759722491.issue43842@roundup.psfhosted.org> New submission from STINNER Victor : Random error seen on FreeBSD: 0:05:54 load avg: 5.75 [340/427/1] test_logging passed -- running: test_pydoc (34.4 sec) Exception in thread Thread-25 (serve_forever): Traceback (most recent call last): File "/usr/home/vstinner/python/master/Lib/threading.py", line 990, in _bootstrap_inner self.run() File "/usr/home/vstinner/python/master/Lib/threading.py", line 928, in run self._target(*self._args, **self._kwargs) File "/usr/home/vstinner/python/master/Lib/test/test_logging.py", line 863, in serve_forever asyncore.loop(poll_interval, map=self._map) File "/usr/home/vstinner/python/master/Lib/asyncore.py", line 203, in loop poll_fun(timeout, map) File "/usr/home/vstinner/python/master/Lib/asyncore.py", line 144, in poll r, w, e = select.select(r, w, e, timeout) OSError: [Errno 9] Bad file descriptor ---------- components: Tests messages: 391057 nosy: vstinner priority: normal severity: normal status: open title: test_logging: "OSError: [Errno 9] Bad file descriptor" logged on FreeBSD versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:18:53 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 14 Apr 2021 11:18:53 +0000 Subject: [issue43752] [sqlite3] Fetching an empty value from date column raises ValueError In-Reply-To: <1617733774.24.0.888180861121.issue43752@roundup.psfhosted.org> Message-ID: <1618399133.27.0.0706210479338.issue43752@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 6f1e8ccffa5b1272a36a35405d3c4e4bbba0c082 by Erlend Egeberg Aasland in branch 'master': bpo-43752: Fix sqlite3 regression for zero-sized blobs with converters (GH-25228) https://github.com/python/cpython/commit/6f1e8ccffa5b1272a36a35405d3c4e4bbba0c082 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:20:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 11:20:23 +0000 Subject: [issue43843] libregrtest: mark a test as failed if a thread logs an unexpected exception Message-ID: <1618399223.2.0.989011891247.issue43843@roundup.psfhosted.org> New submission from STINNER Victor : The Python test runner (libregrtest) should mark a test as failed if a thread logs an unexpected exception, as already done with unraisable exception. See for example bpo-43842 where test_logging logs the following exception, but the tes is marked as passed: Exception in thread Thread-25 (serve_forever): Traceback (most recent call last): File "/usr/home/vstinner/python/master/Lib/threading.py", line 990, in _bootstrap_inner self.run() File "/usr/home/vstinner/python/master/Lib/threading.py", line 928, in run self._target(*self._args, **self._kwargs) File "/usr/home/vstinner/python/master/Lib/test/test_logging.py", line 863, in serve_forever asyncore.loop(poll_interval, map=self._map) File "/usr/home/vstinner/python/master/Lib/asyncore.py", line 203, in loop poll_fun(timeout, map) File "/usr/home/vstinner/python/master/Lib/asyncore.py", line 144, in poll r, w, e = select.select(r, w, e, timeout) OSError: [Errno 9] Bad file descriptor Attached PR implements this change. ---------- components: Tests messages: 391059 nosy: vstinner priority: normal severity: normal status: open title: libregrtest: mark a test as failed if a thread logs an unexpected exception versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:23:31 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 14 Apr 2021 11:23:31 +0000 Subject: [issue43752] [sqlite3] Fetching an empty value from date column raises ValueError In-Reply-To: <1617733774.24.0.888180861121.issue43752@roundup.psfhosted.org> Message-ID: <1618399411.41.0.464304207842.issue43752@roundup.psfhosted.org> Berker Peksag added the comment: Thank you for the report and reproducer, Mariusz and thank you for the PR, Erlend. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:27:47 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 14 Apr 2021 11:27:47 +0000 Subject: [issue43841] [easy] test_collections: DeprecationWarning: Please use assertEqual instead In-Reply-To: <1618398563.11.0.755110442609.issue43841@roundup.psfhosted.org> Message-ID: <1618399667.0.0.540839667932.issue43841@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This is a duplicate of https://bugs.python.org/issue43825. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:30:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 11:30:59 +0000 Subject: [issue43843] libregrtest: mark a test as failed if a thread logs an unexpected exception In-Reply-To: <1618399223.2.0.989011891247.issue43843@roundup.psfhosted.org> Message-ID: <1618399859.77.0.090610606683.issue43843@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +24132 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25400 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:32:03 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Apr 2021 11:32:03 +0000 Subject: [issue43839] [easy] test_cmd_line: DeprecationWarning: invalid escape sequence \u In-Reply-To: <1618397989.34.0.985444339357.issue43839@roundup.psfhosted.org> Message-ID: <1618399923.6.0.737134088678.issue43839@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Deprecation warnings in test cases _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:32:31 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Apr 2021 11:32:31 +0000 Subject: [issue43841] [easy] test_collections: DeprecationWarning: Please use assertEqual instead In-Reply-To: <1618398563.11.0.755110442609.issue43841@roundup.psfhosted.org> Message-ID: <1618399951.52.0.447677503984.issue43841@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Deprecation warnings in test cases _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:38:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 11:38:57 +0000 Subject: [issue43844] [easy] Message-ID: <1618400337.77.0.971562000748.issue43844@roundup.psfhosted.org> New submission from STINNER Victor : :2: PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+ $ ./python -m test -v test_lib2to3 (...) test_load_grammar_from_subprocess (lib2to3.tests.test_parser.TestPgen2Caching) ... :2: PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+ ok (...) Tests result: SUCCESS Command to only re-run this test: ./python -Werror -m test -v test_lib2to3 -m test_load_grammar_from_subprocess ---------- messages: 391062 nosy: vstinner priority: normal severity: normal status: open title: [easy] _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:39:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 11:39:37 +0000 Subject: [issue43844] [easy] test_lib2to3 logs a PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+ In-Reply-To: <1618400337.77.0.971562000748.issue43844@roundup.psfhosted.org> Message-ID: <1618400377.78.0.448838290079.issue43844@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: [easy] -> [easy] test_lib2to3 logs a PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:39:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 11:39:50 +0000 Subject: [issue43844] [easy] test_lib2to3 logs a PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+ In-Reply-To: <1618400337.77.0.971562000748.issue43844@roundup.psfhosted.org> Message-ID: <1618400390.05.0.186671711002.issue43844@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +Tests keywords: +easy, newcomer friendly versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:44:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 11:44:17 +0000 Subject: [issue43825] [easy] test_collections: DeprecationWarning: Please use assertEqual instead In-Reply-To: <1618290915.84.0.96654876493.issue43825@roundup.psfhosted.org> Message-ID: <1618400657.68.0.826851937261.issue43825@roundup.psfhosted.org> STINNER Victor added the comment: Serhiy closed my issue bpo-43841 as a duplicate of this one. My message: Does someone want to propose a fix? $ ./python -m test -v test_collections (...) test_issue_4920 (test.test_collections.TestCollectionABCs) ... /home/vstinner/python/master/Lib/test/test_collections.py:1518: DeprecationWarning: Please use assertEqual instead. self.assertEquals(len(s), len(items) - 1) ok (...) Tests result: SUCCESS Warning introduced by PR 25209: commit 453074c8daf996b1815a0cd2218f0dbf1801056c Author: Stepan Sindelar Date: Thu Apr 8 01:31:55 2021 +0200 Fix broken test for MutableSet.pop() (GH-25209) Changes the test to not assert concrete result of pop, but just that it was an item from the set, and that the set shrunk by one. ---------- nosy: +vstinner title: Deprecation warnings in test cases -> [easy] test_collections: DeprecationWarning: Please use assertEqual instead _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:45:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 11:45:25 +0000 Subject: [issue43825] [easy] test_collections: DeprecationWarning: Please use assertEqual instead In-Reply-To: <1618290915.84.0.96654876493.issue43825@roundup.psfhosted.org> Message-ID: <1618400725.78.0.917051688414.issue43825@roundup.psfhosted.org> STINNER Victor added the comment: New changeset b8509ffa82d393d9d4a0f5520edca057978bbd86 by Karthikeyan Singaravelan in branch 'master': bpo-43825: Fix deprecation warnings in test_cmd_line and test_collections (GH-25380) https://github.com/python/cpython/commit/b8509ffa82d393d9d4a0f5520edca057978bbd86 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:45:53 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 14 Apr 2021 11:45:53 +0000 Subject: [issue43265] [sqlite3] Improve backup error handling In-Reply-To: <1613725802.16.0.516336537835.issue43265@roundup.psfhosted.org> Message-ID: <1618400753.5.0.250414014906.issue43265@roundup.psfhosted.org> Berker Peksag added the comment: New changeset c1ae7419975f7d664320f66ea3acc8663bbf76cf by Erlend Egeberg Aasland in branch 'master': bpo-43265: Improve sqlite3.Connection.backup error handling (GH-24586) https://github.com/python/cpython/commit/c1ae7419975f7d664320f66ea3acc8663bbf76cf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:46:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 11:46:31 +0000 Subject: [issue43825] [easy] test_collections: DeprecationWarning: Please use assertEqual instead In-Reply-To: <1618290915.84.0.96654876493.issue43825@roundup.psfhosted.org> Message-ID: <1618400791.44.0.566612996847.issue43825@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Karthikeyan! Usually, I let core developers to merge their own PRs, but I created multiple "easy" issues about warnings in tests, and so I merged directly your fix to prevent contributors to propose similar fixes ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:46:52 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 14 Apr 2021 11:46:52 +0000 Subject: [issue43265] [sqlite3] Improve backup error handling In-Reply-To: <1613725802.16.0.516336537835.issue43265@roundup.psfhosted.org> Message-ID: <1618400812.89.0.625494882176.issue43265@roundup.psfhosted.org> Berker Peksag added the comment: Thank you. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:46:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 11:46:55 +0000 Subject: [issue43825] Deprecation warnings in test_cmd_line and test_collections In-Reply-To: <1618290915.84.0.96654876493.issue43825@roundup.psfhosted.org> Message-ID: <1618400815.73.0.403006366915.issue43825@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: [easy] test_collections: DeprecationWarning: Please use assertEqual instead -> Deprecation warnings in test_cmd_line and test_collections _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:48:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 11:48:01 +0000 Subject: [issue43825] Deprecation warnings in test_cmd_line and test_collections In-Reply-To: <1618290915.84.0.96654876493.issue43825@roundup.psfhosted.org> Message-ID: <1618400881.22.0.107291427292.issue43825@roundup.psfhosted.org> STINNER Victor added the comment: I also created bpo-43839 "[easy] test_cmd_line: DeprecationWarning: invalid escape sequence \u" which was closed as duplicate of this one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:48:37 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 14 Apr 2021 11:48:37 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.4 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1618400917.63.0.0476290862994.issue43492@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Looks like there might be a 3.35.5 release in the near future: https://sqlite.org/forum/forumpost/d36426225c?t=h ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:57:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 11:57:40 +0000 Subject: [issue43845] test_concurrent_futures leaks many dangling threads on FreeBSD Message-ID: <1618401460.69.0.519102056132.issue43845@roundup.psfhosted.org> New submission from STINNER Victor : test_idle_process_reuse_multiple() of test_concurrent_futures failed on AMD64 FreeBSD Shared 3.x, but then passed when re-run in verbose mode. https://buildbot.python.org/all/#/builders/483/builds/1073 Moreover, test_concurrent_futures leaked many dangling threads. 0:04:31 load avg: 1.95 [163/427/1] test_concurrent_futures failed (3 min 29 sec) -- running: test_nntplib (2 min 17 sec) Warning -- threading_cleanup() failed to cleanup 2 threads (count: 2, dangling: 3) Warning -- Dangling thread: <_ExecutorManagerThread(Thread-41, started 34386025472)> Warning -- Dangling thread: <_MainThread(MainThread, started 34374492160)> Warning -- Dangling thread: Warning -- threading_cleanup() failed to cleanup -2 threads (count: 0, dangling: 1) Warning -- Dangling thread: <_MainThread(MainThread, started 34374492160)> (...) ====================================================================== FAIL: test_idle_process_reuse_multiple (test.test_concurrent_futures.ProcessPoolForkProcessPoolExecutorTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_concurrent_futures.py", line 1018, in test_idle_process_reuse_multiple self.assertLessEqual(len(executor._processes), 2) AssertionError: 3 not less than or equal to 2 Stdout: 0.43s ---------------------------------------------------------------------- Ran 226 tests in 209.441s FAILED (failures=1, skipped=6) test test_concurrent_futures failed (...) 1 re-run test: test_concurrent_futures Total duration: 16 min 7 sec Tests result: FAILURE then SUCCESS ---------- components: Tests messages: 391070 nosy: vstinner priority: normal severity: normal status: open title: test_concurrent_futures leaks many dangling threads on FreeBSD versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 07:58:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 11:58:07 +0000 Subject: [issue43845] test_concurrent_futures leaks many dangling threads on FreeBSD In-Reply-To: <1618401460.69.0.519102056132.issue43845@roundup.psfhosted.org> Message-ID: <1618401487.6.0.700431974453.issue43845@roundup.psfhosted.org> STINNER Victor added the comment: See also: * bpo-39995: test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor * bpo-35809: test_concurrent_futures.ProcessPoolForkExecutorDeadlockTest fails intermittently on Travis and passes in verbose mode ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 08:09:31 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 14 Apr 2021 12:09:31 +0000 Subject: [issue43846] Control stack usage in large expressions Message-ID: <1618402171.48.0.736532073467.issue43846@roundup.psfhosted.org> New submission from Mark Shannon : Large literals or function calls with many arguments can consume a lot of stack space. This will be a problem for any future work to use a contiguous stack for data and possibly eliminate frame objects for most calls. It is also possible (I haven't measured this) that this large stack consumption is hurting performance now, as it might leak memory by leaving giant frames in the free-list or as a zombie frame. This fix relatively straightforward. For large literals and argument lists, build them incrementally rather than all at once. ---------- assignee: Mark.Shannon components: Interpreter Core messages: 391072 nosy: Mark.Shannon priority: normal severity: normal stage: needs patch status: open title: Control stack usage in large expressions type: performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 08:11:28 2021 From: report at bugs.python.org (John Hagen) Date: Wed, 14 Apr 2021 12:11:28 +0000 Subject: [issue43834] Use context manager in StringIO example In-Reply-To: <1618344155.0.0.639710984937.issue43834@roundup.psfhosted.org> Message-ID: <1618402288.14.0.420129488012.issue43834@roundup.psfhosted.org> Change by John Hagen : ---------- keywords: +patch pull_requests: +24133 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25401 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 08:28:58 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 14 Apr 2021 12:28:58 +0000 Subject: [issue20364] Rename & explain sqlite3.Cursor.execute 'parameters' param In-Reply-To: <1390473779.26.0.463818219743.issue20364@psf.upfronthosting.co.za> Message-ID: <1618403338.76.0.154883104031.issue20364@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 3386ca0b36327afeef8d7eff277b2aed1030c08d by Erlend Egeberg Aasland in branch 'master': bpo-20364: Improve sqlite3 placeholder docs (GH-25003) https://github.com/python/cpython/commit/3386ca0b36327afeef8d7eff277b2aed1030c08d ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 08:29:16 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Apr 2021 12:29:16 +0000 Subject: [issue20364] Rename & explain sqlite3.Cursor.execute 'parameters' param In-Reply-To: <1390473779.26.0.463818219743.issue20364@psf.upfronthosting.co.za> Message-ID: <1618403356.55.0.635796840665.issue20364@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +24135 pull_request: https://github.com/python/cpython/pull/25402 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 08:51:02 2021 From: report at bugs.python.org (ed) Date: Wed, 14 Apr 2021 12:51:02 +0000 Subject: [issue43847] realpath of bytestr smb drive letters fail Message-ID: <1618404662.92.0.914724176997.issue43847@roundup.psfhosted.org> New submission from ed : some win7sp1 and win10:20H2 boxes cannot realpath a networked drive letter such as b"n:" (also affects b"n:\\") * observed with 3.8.7 and 3.9.1 * 3.7.9 is fine requirements to trigger: * bytestring (not unicode str) * just the drive letter (subfolders are ok) * networked drive (regular disks and vmhgfs are ok) * enterprise/AD network? (doesn't seem to happen with samba) hits the following exceptions in succession: * access denied at L601: "path = _getfinalpathname(path)" * "cant concat str to bytes" at L621: "return path + tail" ---------- components: Windows messages: 391074 nosy: 9001, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: realpath of bytestr smb drive letters fail type: behavior versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 09:10:31 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 14 Apr 2021 13:10:31 +0000 Subject: [issue43840] [easy] test_distutils logs 3 DeprecationWarning warnings In-Reply-To: <1618398377.82.0.479453704615.issue43840@roundup.psfhosted.org> Message-ID: <1618405831.67.0.801792063763.issue43840@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: I have reported this in the original issue earlier https://bugs.python.org/issue41282#msg388224 . See also https://bugs.python.org/issue43425 for more discussion over handling this. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 09:15:30 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 14 Apr 2021 13:15:30 +0000 Subject: [issue43844] [easy] test_lib2to3 logs a PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+ In-Reply-To: <1618400337.77.0.971562000748.issue43844@roundup.psfhosted.org> Message-ID: <1618406130.51.0.250943473642.issue43844@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: I fixed this in https://github.com/python/cpython/pull/21694 . Somehow this seems to emit warning over full test run and not in individual case :( Is there a command to reproduce this always? I ran the command but it's successful for me and doesn't show the warning. ./python -Werror -m test -v test_lib2to3 -m test_load_grammar_from_subprocess == CPython 3.10.0a7+ (heads/master:d9151cb453, Apr 13 2021, 03:10:47) [GCC 7.5.0] == Linux-4.15.0-99-generic-x86_64-with-glibc2.27 little-endian == cwd: /root/cpython/build/test_python_20462? == CPU count: 1 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 0.02 Run tests sequentially 0:00:00 load avg: 0.02 [1/1] test_lib2to3 test_load_grammar_from_subprocess (lib2to3.tests.test_parser.TestPgen2Caching) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.164s OK == Tests result: SUCCESS == 1 test OK. Total duration: 303 ms Tests result: SUCCESS ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 09:23:32 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 14 Apr 2021 13:23:32 +0000 Subject: [issue43846] Control stack usage in large expressions In-Reply-To: <1618402171.48.0.736532073467.issue43846@roundup.psfhosted.org> Message-ID: <1618406612.68.0.175021353118.issue43846@roundup.psfhosted.org> Change by Mark Shannon : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 09:23:44 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 14 Apr 2021 13:23:44 +0000 Subject: [issue43846] Control stack usage in large expressions In-Reply-To: <1618402171.48.0.736532073467.issue43846@roundup.psfhosted.org> Message-ID: <1618406624.01.0.0430885249872.issue43846@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +24136 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25403 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 09:28:15 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 14 Apr 2021 13:28:15 +0000 Subject: [issue20364] Rename & explain sqlite3.Cursor.execute 'parameters' param In-Reply-To: <1390473779.26.0.463818219743.issue20364@psf.upfronthosting.co.za> Message-ID: <1618406895.14.0.166549404133.issue20364@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 95e4431804587a0c9d464bb7b3d5f3057bbeaccd by Miss Islington (bot) in branch '3.9': bpo-20364: Improve sqlite3 placeholder docs (GH-25003) https://github.com/python/cpython/commit/95e4431804587a0c9d464bb7b3d5f3057bbeaccd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 09:28:33 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 14 Apr 2021 13:28:33 +0000 Subject: [issue20364] Rename & explain sqlite3.Cursor.execute 'parameters' param In-Reply-To: <1390473779.26.0.463818219743.issue20364@psf.upfronthosting.co.za> Message-ID: <1618406913.1.0.848319347178.issue20364@roundup.psfhosted.org> Change by Berker Peksag : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 09:29:32 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 14 Apr 2021 13:29:32 +0000 Subject: [issue43505] [sqlite3] Explicitly initialise and shut down sqlite3 In-Reply-To: <1615849784.81.0.125050267571.issue43505@roundup.psfhosted.org> Message-ID: <1618406972.3.0.908644139025.issue43505@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch pull_requests: +24137 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25404 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 09:39:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 13:39:00 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1618407540.27.0.0375624493514.issue41282@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner nosy_count: 19.0 -> 20.0 pull_requests: +24138 pull_request: https://github.com/python/cpython/pull/25405 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 10:00:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 14:00:28 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1618408828.07.0.955468250635.issue41282@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24139 pull_request: https://github.com/python/cpython/pull/25406 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 10:06:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 14:06:08 +0000 Subject: [issue43840] [easy] test_distutils logs 3 DeprecationWarning warnings In-Reply-To: <1618398377.82.0.479453704615.issue43840@roundup.psfhosted.org> Message-ID: <1618409168.86.0.217449230133.issue43840@roundup.psfhosted.org> STINNER Victor added the comment: Ok, let's reuse bpo-41282. I created PR 25405 and PR 25406. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Deprecate and remove distutils _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 10:08:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 14:08:17 +0000 Subject: [issue43426] test_importlib.test_windows emits deprecation warning over usage of distutils In-Reply-To: <1615093866.16.0.242132753657.issue43426@roundup.psfhosted.org> Message-ID: <1618409297.9.0.89203120265.issue43426@roundup.psfhosted.org> STINNER Victor added the comment: It should be fixed by: commit 1899087b21119c5c64cd41619b542c0bf0ab5751 Author: Brett Cannon Date: Fri Mar 26 11:55:07 2021 -0700 bpo-42136: Deprecate module_repr() as found in importlib (GH-25022) ---------- nosy: +vstinner resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 10:10:45 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Apr 2021 14:10:45 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618409445.38.0.0338265733728.issue38530@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 5bf8bf2267cd109970b2d946d43b2e9f71379ba2 by Pablo Galindo in branch 'master': bpo-38530: Offer suggestions on NameError (GH-25397) https://github.com/python/cpython/commit/5bf8bf2267cd109970b2d946d43b2e9f71379ba2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 10:38:37 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 14 Apr 2021 14:38:37 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1618411117.67.0.438736397347.issue43795@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 92eebf6dd20c541ca5883d010a575fb6ea4a245c by Petr Viktorin in branch 'master': bpo-43795: Sort PC/python3dll.c (GH-25312) https://github.com/python/cpython/commit/92eebf6dd20c541ca5883d010a575fb6ea4a245c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 10:39:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 14:39:06 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1618411146.15.0.517953386582.issue41282@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d9ba9dee7f267a603394b8d63a7697b08efdf1cb by Victor Stinner in branch 'master': bpo-41282: setup.py ignores distutils DeprecationWarning (GH-25405) https://github.com/python/cpython/commit/d9ba9dee7f267a603394b8d63a7697b08efdf1cb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 10:47:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 14 Apr 2021 14:47:21 +0000 Subject: [issue43844] [easy] test_lib2to3 logs a PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+ In-Reply-To: <1618400337.77.0.971562000748.issue43844@roundup.psfhosted.org> Message-ID: <1618411641.88.0.818979636285.issue43844@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +24140 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25407 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 10:49:02 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 14 Apr 2021 14:49:02 +0000 Subject: [issue43505] [sqlite3] Explicitly initialise and shut down sqlite3 In-Reply-To: <1615849784.81.0.125050267571.issue43505@roundup.psfhosted.org> Message-ID: <1618411742.28.0.741352148552.issue43505@roundup.psfhosted.org> Berker Peksag added the comment: Making SQLITE_OMIT_AUTOINIT the default behavior would pretty much break every application that use SQLite, but since the PR is small enough and uses the interface in the correct way, I don't see a strong reason to reject it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 10:50:24 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 14 Apr 2021 14:50:24 +0000 Subject: [issue43505] [sqlite3] Explicitly initialise and shut down sqlite3 In-Reply-To: <1615849784.81.0.125050267571.issue43505@roundup.psfhosted.org> Message-ID: <1618411824.44.0.288153904999.issue43505@roundup.psfhosted.org> Berker Peksag added the comment: New changeset def919342facf7f53a3a5f0e9f4b1889d323956d by Erlend Egeberg Aasland in branch 'master': bpo-43505: Explicitly initialize and shutdown sqlite3 (GH-25404) https://github.com/python/cpython/commit/def919342facf7f53a3a5f0e9f4b1889d323956d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 10:51:02 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 14 Apr 2021 14:51:02 +0000 Subject: [issue43505] [sqlite3] Explicitly initialise and shut down sqlite3 In-Reply-To: <1615849784.81.0.125050267571.issue43505@roundup.psfhosted.org> Message-ID: <1618411862.93.0.578829518448.issue43505@roundup.psfhosted.org> Change by Berker Peksag : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 11:00:17 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 14 Apr 2021 15:00:17 +0000 Subject: [issue43505] [sqlite3] Explicitly initialise and shut down sqlite3 In-Reply-To: <1615849784.81.0.125050267571.issue43505@roundup.psfhosted.org> Message-ID: <1618412417.1.0.217636062392.issue43505@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > Making SQLITE_OMIT_AUTOINIT the default behavior would pretty much break every application that use SQLite [...] Yeah, I know, _but_ if some user decides use a SQLite library compiled with SQLITE_OMIT_AUTOINIT (because it is mentioned in the "Recommended Compile-time Optinos"[1]), Python 3.10 won't break :) [1] https://sqlite.org/compile.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 11:00:20 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 14 Apr 2021 15:00:20 +0000 Subject: [issue43836] range.index doesn't support start/stop optional arguments In-Reply-To: <1618373506.04.0.457958304296.issue43836@roundup.psfhosted.org> Message-ID: <1618412420.65.0.46323664422.issue43836@roundup.psfhosted.org> Mark Dickinson added the comment: Duplicate of #28197? ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 11:01:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Apr 2021 15:01:17 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618412477.98.0.915147648581.issue38530@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24141 pull_request: https://github.com/python/cpython/pull/25408 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 11:03:48 2021 From: report at bugs.python.org (Florian Bruhin) Date: Wed, 14 Apr 2021 15:03:48 +0000 Subject: [issue43798] Add position metadata to alias AST type In-Reply-To: <1618000136.49.0.849749645286.issue43798@roundup.psfhosted.org> Message-ID: <1618412628.08.0.73701405881.issue43798@roundup.psfhosted.org> Change by Florian Bruhin : ---------- nosy: +The Compiler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 11:12:38 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 14 Apr 2021 15:12:38 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1618413158.71.0.621423455163.issue41282@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 341e8a939aca6e9f59ffb0e6daee5888933694ed by Lum?r 'Frenzy' Balhar in branch 'master': bpo-41282: (PEP 632) Load install schemes from sysconfig (GH-24549) https://github.com/python/cpython/commit/341e8a939aca6e9f59ffb0e6daee5888933694ed ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 11:26:22 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 14 Apr 2021 15:26:22 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.4 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1618413982.49.0.640212812192.issue43492@roundup.psfhosted.org> Shreyan Avigyan added the comment: As @steve.dower mentioned that maybe the SQLite team is busy fixing bugs and implementing features in SQLite 3.35. But @erlendaasland, https://sqlite.org/forum/forumpost/d36426225c?t=h has a question related to SQLite 3.35.5 but there was no reply or confirmation from the SQLite team. There maybe a direct SQLite 3.36.0 instead of 3.35.5. Moreover if n o bugs are found in the upcoming SQLite 3.35 release I think it's time to implement that version of SQLite to work with python/cpython or it'll be too late and SQLite 3.36 may be released. ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 12:31:35 2021 From: report at bugs.python.org (Kaleb Barrett) Date: Wed, 14 Apr 2021 16:31:35 +0000 Subject: [issue43836] range.index doesn't support start/stop optional arguments In-Reply-To: <1618373506.04.0.457958304296.issue43836@roundup.psfhosted.org> Message-ID: <1618417895.73.0.86130405573.issue43836@roundup.psfhosted.org> Kaleb Barrett added the comment: And so it is... There is also a PR open with a solution from 2017. https://github.com/python/cpython/pull/4378/files. Can this get reviewed? The rationalizations against solving this bug stated in the original issue are weak, range.index *is* useful. I use range objects to describe alternate indexing schemes for an array type (to model HDL datatypes that allow arbitrary indexing schemes). range.index is used to translate user supplied indexes into 0-based indexes to index into a parallel list with the array values. https://github.com/cocotb/cocotb/pull/2510/files#diff-62a4545e5bbb9291f2bdb820609b2d68c69cbafe64faea83beb380d01c02fb5aR315-R319 Additionally, this causes issues with mypy. If you subclass Sequence, mypy will complain if you don't have the optional start and stop arguments in the index method. I would need to feed them into a range object in my implementation. I guess in my case I'm expected to just reject them? This breaks substitutability in my class. It also breaks substitutability with list, tuples, every built-in Sequence type as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 13:41:40 2021 From: report at bugs.python.org (William Woodruff) Date: Wed, 14 Apr 2021 17:41:40 +0000 Subject: [issue15795] Zipfile.extractall does not preserve file permissions In-Reply-To: <1346106964.12.0.723201722432.issue15795@psf.upfronthosting.co.za> Message-ID: <1618422100.33.0.470367452256.issue15795@roundup.psfhosted.org> Change by William Woodruff : ---------- nosy: +yossarian _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 13:58:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Apr 2021 17:58:36 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618423116.23.0.432796220624.issue38530@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset e07f4ab26aaf08f90ebd9e6004af14fd6ef39351 by Pablo Galindo in branch 'master': bpo-38530: Make sure that failing to generate suggestions on failure will not propagate exceptions (GH-25408) https://github.com/python/cpython/commit/e07f4ab26aaf08f90ebd9e6004af14fd6ef39351 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 14:02:32 2021 From: report at bugs.python.org (Ammar Askar) Date: Wed, 14 Apr 2021 18:02:32 +0000 Subject: [issue43836] range.index doesn't support start/stop optional arguments In-Reply-To: <1618373506.04.0.457958304296.issue43836@roundup.psfhosted.org> Message-ID: <1618423352.9.0.949160386572.issue43836@roundup.psfhosted.org> Ammar Askar added the comment: Marked as a duplicate. Kaleb, would you mind posting your comment on the original bug #28197? ---------- nosy: +ammar2 resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Add start and stop parameters to the range.index() ABC method _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 14:06:12 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 14 Apr 2021 18:06:12 +0000 Subject: [issue28197] Add start and stop parameters to the range.index() ABC method In-Reply-To: <1474231832.91.0.157673750963.issue28197@psf.upfronthosting.co.za> Message-ID: <1618423572.29.0.128700370919.issue28197@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 14:15:24 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 14 Apr 2021 18:15:24 +0000 Subject: [issue40407] Zipfile couldn`t recognized character set rightly. In-Reply-To: <1588000678.57.0.461120883839.issue40407@roundup.psfhosted.org> Message-ID: <1618424124.29.0.968021177345.issue40407@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +alanmcintyre, serhiy.storchaka, twouters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 14:29:22 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 14 Apr 2021 18:29:22 +0000 Subject: [issue43583] make test failures, 2 tests failed: test_embed test_tabnanny In-Reply-To: <1616341139.4.0.592020830762.issue43583@roundup.psfhosted.org> Message-ID: <1618424962.24.0.214371824552.issue43583@roundup.psfhosted.org> Irit Katriel added the comment: As Victor suggested in https://bugs.python.org/issue43001#msg386820: Try to run directly the two failing tests in verbose mode, copy/paste the output into a file and attach the file here: python -m test test_embed test_tabnanny -v ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 14:30:43 2021 From: report at bugs.python.org (Joachim) Date: Wed, 14 Apr 2021 18:30:43 +0000 Subject: [issue43848] gzip.py: explain optional argument mtime Message-ID: <1618425043.16.0.353574460502.issue43848@roundup.psfhosted.org> New submission from Joachim : Explain the data type of optional argument mtime: seconds since the epoch. As an alternative to mtime = None, recommend mtime = 0 for generating deterministic streams. ---------- assignee: docs at python components: Documentation messages: 391093 nosy: docs at python, j5w6 priority: normal severity: normal status: open title: gzip.py: explain optional argument mtime versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 14:38:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 14 Apr 2021 18:38:57 +0000 Subject: [issue43252] deepcopy of weakref proxies In-Reply-To: <1613650741.99.0.0896392354865.issue43252@roundup.psfhosted.org> Message-ID: <1618425537.82.0.477663516356.issue43252@roundup.psfhosted.org> Irit Katriel added the comment: If you deep-copy the referents, what would hold a reference to them? Wouldn't the new objects be immediately GCed? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 14:42:02 2021 From: report at bugs.python.org (Michael Curran) Date: Wed, 14 Apr 2021 18:42:02 +0000 Subject: [issue38748] 32 bit ctypes stdcall callback fails to restore stack pointer In-Reply-To: <1573232254.38.0.286098798289.issue38748@roundup.psfhosted.org> Message-ID: <1618425722.76.0.63005453469.issue38748@roundup.psfhosted.org> Michael Curran added the comment: I can also reproduce this. I will attach my own testcase below. So far I see it when the callback is __stdcall (WINFUNCTYPE) and it takes an larger than 4 bytes (E.g. a long long or a VARIANT), with one or more arguments preceeding it such that this argument is not aligned on a multiple of 8 bytes. For example arguments can be: * long, long long * long, long, long, long long But the corruption does not occur with something like: * long, long, long long My testcase uses long, long long to show the crash. ---------- nosy: +michaeldcurran Added file: https://bugs.python.org/file49959/py3.8crash.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 14:46:52 2021 From: report at bugs.python.org (Joachim) Date: Wed, 14 Apr 2021 18:46:52 +0000 Subject: [issue43848] gzip.py: explain optional argument mtime In-Reply-To: <1618425043.16.0.353574460502.issue43848@roundup.psfhosted.org> Message-ID: <1618426012.79.0.843470203356.issue43848@roundup.psfhosted.org> Change by Joachim : ---------- keywords: +patch pull_requests: +24142 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25410 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 14:47:57 2021 From: report at bugs.python.org (Michael Curran) Date: Wed, 14 Apr 2021 18:47:57 +0000 Subject: [issue38748] 32 bit ctypes stdcall callback fails to restore stack pointer In-Reply-To: <1573232254.38.0.286098798289.issue38748@roundup.psfhosted.org> Message-ID: <1618426077.31.0.884148159878.issue38748@roundup.psfhosted.org> Michael Curran added the comment: This bug is reproduceable on both Python 3.8 and 3.9. But not 3.7. Ths bug is seen in the real world, in the context of providing Python callbacks to Win32 API functions, or when implementing comtypes COM objects in Python. For example, we see this crash in the NVDA screen reader project, in our implementation of ITTSBufNotifySink from the Microsoft SAPI4 speech API. ITTSBufNotifySink::TextDataStarted takes a pointer (this), and a long long (qTimestamp). https://github.com/nvaccess/nvda/issues/12152 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 16:45:49 2021 From: report at bugs.python.org (Brett Cannon) Date: Wed, 14 Apr 2021 20:45:49 +0000 Subject: [issue37741] importlib.metadata docs not showing up in the module index In-Reply-To: <1564685225.86.0.948746560612.issue37741@roundup.psfhosted.org> Message-ID: <1618433149.95.0.958691490241.issue37741@roundup.psfhosted.org> Brett Cannon added the comment: Are you still planning to fix this, Barry? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 16:52:07 2021 From: report at bugs.python.org (John) Date: Wed, 14 Apr 2021 20:52:07 +0000 Subject: [issue43849] Typo in calendar doc Message-ID: <1618433527.59.0.488396025411.issue43849@roundup.psfhosted.org> New submission from John : I believe the parenthesis in calendar.firstweekday() should be removed. As it is, it produces 'int' cannot be called. ---------- assignee: docs at python components: Documentation messages: 391098 nosy: JohnCC330, docs at python priority: normal severity: normal status: open title: Typo in calendar doc versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 16:58:01 2021 From: report at bugs.python.org (John) Date: Wed, 14 Apr 2021 20:58:01 +0000 Subject: [issue43849] Typo in calendar doc In-Reply-To: <1618433527.59.0.488396025411.issue43849@roundup.psfhosted.org> Message-ID: <1618433881.03.0.520836527389.issue43849@roundup.psfhosted.org> John added the comment: Sorry for the noise. My confusion. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 17:09:30 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 14 Apr 2021 21:09:30 +0000 Subject: [issue43296] [sqlite3] Fix sqlite3_value_blob() usage In-Reply-To: <1614004633.85.0.0676920983033.issue43296@roundup.psfhosted.org> Message-ID: <1618434570.89.0.441496358776.issue43296@roundup.psfhosted.org> Change by Berker Peksag : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 17:09:41 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 14 Apr 2021 21:09:41 +0000 Subject: [issue43296] [sqlite3] Fix sqlite3_value_blob() usage In-Reply-To: <1614004633.85.0.0676920983033.issue43296@roundup.psfhosted.org> Message-ID: <1618434581.16.0.607807193625.issue43296@roundup.psfhosted.org> Berker Peksag added the comment: New changeset 5cb601f956886b32641f818b5da347cc86a43db2 by Erlend Egeberg Aasland in branch 'master': bpo-43296: Handle sqlite3_value_blob() errors (GH-24674) https://github.com/python/cpython/commit/5cb601f956886b32641f818b5da347cc86a43db2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 17:15:00 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 14 Apr 2021 21:15:00 +0000 Subject: [issue43296] [sqlite3] Fix sqlite3_value_blob() usage In-Reply-To: <1614004633.85.0.0676920983033.issue43296@roundup.psfhosted.org> Message-ID: <1618434900.46.0.102344051599.issue43296@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Thanks, Berker! I'll add separate issues for sqlite3_value_text() and the missing PyTuple_SetItem() error checks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 17:25:18 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 14 Apr 2021 21:25:18 +0000 Subject: [issue37741] importlib.metadata docs not showing up in the module index In-Reply-To: <1564685225.86.0.948746560612.issue37741@roundup.psfhosted.org> Message-ID: <1618435518.93.0.98575278767.issue37741@roundup.psfhosted.org> Barry A. Warsaw added the comment: I'd still like to. I'm also happy to review any PRs if someone beats me to it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 18:02:39 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 14 Apr 2021 22:02:39 +0000 Subject: [issue32935] Documentation falsely leads to believe that MemoryHandler can be used to wrap SMTPHandler to send multiple messages per email In-Reply-To: <1519468279.94.0.467229070634.issue32935@psf.upfronthosting.co.za> Message-ID: <1618437759.15.0.445983270004.issue32935@roundup.psfhosted.org> Irit Katriel added the comment: The documentation does talk about emit() operating on single records: https://docs.python.org/3/library/logging.handlers.html#logging.handlers.BufferingHandler.emit How would you make this clearer? ---------- nosy: +iritkatriel versions: +Python 3.10 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 18:31:26 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Wed, 14 Apr 2021 22:31:26 +0000 Subject: [issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode Message-ID: <1618439486.71.0.574977757021.issue43850@roundup.psfhosted.org> New submission from Filipe La?ns : Currently, the order of set or frozenset elements when saved to bytecode is dependent on the random seed. This breaks reproducibility. Example fail from an Arch Linux package: https://reproducible.archlinux.org/api/v0/builds/88454/diffoscope Let's take an example file, `test_compile.py` ```python s = { 'aaa', 'bbb', 'ccc', 'ddd', 'eee', } ``` $ PYTHONHASHSEED=0 python -m compileall --invalidation-mode checked-hash test_compile.py $ mv __pycache__ __pycache__1 $ PYTHONHASHSEED=1 python -m compileall --invalidation-mode checked-hash test_compile.py $ diff __pycache__/test_compile.cpython-39.pyc __pycache__1/test_compile.cpython-39.pyc Binary files __pycache__/test_compile.cpython-39.pyc and __pycache__1/test_compile.cpython-39.pyc differ $ diff <(xxd __pycache__/test_compile.cpython-39.pyc) <(xxd __pycache__1/test_compile.cpython-39.pyc) 5,6c5,6 < 00000040: 005a 0362 6262 5a03 6464 645a 0361 6161 .Z.bbbZ.dddZ.aaa < 00000050: 5a03 6363 635a 0365 6565 4e29 01da 0173 Z.cccZ.eeeN)...s --- > 00000040: 005a 0361 6161 5a03 6363 635a 0364 6464 .Z.aaaZ.cccZ.ddd > 00000050: 5a03 6565 655a 0362 6262 4e29 01da 0173 Z.eeeZ.bbbN)...s I believe the issue is in the marshall module. Particularly, this line[1]. My simple fix was to create a list from the set, sort it, and iterate over it instead. [1] https://github.com/python/cpython/blob/00d7abd7ef588fc4ff0571c8579ab4aba8ada1c0/Python/marshal.c#L505 ---------- messages: 391104 nosy: FFY00, Mark.Shannon, benjamin.peterson, yselivanov priority: normal severity: normal status: open title: unreproducible bytecode: set order depends on random seed for compiled bytecode type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 18:32:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 14 Apr 2021 22:32:01 +0000 Subject: [issue40804] Bug report in python3.6.8 using argparse module In-Reply-To: <1590660145.62.0.878153960448.issue40804@roundup.psfhosted.org> Message-ID: <1618439521.5.0.967558800064.issue40804@roundup.psfhosted.org> Irit Katriel added the comment: amansi26, I am closing this because you did not reply to the request for more information for almost a year. Also, the link in your comment is not working anymore. If you are still having a problem with argparse, please open a new issue for it and include code that demonstrates the problem. There is some documentation on bug reporting that might be helpful: https://docs.python.org/3/bugs.html#using-the-python-issue-tracker ---------- nosy: +iritkatriel resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 18:35:00 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Wed, 14 Apr 2021 22:35:00 +0000 Subject: [issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode In-Reply-To: <1618439486.71.0.574977757021.issue43850@roundup.psfhosted.org> Message-ID: <1618439700.46.0.513730513683.issue43850@roundup.psfhosted.org> Change by Filipe La?ns : ---------- keywords: +patch pull_requests: +24143 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25411 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 18:39:31 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Wed, 14 Apr 2021 22:39:31 +0000 Subject: [issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode In-Reply-To: <1618439486.71.0.574977757021.issue43850@roundup.psfhosted.org> Message-ID: <1618439971.47.0.924961237249.issue43850@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 18:39:46 2021 From: report at bugs.python.org (Aidan Feldman) Date: Wed, 14 Apr 2021 22:39:46 +0000 Subject: [issue43837] Operator precedence documentation could be more clear In-Reply-To: <1618375085.85.0.211628673766.issue43837@roundup.psfhosted.org> Message-ID: <1618439986.62.0.130847146193.issue43837@roundup.psfhosted.org> Aidan Feldman added the comment: Let me try and say a simpler way: I think "variables" should be mentioned in that section, either in the table or the paragraph above. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 18:42:18 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Apr 2021 22:42:18 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618440138.76.0.80933960673.issue38530@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24144 pull_request: https://github.com/python/cpython/pull/25412 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 18:55:20 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 14 Apr 2021 22:55:20 +0000 Subject: [issue43837] Operator precedence documentation could be more clear In-Reply-To: <1618375085.85.0.211628673766.issue43837@roundup.psfhosted.org> Message-ID: <1618440920.21.0.22767716191.issue43837@roundup.psfhosted.org> Zachary Ware added the comment: I think it might be easiest to see your suggestion as a pull request :) ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 19:03:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Apr 2021 23:03:50 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618441430.39.0.0535958573555.issue38530@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 3fc65b97d09fd29272fdf60d2e567bfb070da824 by Pablo Galindo in branch 'master': bpo-38530: Optimize the calculation of string sizes when offering suggestions (GH-25412) https://github.com/python/cpython/commit/3fc65b97d09fd29272fdf60d2e567bfb070da824 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 19:16:08 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 14 Apr 2021 23:16:08 +0000 Subject: [issue43851] Optimise SQLite builds on macOS and Windows Message-ID: <1618442168.97.0.98960637018.issue43851@roundup.psfhosted.org> New submission from Erlend Egeberg Aasland : We should apply some of the recommended "optimisation" compile-time options[1] to the SQLite builds for the macOS and Windows installers. The following options should be safe to apply: - SQLITE_DEFAULT_MEMSTATUS=0 - SQLITE_LIKE_DOESNT_MATCH_BLOBS - SQLITE_MAX_EXPR_DEPTH=0 - SQLITE_OMIT_DEPRECATED - SQLITE_OMIT_AUTOINIT I'm not sure about SQLITE_DEFAULT_WAL_SYNCHRONOUS=1. Quoting the SQLite docs: "So these options do not make a huge difference. But in some design situations, every little bit helps." [1] https://sqlite.org/compile.html ---------- components: Windows, macOS messages: 391109 nosy: erlendaasland, ned.deily, paul.moore, ronaldoussoren, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Optimise SQLite builds on macOS and Windows type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 19:17:02 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 14 Apr 2021 23:17:02 +0000 Subject: [issue43851] Optimise SQLite builds on macOS and Windows In-Reply-To: <1618442168.97.0.98960637018.issue43851@roundup.psfhosted.org> Message-ID: <1618442222.72.0.307601916319.issue43851@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: BTW, is SQLITE_WITHOUT_ZONEMALLOC still needed for macOS? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 19:25:33 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 14 Apr 2021 23:25:33 +0000 Subject: [issue43851] Optimise SQLite builds on macOS and Windows In-Reply-To: <1618442168.97.0.98960637018.issue43851@roundup.psfhosted.org> Message-ID: <1618442733.81.0.127805634458.issue43851@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch pull_requests: +24145 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25413 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 19:26:03 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 14 Apr 2021 23:26:03 +0000 Subject: [issue43851] Optimise SQLite builds on macOS and Windows In-Reply-To: <1618442168.97.0.98960637018.issue43851@roundup.psfhosted.org> Message-ID: <1618442763.78.0.326243714007.issue43851@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24146 pull_request: https://github.com/python/cpython/pull/25414 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 19:29:08 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 14 Apr 2021 23:29:08 +0000 Subject: [issue37741] importlib.metadata docs not showing up in the module index In-Reply-To: <1564685225.86.0.948746560612.issue37741@roundup.psfhosted.org> Message-ID: <1618442948.18.0.266082059911.issue37741@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +24147 pull_request: https://github.com/python/cpython/pull/25415 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 19:30:21 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Wed, 14 Apr 2021 23:30:21 +0000 Subject: [issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode In-Reply-To: <1618439486.71.0.574977757021.issue43850@roundup.psfhosted.org> Message-ID: <1618443021.41.0.583495549337.issue43850@roundup.psfhosted.org> Filipe La?ns added the comment: I just realized my fix is wrong because list.sort does not handle different types. Similarly to other reproducibility fixes, how does skipping the item randomization when SOURCE_DATE_EPOCH is set sound? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 19:31:18 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 14 Apr 2021 23:31:18 +0000 Subject: [issue43820] Remove namespace copy from dataclasses.make_dataclass() In-Reply-To: <1618261930.36.0.318460450157.issue43820@roundup.psfhosted.org> Message-ID: <1618443078.16.0.759874668283.issue43820@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 19:32:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Apr 2021 23:32:49 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618443169.06.0.299750500022.issue38530@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 19:42:46 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Wed, 14 Apr 2021 23:42:46 +0000 Subject: [issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode In-Reply-To: <1618439486.71.0.574977757021.issue43850@roundup.psfhosted.org> Message-ID: <1618443766.1.0.88946536315.issue43850@roundup.psfhosted.org> Filipe La?ns added the comment: Nevermind, AFAIK that depends on the hash seed, correct? So, the most viable option to me would be a sorting algorithm that could take type into account. Would that be an acceptable solution? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 19:43:40 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 14 Apr 2021 23:43:40 +0000 Subject: [issue43835] Dataclasses don't call base class __init__ In-Reply-To: <1618352500.63.0.0280826468162.issue43835@roundup.psfhosted.org> Message-ID: <1618443820.16.0.902852426797.issue43835@roundup.psfhosted.org> Change by Eric V. Smith : ---------- assignee: -> eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 20:18:50 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 15 Apr 2021 00:18:50 +0000 Subject: [issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode In-Reply-To: <1618439486.71.0.574977757021.issue43850@roundup.psfhosted.org> Message-ID: <1618445930.55.0.208475743503.issue43850@roundup.psfhosted.org> Filipe La?ns added the comment: Sorry for the spam, I am trying to figure out the best option here, which is hard to do by myself. IMO it would be reasonable to create set objects with elements in the order they appear in the code, instead of based on the hash. I am not really sure where is the code responsible for this, and if there are any limitations preventing this from being implemented. So, my question are: Would you consider this reasonable? Is there anything I am missing? If there are no issues, could someone point me to the target code? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 20:33:16 2021 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 15 Apr 2021 00:33:16 +0000 Subject: [issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode In-Reply-To: <1618439486.71.0.574977757021.issue43850@roundup.psfhosted.org> Message-ID: <1618446796.35.0.397761121916.issue43850@roundup.psfhosted.org> Benjamin Peterson added the comment: Let's keep any discussion on the pre?xisting issue for this. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> support reproducible Python builds _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 20:56:51 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Apr 2021 00:56:51 +0000 Subject: [issue37741] importlib.metadata docs not showing up in the module index In-Reply-To: <1564685225.86.0.948746560612.issue37741@roundup.psfhosted.org> Message-ID: <1618448211.27.0.533927170391.issue37741@roundup.psfhosted.org> miss-islington added the comment: New changeset 23acadcc1c75eb74b2459304af70d97a35001b34 by Jason R. Coombs in branch 'master': bpo-37741: make importlib.metadata docs discoverable through a module directive. (GH-25415) https://github.com/python/cpython/commit/23acadcc1c75eb74b2459304af70d97a35001b34 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 20:57:52 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Apr 2021 00:57:52 +0000 Subject: [issue37741] importlib.metadata docs not showing up in the module index In-Reply-To: <1564685225.86.0.948746560612.issue37741@roundup.psfhosted.org> Message-ID: <1618448272.79.0.999800421494.issue37741@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24148 pull_request: https://github.com/python/cpython/pull/25417 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 20:58:09 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Apr 2021 00:58:09 +0000 Subject: [issue37741] importlib.metadata docs not showing up in the module index In-Reply-To: <1564685225.86.0.948746560612.issue37741@roundup.psfhosted.org> Message-ID: <1618448289.08.0.143570450604.issue37741@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24149 pull_request: https://github.com/python/cpython/pull/25418 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 20:59:56 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 15 Apr 2021 00:59:56 +0000 Subject: [issue37741] importlib.metadata docs not showing up in the module index In-Reply-To: <1564685225.86.0.948746560612.issue37741@roundup.psfhosted.org> Message-ID: <1618448396.07.0.720176369446.issue37741@roundup.psfhosted.org> Barry A. Warsaw added the comment: @jaraco beat me to it. PRs approved! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 21:08:24 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Apr 2021 01:08:24 +0000 Subject: [issue37741] importlib.metadata docs not showing up in the module index In-Reply-To: <1564685225.86.0.948746560612.issue37741@roundup.psfhosted.org> Message-ID: <1618448904.43.0.607326987741.issue37741@roundup.psfhosted.org> miss-islington added the comment: New changeset a746fceb7548e92f58037d9f90b5468bdc76889d by Miss Islington (bot) in branch '3.8': bpo-37741: make importlib.metadata docs discoverable through a module directive. (GH-25415) https://github.com/python/cpython/commit/a746fceb7548e92f58037d9f90b5468bdc76889d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 21:17:16 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 15 Apr 2021 01:17:16 +0000 Subject: [issue41323] Perform "peephole" optimization directly on control-flow graph. In-Reply-To: <1594981622.83.0.602836344044.issue41323@roundup.psfhosted.org> Message-ID: <1618449436.87.0.640960626659.issue41323@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +methane nosy_count: 4.0 -> 5.0 pull_requests: +24150 pull_request: https://github.com/python/cpython/pull/25419 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 14 22:38:55 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 15 Apr 2021 02:38:55 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1618454335.73.0.103137702804.issue37596@roundup.psfhosted.org> Filipe La?ns added the comment: Normal sets have the same issue, see bpo-43850. Would it be reasonable to make it so that sets are always created with the definition order? Looking at the set implementation, this seems perfectly possible. ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 02:36:36 2021 From: report at bugs.python.org (Takuya N) Date: Thu, 15 Apr 2021 06:36:36 +0000 Subject: [issue38634] Symbol resolution conflict when embeding python in an application using libedit In-Reply-To: <1572362225.21.0.644355885677.issue38634@roundup.psfhosted.org> Message-ID: <1618468596.73.0.422446258463.issue38634@roundup.psfhosted.org> Change by Takuya N : ---------- nosy: +tnir nosy_count: 7.0 -> 8.0 pull_requests: +24152 pull_request: https://github.com/python/cpython/pull/25420 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 02:36:36 2021 From: report at bugs.python.org (Takuya N) Date: Thu, 15 Apr 2021 06:36:36 +0000 Subject: [issue13501] Make libedit support more generic; port readline / libedit to FreeBSD In-Reply-To: <1322579942.3.0.601983912656.issue13501@psf.upfronthosting.co.za> Message-ID: <1618468596.55.0.558926523589.issue13501@roundup.psfhosted.org> Change by Takuya N : ---------- nosy: +tnir nosy_count: 15.0 -> 16.0 pull_requests: +24151 pull_request: https://github.com/python/cpython/pull/25420 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 02:49:19 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 15 Apr 2021 06:49:19 +0000 Subject: [issue43851] Optimise SQLite builds on macOS and Windows In-Reply-To: <1618442168.97.0.98960637018.issue43851@roundup.psfhosted.org> Message-ID: <1618469359.84.0.29597399887.issue43851@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 03:15:50 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 15 Apr 2021 07:15:50 +0000 Subject: [issue43847] [Windows] ntpath.realpath() of bytes root directory may raise TypeError in some cases In-Reply-To: <1618404662.92.0.914724176997.issue43847@roundup.psfhosted.org> Message-ID: <1618470950.91.0.73100161618.issue43847@roundup.psfhosted.org> Eryk Sun added the comment: In ntpath._getfinalpathname_nonstrict(), `tail` should be initialized to `path[:0]`. Currently `tail` is initialized to the empty string value ''. If an error occurs that's allowed and `path` is a root directory that's passed as bytes, then joining `path + tail` will fail if `tail` still has its initial value. To reproduce this issue, create a substitute drive for a directory that grants no access. For example: import os os.mkdir('spam') os.system('icacls spam /inheritance:r') os.system('subst N: spam') >>> os.path.realpath(b'N:/') Traceback (most recent call last): File "C:\Program Files\Python39\lib\ntpath.py", line 647, in realpath path = _getfinalpathname(path) PermissionError: [WinError 5] Access is denied: b'N:\\' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Program Files\Python39\lib\ntpath.py", line 601, in _getfinalpathname_nonstrict path = _getfinalpathname(path) PermissionError: [WinError 5] Access is denied: b'N:\\' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "C:\Program Files\Python39\lib\ntpath.py", line 651, in realpath path = _getfinalpathname_nonstrict(path) File "C:\Program Files\Python39\lib\ntpath.py", line 621, in _getfinalpathname_nonstrict return path + tail TypeError: can't concat str to bytes ---------- components: +Library (Lib) nosy: +Antoine d'Otreppe, eryksun -9001 stage: -> needs patch title: realpath of bytestr smb drive letters fail -> [Windows] ntpath.realpath() of bytes root directory may raise TypeError in some cases versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 04:25:30 2021 From: report at bugs.python.org (Jakub Kulik) Date: Thu, 15 Apr 2021 08:25:30 +0000 Subject: [issue43498] "dictionary changed size during iteration" error in _ExecutorManagerThread In-Reply-To: <1615796616.26.0.51182574064.issue43498@roundup.psfhosted.org> Message-ID: <1618475130.4.0.00265762802421.issue43498@roundup.psfhosted.org> Jakub Kulik added the comment: I investigated a little bit more and found out that this happens when `ProcessPoolExecutor::_adjust_process_count()` adds a new process during the iteration. With the following change, I can reproduce this reliably every time: --- Python-3.9.1/Lib/concurrent/futures/process.py +++ Python-3.9.1/Lib/concurrent/futures/process.py @@ -373,7 +373,14 @@ class _ExecutorManagerThread(threading.T assert not self.thread_wakeup._closed wakeup_reader = self.thread_wakeup._reader readers = [result_reader, wakeup_reader] - worker_sentinels = [p.sentinel for p in self.processes.values()] + worker_sentinels = [] + for p in self.processes.values(): + time.sleep(1) + worker_sentinels.append(p.sentinel) ready = mp.connection.wait(readers + worker_sentinels) cause = None Since `wait_result_broken_or_wakeup()` is called periodically, and there is no issue if processes added during the iteration are omitted (if they were added just after that, they would be omitted anyway), the attached PR shouldn't break anything. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 04:26:12 2021 From: report at bugs.python.org (Konrad Schwarz) Date: Thu, 15 Apr 2021 08:26:12 +0000 Subject: [issue43252] deepcopy of weakref proxies In-Reply-To: <1613650741.99.0.0896392354865.issue43252@roundup.psfhosted.org> Message-ID: <1618475172.13.0.972909022474.issue43252@roundup.psfhosted.org> Konrad Schwarz added the comment: Well, in the example code, the memo dictionary contains the (hard) reference to newly created objects but ultimately, at the close of the deepcopy, the objects are (hard) referenced using the normal "child" attributes. I don't however know how this would work if this was implemented within the weakref code but I expect that their __deepcopy__ method also has access to the memo variable. If, at the close of deepcopy and the destruction of memo, no (hard) references exist to an object, then it would be collected, but that matches standard weak reference semantics. Even if it were not possible to solve this programmatically within Python, I think the problem (and e.g. the workaround given below) should be mentioned in the documentation of deepcopy and/or weakref. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 05:23:35 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 15 Apr 2021 09:23:35 +0000 Subject: [issue43852] [sqlite3] Harden tuple creation Message-ID: <1618478615.92.0.752682980963.issue43852@roundup.psfhosted.org> New submission from Erlend Egeberg Aasland : All but one of the PyTuple_SetItem() calls are executed without checking the return value. Callers: $ grep -r PyTuple_SetItem Modules/_sqlite Modules/_sqlite/connection.c: PyTuple_SetItem(args, i, cur_py_value); Modules/_sqlite/cursor.c: PyTuple_SetItem(row, i, converted); Modules/_sqlite/cursor.c: if (PyTuple_SetItem(func_args, 0, Py_NewRef(operation)) != 0) { Modules/_sqlite/cursor.c: PyTuple_SetItem(descriptor, 0, column_name); Modules/_sqlite/cursor.c: PyTuple_SetItem(descriptor, 1, Py_NewRef(Py_None)); Modules/_sqlite/cursor.c: PyTuple_SetItem(descriptor, 2, Py_NewRef(Py_None)); Modules/_sqlite/cursor.c: PyTuple_SetItem(descriptor, 3, Py_NewRef(Py_None)); Modules/_sqlite/cursor.c: PyTuple_SetItem(descriptor, 4, Py_NewRef(Py_None)); Modules/_sqlite/cursor.c: PyTuple_SetItem(descriptor, 5, Py_NewRef(Py_None)); Modules/_sqlite/cursor.c: PyTuple_SetItem(descriptor, 6, Py_NewRef(Py_None)); Modules/_sqlite/cursor.c: PyTuple_SetItem(self->description, i, descriptor); All of these are operating on newly created tuples, so I suggest replacing them with PyTuple_SET_ITEM() instead of adding error handling. For the users in _pysqlite_query_execute() I also suggest to move the tuple creation closer to the code that fills it, in order to minimise the number of decref's needed in case of error. ---------- components: Extension Modules files: patch.diff keywords: patch messages: 391122 nosy: berker.peksag, erlendaasland, serhiy.storchaka priority: normal severity: normal status: open title: [sqlite3] Harden tuple creation type: behavior versions: Python 3.10 Added file: https://bugs.python.org/file49960/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 05:28:09 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 15 Apr 2021 09:28:09 +0000 Subject: [issue43852] [sqlite3] Harden tuple creation In-Reply-To: <1618478615.92.0.752682980963.issue43852@roundup.psfhosted.org> Message-ID: <1618478889.58.0.602520490412.issue43852@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24153 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25421 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 05:38:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Apr 2021 09:38:01 +0000 Subject: [issue38634] Symbol resolution conflict when embeding python in an application using libedit In-Reply-To: <1572362225.21.0.644355885677.issue38634@roundup.psfhosted.org> Message-ID: <1618479481.68.0.719218600464.issue38634@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 05:44:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Apr 2021 09:44:28 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618479868.3.0.739373750065.issue38530@roundup.psfhosted.org> STINNER Victor added the comment: I like the https://docs.python.org/dev/whatsnew/3.10.html#better-error-messages section: well done, thanks ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 06:00:09 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 15 Apr 2021 10:00:09 +0000 Subject: [issue43853] [sqlite] Fix sqlite3_value_text() usage Message-ID: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> New submission from Erlend Egeberg Aasland : Fix sqlite3_value_text() usage: - Raise MemoryError if sqlite3_value_text() sets SQLITE_NOMEM - Let PyUnicode_FromStringAndSize() errors propagate Quoting the SQLite docs: "As long as the input parameter is correct, these routines can only fail if an out-of-memory error occurs" See also: - bpo-43296 - https://sqlite.org/c3ref/value_blob.html ---------- components: Extension Modules files: patch.diff keywords: patch messages: 391124 nosy: berker.peksag, erlendaasland, serhiy.storchaka priority: normal severity: normal status: open title: [sqlite] Fix sqlite3_value_text() usage type: behavior versions: Python 3.10 Added file: https://bugs.python.org/file49961/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 06:04:10 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 15 Apr 2021 10:04:10 +0000 Subject: [issue43853] [sqlite] Fix sqlite3_value_text() usage In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1618481050.05.0.349258875449.issue43853@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24154 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25422 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 06:04:35 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 15 Apr 2021 10:04:35 +0000 Subject: [issue43853] [sqlite3] Fix sqlite3_value_text() usage In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1618481075.17.0.711356268675.issue43853@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- title: [sqlite] Fix sqlite3_value_text() usage -> [sqlite3] Fix sqlite3_value_text() usage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 06:13:47 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 15 Apr 2021 10:13:47 +0000 Subject: [issue35056] Test leaks of memory not managed by Python allocator In-Reply-To: <1540323419.75.0.788709270274.issue35056@psf.upfronthosting.co.za> Message-ID: <1618481627.69.0.933088289381.issue35056@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Victor, Serhiy: Would this issue be "large" or important enough to re-raise the debate about implementing an msize() function in the PyMem_ API, or is it not worth it? I guess no; it has been discussed numerous times before. Else, I can start a thread on Discourse. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 06:17:59 2021 From: report at bugs.python.org (darrikonn) Date: Thu, 15 Apr 2021 10:17:59 +0000 Subject: [issue43854] curses: returns incorrect chars after resuming a suspended process Message-ID: <1618481879.49.0.746081524149.issue43854@roundup.psfhosted.org> New submission from darrikonn : Using the arrow keys after resuming a suspended process yields `27 (escape)` from `getch`/`get_wch`/... Steps to reproduce: ``` # test.py from curses import wrapper def main(stdscr): # Clear screen stdscr.clear() key = 0 while key != 27: key = stdscr.getch() stdscr.addstr(0, 0, str(key)) stdscr.refresh() wrapper(main) ``` 1. python test.py 2. ctrl-z 3. fg 4. This gives the char `27` which is the escape character and therefore exits the python script. ---------- components: Library (Lib) messages: 391126 nosy: darrikonn priority: normal severity: normal status: open title: curses: returns incorrect chars after resuming a suspended process type: behavior versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 06:35:15 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 15 Apr 2021 10:35:15 +0000 Subject: [issue43852] [sqlite3] Harden tuple creation In-Reply-To: <1618478615.92.0.752682980963.issue43852@roundup.psfhosted.org> Message-ID: <1618482915.87.0.43845379229.issue43852@roundup.psfhosted.org> Mark Dickinson added the comment: Would the code be cleaner if it used PyTuple_Pack? ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 06:38:21 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 15 Apr 2021 10:38:21 +0000 Subject: [issue43852] [sqlite3] Harden tuple creation In-Reply-To: <1618478615.92.0.752682980963.issue43852@roundup.psfhosted.org> Message-ID: <1618483101.23.0.296406274023.issue43852@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Yes, the _pysqlite_query_execute() case might be cleaner. But I was under the impression that using PyTuple_Pack() was significantly slower. Correct me if I'm wrong. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 06:49:10 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 15 Apr 2021 10:49:10 +0000 Subject: [issue43852] [sqlite3] Harden tuple creation In-Reply-To: <1618478615.92.0.752682980963.issue43852@roundup.psfhosted.org> Message-ID: <1618483750.74.0.42041285152.issue43852@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: I've updated my PR to use PyTuple_Pack. Nice reduction in code size. Thanks, Mark! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 08:33:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Apr 2021 12:33:43 +0000 Subject: [issue35056] Test leaks of memory not managed by Python allocator In-Reply-To: <1540323419.75.0.788709270274.issue35056@psf.upfronthosting.co.za> Message-ID: <1618490023.29.0.114822123498.issue35056@roundup.psfhosted.org> STINNER Victor added the comment: Multiple C library don't provide msize() function. If you seriously consider to add it, you should conduct a study on all platforms. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 08:49:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Apr 2021 12:49:57 +0000 Subject: [issue43855] test_ssl: test_msg_callback_deadlock_bpo43577() failed on macOS of GitHub Action Message-ID: <1618490997.04.0.782752491303.issue43855@roundup.psfhosted.org> New submission from STINNER Victor : macOS of GitHub Action failed: https://github.com/python/cpython/pull/25400/checks?check_run_id=2344085246 ERROR: test_msg_callback_deadlock_bpo43577 (test.test_ssl.TestSSLDebug) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 4799, in test_msg_callback_deadlock_bpo43577 s.connect((HOST, server.port)) File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1342, in connect self._real_connect(addr, False) File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1329, in _real_connect super().connect(addr) ConnectionRefusedError: [Errno 61] Connection refused Test code: def test_msg_callback_deadlock_bpo43577(self): client_context, server_context, hostname = testing_context() server_context2 = testing_context()[1] def msg_cb(conn, direction, version, content_type, msg_type, data): pass def sni_cb(sock, servername, ctx): sock.context = server_context2 server_context._msg_callback = msg_cb server_context.sni_callback = sni_cb server = ThreadedEchoServer(context=server_context, chatty=False) with server: with client_context.wrap_socket(socket.socket(), server_hostname=hostname) as s: s.connect((HOST, server.port)) with client_context.wrap_socket(socket.socket(), server_hostname=hostname) as s: s.connect((HOST, server.port)) # <===== FAIL HERE ==== test.pythoninfo: ssl.HAS_SNI: True ssl.OPENSSL_VERSION: OpenSSL 1.1.1k 25 Mar 2021 ssl.OPENSSL_VERSION_INFO: (1, 1, 1, 11, 15) ssl.OP_ALL: 0x80000054 ssl.OP_NO_TLSv1_1: 0x10000000 ssl.SSLContext.maximum_version: MAXIMUM_SUPPORTED ssl.SSLContext.minimum_version: MINIMUM_SUPPORTED ssl.SSLContext.options: OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x80000054 ssl.SSLContext.protocol: PROTOCOL_TLS ssl.SSLContext.verify_mode: CERT_NONE ssl.default_https_context.maximum_version: MAXIMUM_SUPPORTED ssl.default_https_context.minimum_version: MINIMUM_SUPPORTED ssl.default_https_context.options: OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x80000054 ssl.default_https_context.protocol: PROTOCOL_TLS ssl.default_https_context.verify_mode: CERT_REQUIRED ssl.stdlib_context.maximum_version: MAXIMUM_SUPPORTED ssl.stdlib_context.minimum_version: MINIMUM_SUPPORTED ssl.stdlib_context.options: OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x80000054 ssl.stdlib_context.protocol: PROTOCOL_TLS ssl.stdlib_context.verify_mode: CERT_NONE The test was added recently: commit 77cde5042a2f1eae489c11a67540afaf43cd5cdf Author: Christian Heimes Date: Sun Mar 21 16:13:09 2021 +0100 bpo-43577: Fix deadlock with SSLContext._msg_callback and sni_callback (GH-24957) OpenSSL copies the internal message callback from SSL_CTX->msg_callback to SSL->msg_callback. SSL_set_SSL_CTX() does not update SSL->msg_callback to use the callback value of the new context. PySSL_set_context() now resets the callback and _PySSL_msg_callback() resets thread state in error path. Signed-off-by: Christian Heimes ---------- components: Tests messages: 391131 nosy: christian.heimes, vstinner priority: normal severity: normal status: open title: test_ssl: test_msg_callback_deadlock_bpo43577() failed on macOS of GitHub Action versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 08:51:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Apr 2021 12:51:33 +0000 Subject: [issue42124] FAIL test_asyncio test_sendfile_close_peer_in_the_middle_of_receiving In-Reply-To: <1603420467.19.0.337945390908.issue42124@roundup.psfhosted.org> Message-ID: <1618491093.27.0.686358010731.issue42124@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch nosy: +vstinner nosy_count: 3.0 -> 4.0 pull_requests: +24156 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25400 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 08:51:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Apr 2021 12:51:33 +0000 Subject: [issue43539] test_asyncio: test_sendfile_close_peer_in_the_middle_of_receiving() fails randomly In-Reply-To: <1616056043.89.0.64862359152.issue43539@roundup.psfhosted.org> Message-ID: <1618491093.2.0.684484639624.issue43539@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +24155 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25400 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 08:51:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Apr 2021 12:51:33 +0000 Subject: [issue41682] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1618491093.35.0.0553683664649.issue41682@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch nosy: +vstinner nosy_count: 3.0 -> 4.0 pull_requests: +24157 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25400 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 08:52:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Apr 2021 12:52:37 +0000 Subject: [issue42124] FAIL test_asyncio test_sendfile_close_peer_in_the_middle_of_receiving In-Reply-To: <1603420467.19.0.337945390908.issue42124@roundup.psfhosted.org> Message-ID: <1618491157.16.0.024629486224.issue42124@roundup.psfhosted.org> STINNER Victor added the comment: Duplicate of bpo-41682. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 08:53:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Apr 2021 12:53:00 +0000 Subject: [issue43539] test_asyncio: test_sendfile_close_peer_in_the_middle_of_receiving() fails randomly In-Reply-To: <1616056043.89.0.64862359152.issue43539@roundup.psfhosted.org> Message-ID: <1618491180.32.0.634223415113.issue43539@roundup.psfhosted.org> STINNER Victor added the comment: Duplicate of bpo-41682. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 08:53:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Apr 2021 12:53:11 +0000 Subject: [issue41682] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1618491191.0.0.98915008369.issue41682@roundup.psfhosted.org> STINNER Victor added the comment: I marked bpo-42124 and bpo-43539 as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 08:53:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Apr 2021 12:53:32 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1618491212.77.0.349735268522.issue41682@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure -> [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 08:53:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Apr 2021 12:53:39 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1618491219.24.0.0923195626637.issue41682@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 09:06:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 15 Apr 2021 13:06:46 +0000 Subject: [issue43823] Improve syntax errors for invalid dictionary literals In-Reply-To: <1618279547.58.0.105219171129.issue43823@roundup.psfhosted.org> Message-ID: <1618492006.8.0.317528072132.issue43823@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset da7435017430671f86075449ff7bde96fd7700a5 by Pablo Galindo in branch 'master': bpo-43823: Improve syntax errors for invalid dictionary literals (GH-25378) https://github.com/python/cpython/commit/da7435017430671f86075449ff7bde96fd7700a5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 09:07:07 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 15 Apr 2021 13:07:07 +0000 Subject: [issue43823] Improve syntax errors for invalid dictionary literals In-Reply-To: <1618279547.58.0.105219171129.issue43823@roundup.psfhosted.org> Message-ID: <1618492027.94.0.0873440278437.issue43823@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 09:29:20 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 15 Apr 2021 13:29:20 +0000 Subject: [issue43846] Control stack usage in large expressions In-Reply-To: <1618402171.48.0.736532073467.issue43846@roundup.psfhosted.org> Message-ID: <1618493360.71.0.200473041189.issue43846@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 11e0b295dee235dd6fd66a10d4823b0dcb014dc4 by Mark Shannon in branch 'master': bpo-43846: Use less stack for large literals and calls (GH-25403) https://github.com/python/cpython/commit/11e0b295dee235dd6fd66a10d4823b0dcb014dc4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 09:51:45 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 15 Apr 2021 13:51:45 +0000 Subject: [issue40006] enum: Add documentation for _create_pseudo_member_ and composite members In-Reply-To: <1584562609.71.0.431349886951.issue40006@roundup.psfhosted.org> Message-ID: <1618494705.24.0.220311547132.issue40006@roundup.psfhosted.org> Change by Ethan Furman : ---------- assignee: docs at python -> ethan.furman resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 09:58:40 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 15 Apr 2021 13:58:40 +0000 Subject: [issue43744] enum: Adding a member named _classname__ raises IndexError In-Reply-To: <1617700585.14.0.506924714072.issue43744@roundup.psfhosted.org> Message-ID: <1618495120.17.0.971506668747.issue43744@roundup.psfhosted.org> Ethan Furman added the comment: New changeset ec09973f5b21d33550c834ddc89606b0e1c70ffd by Ethan Furman in branch 'master': bpo-43744: [Enum] fix ``_is_private`` (GH-25349) https://github.com/python/cpython/commit/ec09973f5b21d33550c834ddc89606b0e1c70ffd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 10:03:38 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 15 Apr 2021 14:03:38 +0000 Subject: [issue43744] enum: Adding a member named _classname__ raises IndexError In-Reply-To: <1617700585.14.0.506924714072.issue43744@roundup.psfhosted.org> Message-ID: <1618495418.75.0.721387775208.issue43744@roundup.psfhosted.org> Change by Ethan Furman : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 10:25:51 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 15 Apr 2021 14:25:51 +0000 Subject: [issue42248] Raised exception in Enum keeping user objects alive unnecessarily In-Reply-To: <1604350009.17.0.208770748804.issue42248@roundup.psfhosted.org> Message-ID: <1618496751.88.0.215915954004.issue42248@roundup.psfhosted.org> Change by Ethan Furman : ---------- assignee: -> ethan.furman resolution: -> fixed stage: patch review -> resolved status: open -> closed type: enhancement -> behavior versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 10:49:39 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 15 Apr 2021 14:49:39 +0000 Subject: [issue43852] [sqlite3] Improve tuple creation In-Reply-To: <1618478615.92.0.752682980963.issue43852@roundup.psfhosted.org> Message-ID: <1618498179.34.0.399911450806.issue43852@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- title: [sqlite3] Harden tuple creation -> [sqlite3] Improve tuple creation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 11:39:00 2021 From: report at bugs.python.org (Harlan Cheer) Date: Thu, 15 Apr 2021 15:39:00 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1618501140.96.0.364798357402.issue41100@roundup.psfhosted.org> Harlan Cheer added the comment: Trying to build from source to Apple M1 Big Sur (macOS 11), and it's failing to compile the standard library extension modules. It seems to be that the .c files are not being located properly, but looking in Modules/ I can see all the required source files are there. attached is a typical build log, have tried a variety of options to no avail. Similar build configurations have worked for previous MacOS releases, which leads me to believe this is something else. I've searched fairly exhaustively for any information related to this and come up with nothing. ---------- nosy: +harlantc type: -> compile error Added file: https://bugs.python.org/file49962/build.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 11:54:10 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 15 Apr 2021 15:54:10 +0000 Subject: [issue43856] Docs for importlib.metadata should mention Python version Message-ID: <1618502050.6.0.847154133714.issue43856@roundup.psfhosted.org> New submission from Antoine Pitrou : https://docs.python.org/3/library/importlib.metadata.html lacks a mention of which Python version saw the introduction of `importlib.metadata` (it definitely doesn't exist in my 3.7 install, for example). ---------- components: Library (Lib) messages: 391139 nosy: eric.araujo, ezio.melotti, jaraco, mdk, pitrou, willingc priority: normal severity: normal stage: needs patch status: open title: Docs for importlib.metadata should mention Python version type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 12:31:32 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Thu, 15 Apr 2021 16:31:32 +0000 Subject: [issue43857] Fix the AttributeError message for deletion of a missing attribute Message-ID: <1618504291.99.0.55591533554.issue43857@roundup.psfhosted.org> New submission from G?ry : Compare the `AttributeError` messages in this interactive Python session: ```python >>> class A: ... y = 0 ... __slots__ = ('z',) ... >>> A().x [?] AttributeError: 'A' object has no attribute 'x' >>> A().x = 1 [?] AttributeError: 'A' object has no attribute 'x' >>> del A().x [?] AttributeError: 'A' object has no attribute 'x' >>> A().y 0 >>> A().y = 2 [?] AttributeError: 'A' object attribute 'y' is read-only >>> del A().y [?] AttributeError: 'A' object attribute 'y' is read-only >>> A().z [?] AttributeError: z >>> A().z = 3 >>> del A().z [?] AttributeError: z ``` with the `AttributeError` messages in that one: ```python >>> class B: pass ... >>> B().x [?] AttributeError: 'B' object has no attribute 'x' >>> B().x = 1 >>> del B().x [?] AttributeError: x ``` The message `AttributeError: x` from `del B().x` does not feel right. I expect this message to be the same as the message `AttributeError: 'B' object has no attribute 'x'` from `B().x`, since in both cases the object `B()` has no attribute `'x'`. I have checked on PyPy 7.3.3 (Python 3.7.9) and it uses the expected message `AttributeError: 'B' object has no attribute 'x'` from `B().x` for `del B().x`. So this confirms my initial suspicion. ---- In CPython, the `AttributeError` message for attribute retrieval is implemented [here](https://github.com/python/cpython/blob/v3.9.4/Objects/object.c#L1266-L1270) (except for [slot retrieval](https://github.com/python/cpython/blob/v3.9.4/Python/structmember.c#L70-L75)): ```c if (!suppress) { PyErr_Format(PyExc_AttributeError, "'%.50s' object has no attribute '%U'", tp->tp_name, name); } ``` And the `AttributeError` messages for attribute assignment and deletion are implemented [here](https://github.com/python/cpython/blob/v3.9.4/Objects/object.c#L1324-L1350) (except for [slot deletion](https://github.com/python/cpython/blob/v3.9.4/Python/structmember.c#L112-L118)): ```c if (dict == NULL) { dictptr = _PyObject_GetDictPtr(obj); if (dictptr == NULL) { if (descr == NULL) { PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%U'", tp->tp_name, name); } else { PyErr_Format(PyExc_AttributeError, "'%.50s' object attribute '%U' is read-only", tp->tp_name, name); } goto done; } res = _PyObjectDict_SetItem(tp, dictptr, name, value); } else { Py_INCREF(dict); if (value == NULL) res = PyDict_DelItem(dict, name); else res = PyDict_SetItem(dict, name, value); Py_DECREF(dict); } if (res < 0 && PyErr_ExceptionMatches(PyExc_KeyError)) PyErr_SetObject(PyExc_AttributeError, name); ``` So it is the last line `PyErr_SetObject(PyExc_AttributeError, name);` that would be updated. Note that `_PyObjectDict_SetItem` delegates to `PyDict_DelItem` (if `value` is `NULL`) or `PyDict_SetItem` (if `value` is not `NULL`), and that only `PyDict_DelItem` can [set an exception](https://github.com/python/cpython/blob/v3.9.4/Objects/dictobject.c#L1655-L1657) `PyExc_KeyError`, which is then translated to an exception `PyExc_AttributeError` in the last line. ---------- components: Interpreter Core messages: 391140 nosy: maggyero priority: normal severity: normal status: open title: Fix the AttributeError message for deletion of a missing attribute type: enhancement versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 12:32:00 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Thu, 15 Apr 2021 16:32:00 +0000 Subject: [issue43857] Fix the AttributeError message for deletion of a missing attribute In-Reply-To: <1618504291.99.0.55591533554.issue43857@roundup.psfhosted.org> Message-ID: <1618504320.27.0.794192224585.issue43857@roundup.psfhosted.org> Change by G?ry : ---------- keywords: +patch pull_requests: +24158 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25424 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 12:45:08 2021 From: report at bugs.python.org (Zackery Spytz) Date: Thu, 15 Apr 2021 16:45:08 +0000 Subject: [issue34321] mmap.mmap() should not necessarily clone the file descriptor In-Reply-To: <1533216123.68.0.56676864532.issue34321@psf.upfronthosting.co.za> Message-ID: <1618505108.96.0.139856065948.issue34321@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 3.0 -> 4.0 pull_requests: +24159 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25425 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 12:46:41 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 15 Apr 2021 16:46:41 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1618505201.99.0.884310481107.issue40222@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 13:00:59 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 15 Apr 2021 17:00:59 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1618506059.48.0.628872263798.issue41100@roundup.psfhosted.org> Ned Deily added the comment: @harlantc, in general, please open new issues for new problems. That said, I took a quick look at the build.log you provided and it was not obvious exactly why things went wrong. The most obvious difference is that when I do a 3.9.4 build, the extension module source paths (the -c arguments to the failing compiles) have been normalized by setup.py to absolute paths, whereas in the failing build.log they are unprefixed relative paths. I suggest you look at the top level setup.py file to figure out why that is the case in your build. I also note that the build appears to be on a very early release of macOS 11 Big Sur; it would be best to upgrade to the latest version of it and ensure you have the latest version of the Command Line Tools installed. Also, your configure arguments appear to be unnecessary complex: the -m64 and the --build and --target arguments shouldn't be necessary and we rarely test with --enable-shared on macOS. It's possible they are contributing factors. If you do find something that appears to be a Python build issue, please open a new issue with the details. ---------- type: compile error -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 13:17:12 2021 From: report at bugs.python.org (Harlan Cheer) Date: Thu, 15 Apr 2021 17:17:12 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1618507032.83.0.554942413281.issue41100@roundup.psfhosted.org> Harlan Cheer added the comment: @ned.deily sorry about that, will do that in the future. Thanks for replying. in regard to the extra args, those were all added in an attempt to make things work, I should probably have shown an earlier log that excluded them. I wasn't sure setup.py would be the right place to look for more, I'll take a look there. Thanks ---------- type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 13:26:25 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 15 Apr 2021 17:26:25 +0000 Subject: [issue43856] Docs for importlib.metadata should mention Python version In-Reply-To: <1618502050.6.0.847154133714.issue43856@roundup.psfhosted.org> Message-ID: <1618507585.6.0.892660935061.issue43856@roundup.psfhosted.org> Shreyan Avigyan added the comment: importlib.metadata was introduced in Python 3.8. But you're right the docs should mention about the version importlib.metadata was introduced in. ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 13:37:21 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 15 Apr 2021 17:37:21 +0000 Subject: [issue43804] Add more info about building C/C++ Extensions on Windows using MSVC In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1618508241.52.0.313020034044.issue43804@roundup.psfhosted.org> Shreyan Avigyan added the comment: Please have a review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 13:46:57 2021 From: report at bugs.python.org (Andy Lowry) Date: Thu, 15 Apr 2021 17:46:57 +0000 Subject: [issue43858] Provide method to get list of logging level names Message-ID: <1618508817.95.0.500447634147.issue43858@roundup.psfhosted.org> New submission from Andy Lowry : It would be useful to have something like a `getLevelNames` method to return the current list of level names, ordered by priority. This currently appears to be available only by accessing a private member, like `_levelToName` or `_nameToLevel`. This functionality is useful, for example, in populating a `choices` list for an `argparse` option to allow a user to select a logging level when launching a program from a command line. ---------- components: Library (Lib) messages: 391145 nosy: andylowry priority: normal severity: normal status: open title: Provide method to get list of logging level names versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 13:49:57 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 15 Apr 2021 17:49:57 +0000 Subject: [issue41100] Support macOS 11 and Apple Silicon Macs In-Reply-To: <1592999467.1.0.372512113251.issue41100@roundup.psfhosted.org> Message-ID: <1618508997.29.0.214332965977.issue41100@roundup.psfhosted.org> Ned Deily added the comment: No problem. Also you should not need to specify sysroot if you are; the Apple compiler front-end takes care of that for you (see man xcrun for more details). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 14:13:05 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 15 Apr 2021 18:13:05 +0000 Subject: [issue43858] Provide method to get list of logging level names In-Reply-To: <1618508817.95.0.500447634147.issue43858@roundup.psfhosted.org> Message-ID: <1618510385.39.0.62724970342.issue43858@roundup.psfhosted.org> Shreyan Avigyan added the comment: I agree with you. It would be nice to have a function to list or dictionary of level names. Moreover I suggest that there should be an argument to the function like format_level which can take in "dict:level_name" for returning a dictionary with the level as keys and name as values, "dict:name_level" for returning a dictionary with the name as keys and level as values or "list" for returning just the list of level names ordered by priority. ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 14:13:38 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 15 Apr 2021 18:13:38 +0000 Subject: [issue43858] Provide method to get list of logging level names In-Reply-To: <1618508817.95.0.500447634147.issue43858@roundup.psfhosted.org> Message-ID: <1618510418.57.0.0490619912055.issue43858@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 14:15:01 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 15 Apr 2021 18:15:01 +0000 Subject: [issue43858] Provide method to get list of logging level names In-Reply-To: <1618508817.95.0.500447634147.issue43858@roundup.psfhosted.org> Message-ID: <1618510501.84.0.812664638907.issue43858@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 15:20:08 2021 From: report at bugs.python.org (Christodoulos Tsoulloftas) Date: Thu, 15 Apr 2021 19:20:08 +0000 Subject: [issue43646] ForwardRef name conflict during evaluation In-Reply-To: <1616925169.4.0.788953716536.issue43646@roundup.psfhosted.org> Message-ID: <1618514408.02.0.971792214192.issue43646@roundup.psfhosted.org> Christodoulos Tsoulloftas added the comment: @kj I can confirm the issue is resolved with Python 3.10.0a7+ ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 15:25:53 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 15 Apr 2021 19:25:53 +0000 Subject: [issue43852] [sqlite3] Improve tuple creation In-Reply-To: <1618478615.92.0.752682980963.issue43852@roundup.psfhosted.org> Message-ID: <1618514753.52.0.145701004564.issue43852@roundup.psfhosted.org> Serhiy Storchaka added the comment: I considered rewriting this code when touched that files last time (in issue43083). But PyTuple_SetItem() newer fails in these cases, so I left it as is to minimize change. So it is a pure cosmetic change. I am not opposing it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 15:32:54 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 15 Apr 2021 19:32:54 +0000 Subject: [issue43846] Control stack usage in large expressions In-Reply-To: <1618402171.48.0.736532073467.issue43846@roundup.psfhosted.org> Message-ID: <1618515174.04.0.153029231206.issue43846@roundup.psfhosted.org> Serhiy Storchaka added the comment: What is performance impact of this change? I expect that creating a list incrementally can hurt performance, but how much? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 15:45:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 15 Apr 2021 19:45:15 +0000 Subject: [issue43854] curses: returns incorrect chars after resuming a suspended process In-Reply-To: <1618481879.49.0.746081524149.issue43854@roundup.psfhosted.org> Message-ID: <1618515915.03.0.0581585060958.issue43854@roundup.psfhosted.org> Serhiy Storchaka added the comment: Python method is just a thin wrapper around corresponding curses function (wgetch() in this case). It looks like an issue is in the curses library. We cannot do anything with it. ---------- nosy: +serhiy.storchaka resolution: -> third party status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 16:38:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 15 Apr 2021 20:38:55 +0000 Subject: [issue43822] Improve syntax errors for missing commas In-Reply-To: <1618277443.81.0.695650412986.issue43822@roundup.psfhosted.org> Message-ID: <1618519135.02.0.254847814525.issue43822@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset b280248be8e648feb82f3f3ed0050e50b238df7b by Pablo Galindo in branch 'master': bpo-43822: Improve syntax errors for missing commas (GH-25377) https://github.com/python/cpython/commit/b280248be8e648feb82f3f3ed0050e50b238df7b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 16:52:38 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 15 Apr 2021 20:52:38 +0000 Subject: [issue42037] Documentation confusion in CookieJar functions In-Reply-To: <1602689022.88.0.876415237077.issue42037@roundup.psfhosted.org> Message-ID: <1618519958.77.0.292535489659.issue42037@roundup.psfhosted.org> Andrei Kulakov added the comment: I can confirm `unverifiable` is an attr: https://github.com/python/cpython/blob/master/Lib/urllib/request.py#L333 and so is incorrectly listed as a method in cookie jar docs. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 17:24:34 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 15 Apr 2021 21:24:34 +0000 Subject: [issue43856] Docs for importlib.metadata should mention Python version In-Reply-To: <1618502050.6.0.847154133714.issue43856@roundup.psfhosted.org> Message-ID: <1618521874.77.0.569231022387.issue43856@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- assignee: -> jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 18:07:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 15 Apr 2021 22:07:56 +0000 Subject: [issue43822] Improve syntax errors for missing commas In-Reply-To: <1618277443.81.0.695650412986.issue43822@roundup.psfhosted.org> Message-ID: <1618524476.47.0.0986959195213.issue43822@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 18:40:07 2021 From: report at bugs.python.org (Claudio Jolowicz) Date: Thu, 15 Apr 2021 22:40:07 +0000 Subject: [issue38671] pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not exist In-Reply-To: <1572774931.11.0.993470333259.issue38671@roundup.psfhosted.org> Message-ID: <1618526407.63.0.753590248751.issue38671@roundup.psfhosted.org> Change by Claudio Jolowicz : ---------- nosy: +cjolowicz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 19:05:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 15 Apr 2021 23:05:36 +0000 Subject: [issue43823] Improve syntax errors for invalid dictionary literals In-Reply-To: <1618279547.58.0.105219171129.issue43823@roundup.psfhosted.org> Message-ID: <1618527936.33.0.885929866751.issue43823@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24160 pull_request: https://github.com/python/cpython/pull/25427 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 19:23:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 15 Apr 2021 23:23:16 +0000 Subject: [issue43809] Improve mismatching parentheses error In-Reply-To: <1618177763.07.0.220270371715.issue43809@roundup.psfhosted.org> Message-ID: <1618528996.25.0.665684356596.issue43809@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This is probably not worth the complexity, so I am closing it ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 19:23:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 15 Apr 2021 23:23:20 +0000 Subject: [issue43809] Improve mismatching parentheses error In-Reply-To: <1618177763.07.0.220270371715.issue43809@roundup.psfhosted.org> Message-ID: <1618529000.26.0.214016754385.issue43809@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 19:45:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 15 Apr 2021 23:45:51 +0000 Subject: [issue43823] Improve syntax errors for invalid dictionary literals In-Reply-To: <1618279547.58.0.105219171129.issue43823@roundup.psfhosted.org> Message-ID: <1618530351.38.0.917389231205.issue43823@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset b5b98bd8f8c72a9068cf149dbc162c8c95d30057 by Pablo Galindo in branch 'master': bpo-43823: Fix location of one of the errors for invalid dictionary literals (GH-25427) https://github.com/python/cpython/commit/b5b98bd8f8c72a9068cf149dbc162c8c95d30057 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 19:49:04 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 15 Apr 2021 23:49:04 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1618530544.85.0.766328831906.issue37596@roundup.psfhosted.org> Raymond Hettinger added the comment: > Would it be reasonable to make it so that sets are > always created with the definition order? No, it would not. We would also have to maintain order across set operations such as intersection which which would become dramatically more expensive if they had to maintain order. For example intersecting a million element set with a ten element set always takes ten steps regardless of the order of arguments, but to maintain order of the left hand operand could take a hundred times more work. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 20:04:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 00:04:04 +0000 Subject: [issue40443] Remove unused imports in the stdlib (April 2020 edition) In-Reply-To: <1588200148.3.0.742578477052.issue40443@roundup.psfhosted.org> Message-ID: <1618531444.59.0.662479650515.issue40443@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24161 pull_request: https://github.com/python/cpython/pull/25429 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 20:10:53 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 16 Apr 2021 00:10:53 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1618531853.83.0.873165915065.issue37596@roundup.psfhosted.org> Filipe La?ns added the comment: > No, it would not. We would also have to maintain order across set operations such as intersection which which would become dramatically more expensive if they had to maintain order. For example intersecting a million element set with a ten element set always takes ten steps regardless of the order of arguments, but to maintain order of the left hand operand could take a hundred times more work. Can these operations happen during bytecode generation? I am fairly new to these internals so my understanding is not great. During bytecode generation is can code that performs such operations run? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 20:12:47 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 16 Apr 2021 00:12:47 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1618531967.9.0.510020916265.issue37596@roundup.psfhosted.org> Raymond Hettinger added the comment: s/hundred/hundred thousand/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 20:13:23 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 16 Apr 2021 00:13:23 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1618532003.82.0.136634819018.issue37596@roundup.psfhosted.org> Filipe La?ns added the comment: s/is can/can/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 20:26:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Apr 2021 00:26:09 +0000 Subject: [issue43859] Improve syntax error for indentation errors Message-ID: <1618532769.85.0.413956426604.issue43859@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : The current indentation error is quite simplistic and it does not include the context of the statement that was associated with the indented block and where it was: >>> def foo(): ... if lel: ... x = 2 File "", line 3 x = 2 ^ IndentationError: expected an indented block we can improve the error by adding some context: >>> def foo(): ... if lel: ... x = 2 File "", line 3 x = 2 ^ IndentationError: expected an indented block after if statement in line 2 ---------- messages: 391160 nosy: ammar2, pablogsal priority: normal severity: normal status: open title: Improve syntax error for indentation errors _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 20:27:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Apr 2021 00:27:28 +0000 Subject: [issue43859] Improve syntax error for indentation errors In-Reply-To: <1618532769.85.0.413956426604.issue43859@roundup.psfhosted.org> Message-ID: <1618532848.34.0.0832033417708.issue43859@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +24162 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25431 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 20:43:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 00:43:07 +0000 Subject: [issue39376] Avoid modifying the process global environment (not thread safe) In-Reply-To: <1579308464.24.0.791579553009.issue39376@roundup.psfhosted.org> Message-ID: <1618533787.25.0.52833787595.issue39376@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +Subinterpreters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 21:11:41 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 16 Apr 2021 01:11:41 +0000 Subject: [issue43782] Failure to build from source on ppc64le on ubuntu xenial In-Reply-To: <1617933135.46.0.871973088731.issue43782@roundup.psfhosted.org> Message-ID: <1618535501.88.0.0225077720741.issue43782@roundup.psfhosted.org> Change by Zachary Ware : ---------- resolution: -> third party status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 21:13:59 2021 From: report at bugs.python.org (Anthony Sottile) Date: Fri, 16 Apr 2021 01:13:59 +0000 Subject: [issue43782] Failure to build from source on ppc64le on ubuntu xenial In-Reply-To: <1617933135.46.0.871973088731.issue43782@roundup.psfhosted.org> Message-ID: <1618535639.16.0.289774185326.issue43782@roundup.psfhosted.org> Anthony Sottile added the comment: a rebuild succeeded so I'm ok closing this :shrug: ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 22:55:16 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 16 Apr 2021 02:55:16 +0000 Subject: [issue43627] What are the requirements for a test_sundry-testable script in Tools/scripts? In-Reply-To: <1616704530.06.0.307458133003.issue43627@roundup.psfhosted.org> Message-ID: <1618541716.34.0.229816045847.issue43627@roundup.psfhosted.org> Zachary Ware added the comment: `test_sundry` just checks to see if the script is importable, so if your script runs on import it may very well cause problems :). Adding it to a skip list is a reasonable solution, as is making the script import-friendly (e.g. with a `if __name__ == '__main__'` check). ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 23:32:18 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 16 Apr 2021 03:32:18 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1618543938.96.0.623423574105.issue42238@roundup.psfhosted.org> Raymond Hettinger added the comment: If reactivated, the tool needs to be substantially improved. It is NOT smart. The false positives for slicing and logging examples are unnecessarily annoying. It creates a barrier for people submitting documentation patches. Each of the 367 entries in the susp-ignored file represents wasted time for contributors. Also the CSV format is arcane, hard-to-read, and hard-to-edit. It looks like it was quickly thrown together by someone who didn't care about usability. Perhaps there should be a simpler tools that says, "take this current failure and mark it as a false positive" without trying to be over specific. Mandatory checks with a high false positive rate are an anti-pattern for CI systems. Already we've had one case of a contributor (me) who abandoned a doc patch rather than fight this tooling. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 15 23:56:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Apr 2021 03:56:11 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1618545371.51.0.178410379126.issue42238@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I agree with all you said, but I am against forcing the release management team to absorb the responsibility of fixing all the errors that the CI didn't catch, real or not. Releasing is already a multi-hour process and having many docs errors and formating mistakes to fix is a toll that should be paid at release time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 00:44:50 2021 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Fri, 16 Apr 2021 04:44:50 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1618548290.19.0.243085981447.issue37596@roundup.psfhosted.org> Change by Chih-Hsuan Yen : ---------- nosy: -yan12125 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 01:01:32 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 16 Apr 2021 05:01:32 +0000 Subject: [issue41323] Perform "peephole" optimization directly on control-flow graph. In-Reply-To: <1594981622.83.0.602836344044.issue41323@roundup.psfhosted.org> Message-ID: <1618549292.53.0.342750868232.issue41323@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 8a232c7b17a2e41ae14d8bb7937ddfea69301dce by Inada Naoki in branch 'master': bpo-41323: compiler: Reuse tuple in constant tuple folding (GH-25419) https://github.com/python/cpython/commit/8a232c7b17a2e41ae14d8bb7937ddfea69301dce ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 01:39:02 2021 From: report at bugs.python.org (Steve Kelem) Date: Fri, 16 Apr 2021 05:39:02 +0000 Subject: [issue43860] unittest increment tests executed Message-ID: <1618551542.77.0.0261778711624.issue43860@roundup.psfhosted.org> New submission from Steve Kelem : The unittest module (and most other unittest modules) keep a count of the number of functional tests run, as defined by the number of times testXXXX is called. I would like the option to count the number of times that assertXXXX is called. I have to run many tests (in unittest's sense of the word), but each of the tests consists of iterating through an array of hundreds or thousands of individual test cases with their expected results. These check for corner cases, interior, exterior cases, and for mathematical accuracy. It doesn't make sense to make a separate test case for each test value, when iterating through an array of values, and calling AssertEquals (or whatever is called for) for each expected & actual value-pair. Yes, the existing methodology tells me that a particular functional test works, but it is important to know whether it passed based on a single test value (because the test development is not done or the tester was lazy) or whether it passed thousands of tests and will give adequate coverage. (Yes that can be cheated too, but assume that the tests are developed in earnest.) ---------- components: Tests messages: 391166 nosy: chelmite priority: normal severity: normal status: open title: unittest increment tests executed type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 01:45:42 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Apr 2021 05:45:42 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1618551942.24.0.874912836094.issue43723@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +terry.reedy nosy_count: 6.0 -> 7.0 pull_requests: +24163 pull_request: https://github.com/python/cpython/pull/25432 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 02:08:14 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Apr 2021 06:08:14 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1618553294.68.0.232490603813.issue43723@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 56c76df6e861322bdff77bfb21e5cd55fbacfad2 by Terry Jan Reedy in branch '3.9': [3.9] bpo-43723: Revert IDLE doc change (GH-25174) https://github.com/python/cpython/commit/56c76df6e861322bdff77bfb21e5cd55fbacfad2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 02:08:30 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Apr 2021 06:08:30 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1618553310.89.0.847650943782.issue43723@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +24164 pull_request: https://github.com/python/cpython/pull/25433 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 02:19:39 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 16 Apr 2021 06:19:39 +0000 Subject: [issue43817] Add typing.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1618553979.47.0.413380122252.issue43817@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 02:26:17 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 16 Apr 2021 06:26:17 +0000 Subject: [issue43860] unittest increment tests executed In-Reply-To: <1618551542.77.0.0261778711624.issue43860@roundup.psfhosted.org> Message-ID: <1618554377.08.0.442341766259.issue43860@roundup.psfhosted.org> Raymond Hettinger added the comment: ISTM the call count is too indirect to provide a useful indicator of coverage. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 02:29:41 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Apr 2021 06:29:41 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1618554581.86.0.575655045065.issue43723@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +24165 pull_request: https://github.com/python/cpython/pull/25435 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 03:01:17 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Apr 2021 07:01:17 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1618556477.94.0.918067512787.issue43723@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset b40564727fbe85932e92862e57fc065034d98dbf by Terry Jan Reedy in branch '3.8': [3.8] bpo-43723: Backport IDLE doc change (GH-25174) https://github.com/python/cpython/commit/b40564727fbe85932e92862e57fc065034d98dbf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 03:41:01 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Apr 2021 07:41:01 +0000 Subject: [issue35056] Test leaks of memory not managed by Python allocator In-Reply-To: <1540323419.75.0.788709270274.issue35056@psf.upfronthosting.co.za> Message-ID: <1618558861.64.0.131814469698.issue35056@roundup.psfhosted.org> Serhiy Storchaka added the comment: No, I did not mean using msize() or something like. Since memory is managed outside of Python, we have no a list of allocated blocks. I meant that we can get the total memory used by the Python process (using OS-specific methods) and compare it between iterations. If it continues to grow, there is a leak. It perhaps is not able to detect small leaks (less than the page size), but large leaks are more important. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 03:46:03 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 16 Apr 2021 07:46:03 +0000 Subject: [issue35056] Test leaks of memory not managed by Python allocator In-Reply-To: <1540323419.75.0.788709270274.issue35056@psf.upfronthosting.co.za> Message-ID: <1618559163.27.0.51073412634.issue35056@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: The msize() talk is referring to msg389039 and msg328533. If we are to use Python memory allocators for the sqlite3 extension module, we need some sort of msize() function; overriding SQLite's memory functions requires msize() support. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 03:56:14 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 16 Apr 2021 07:56:14 +0000 Subject: [issue35056] Test leaks of memory not managed by Python allocator In-Reply-To: <1540323419.75.0.788709270274.issue35056@psf.upfronthosting.co.za> Message-ID: <1618559774.58.0.629788790617.issue35056@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : Added file: https://bugs.python.org/file49963/patch-with-simple-msize.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 04:45:10 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 16 Apr 2021 08:45:10 +0000 Subject: [issue43817] Add typing.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1618562710.03.0.702500196808.issue43817@roundup.psfhosted.org> Inada Naoki added the comment: Should this feature implemented in typing module? How about inspect module? Additionally, how about adding `get_annotation_str()`, which returns str always? Some use cases (e.g. `help(f)`) need just string. I want to skip eval() in it. ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 05:20:56 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Fri, 16 Apr 2021 09:20:56 +0000 Subject: [issue43602] Include Decimal's in numbers.Real In-Reply-To: <1616481040.42.0.772549255299.issue43602@roundup.psfhosted.org> Message-ID: <1618564856.16.0.144717285864.issue43602@roundup.psfhosted.org> Sergey B Kirpichev added the comment: Probably, this thread https://mail.python.org/archives/list/python-ideas at python.org/thread/KOE3MQ5NSMGTLIH6IHAQWTIOELXG4AFQ/ is relevant here. I would appreciate Oscar's feedback on this issue. ---------- nosy: +oscarbenjamin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 05:26:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 09:26:45 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1618565205.58.0.6949713324.issue41282@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 69ca32e0d34fe17dd242592b6f8754cda7bae684 by Victor Stinner in branch 'master': bpo-41282: Fix distutils.utils.byte_compile() DeprecationWarning (GH-25406) https://github.com/python/cpython/commit/69ca32e0d34fe17dd242592b6f8754cda7bae684 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 05:26:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 09:26:36 +0000 Subject: [issue40443] Remove unused imports in the stdlib (April 2020 edition) In-Reply-To: <1588200148.3.0.742578477052.issue40443@roundup.psfhosted.org> Message-ID: <1618565196.68.0.353086853948.issue40443@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a6a5c91b1ee56fa5ba7ab8c5aeca70c31cc85fd3 by Victor Stinner in branch 'master': bpo-40443: Remove unused imports (GH-25429) https://github.com/python/cpython/commit/a6a5c91b1ee56fa5ba7ab8c5aeca70c31cc85fd3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 05:27:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 09:27:05 +0000 Subject: [issue43844] [easy] test_lib2to3 logs a PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+ In-Reply-To: <1618400337.77.0.971562000748.issue43844@roundup.psfhosted.org> Message-ID: <1618565225.59.0.743381864496.issue43844@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 471870fc504b0d69c767b188f180b17248be6998 by Victor Stinner in branch 'master': bpo-43844: Fix PendingDeprecationWarning in test_lib2to3 (GH-25407) https://github.com/python/cpython/commit/471870fc504b0d69c767b188f180b17248be6998 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 05:40:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 09:40:35 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1618566035.02.0.950007740451.issue42238@roundup.psfhosted.org> STINNER Victor added the comment: Pablo: "I every single alpha release I had to fix actual documentation errors (no false positives)" I don't get it. Do you mean that the Python release process is blocked by typos in the documentation? Why did you catch them in the release process, and not in the regular Python development workflow? Can't we get the same errors in the regular workflow? I understand that the release process requires no warning from "make suspicious", but as explained in other comments, this tool is not reliable. While it catchs some real bugs, the cost of false positives is too high. Doc/tools/susp-ignored.csv contains 368 lines, IMO it's a sign that this tool either requires a serious reworking, or must be disabled/removed. Doc/tools/extensions/suspicious.py is a CPython specific extension, it's not part of Sphinx. Maybe someone should open a feature request on Sphinx to get a similar feature without false positives (or at least less false positives). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 05:44:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 09:44:39 +0000 Subject: [issue35056] Test leaks of memory not managed by Python allocator In-Reply-To: <1540323419.75.0.788709270274.issue35056@psf.upfronthosting.co.za> Message-ID: <1618566279.7.0.473825842398.issue35056@roundup.psfhosted.org> STINNER Victor added the comment: patch-with-simple-msize.diff: I suggest you opening a new issue to propose using the Python memory allocators in the sqlite module. This issue is about C extension modules which don't use the Python memory allocator. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 05:46:02 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 09:46:02 +0000 Subject: [issue43844] [easy] test_lib2to3 logs a PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+ In-Reply-To: <1618400337.77.0.971562000748.issue43844@roundup.psfhosted.org> Message-ID: <1618566362.45.0.524317326457.issue43844@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 05:47:59 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Apr 2021 09:47:59 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1618566479.33.0.0211905833529.issue43723@roundup.psfhosted.org> miss-islington added the comment: New changeset 582917f8b255801f3c722d89ff2b8d6b17a11590 by Miss Islington (bot) in branch '3.8': [3.9] bpo-43723: Revert IDLE doc change (GH-25174) https://github.com/python/cpython/commit/582917f8b255801f3c722d89ff2b8d6b17a11590 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 05:50:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 09:50:58 +0000 Subject: [issue43723] Deprecate camelCase aliases from threading.py In-Reply-To: <1617498110.97.0.827656186074.issue43723@roundup.psfhosted.org> Message-ID: <1618566658.63.0.331056496248.issue43723@roundup.psfhosted.org> STINNER Victor added the comment: > New changeset 582917f8b255801f3c722d89ff2b8d6b17a11590 by Miss Islington (bot) in branch '3.8': > [3.9] bpo-43723: Revert IDLE doc change (GH-25174) Oh. I didn't notice that https://github.com/python/cpython/commit/b40564727fbe85932e92862e57fc065034d98dbf was already merged. After being rebased before the merge, https://github.com/python/cpython/commit/582917f8b255801f3c722d89ff2b8d6b17a11590 became an empty change! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 05:51:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 09:51:40 +0000 Subject: [issue43793] [C API] Py_NewInterpreter() cannot be called from a thread which has no Python thread state In-Reply-To: <1617976522.63.0.387381437279.issue43793@roundup.psfhosted.org> Message-ID: <1618566700.0.0.36634680009.issue43793@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +Subinterpreters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 05:55:04 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 16 Apr 2021 09:55:04 +0000 Subject: [issue35056] Test leaks of memory not managed by Python allocator In-Reply-To: <1540323419.75.0.788709270274.issue35056@psf.upfronthosting.co.za> Message-ID: <1618566904.7.0.583796184994.issue35056@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > This issue is about C extension modules which don't use the Python memory allocator. Yes, I know. Your proposal in msg328533 is to continue the implementation of bpo-18227: > _sqlite: call sqlite3_config(SQLITE_CONFIG_MALLOC, pMem) to use PyMem_RawMalloc() Thus, I thought using this issue would be ok, but I can split the sqlite3 details out in a separate issue. Using sqlite3_config(SQLITE_CONFIG_MALLOC, ...) _requires_ msize(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 06:27:07 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Apr 2021 10:27:07 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1618568827.92.0.327188439963.issue42238@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Why did you catch them in the release process, and not in the regular Python development workflow? Because our release tools run suspicious.py and it fails and then we need to manually inspect every single failure and fix it as almost all times there are real positives among them > Can't we get the same errors in the regular workflow? That's what I did reactivating suspicious.py > I understand that the release process requires no warning from "make suspicious", but as explained in other comments, this tool is not reliable. While it catchs some real bugs, the cost of false positives is too high Sure, we all agree here. Where it seems that we don't agree is how to proceed. I would be super happy to remove the tool if is agreed everywhere, including with the rest of release managers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 06:40:03 2021 From: report at bugs.python.org (Andre Roberge) Date: Fri, 16 Apr 2021 10:40:03 +0000 Subject: [issue43859] Improve syntax error for indentation errors In-Reply-To: <1618532769.85.0.413956426604.issue43859@roundup.psfhosted.org> Message-ID: <1618569603.04.0.887380845258.issue43859@roundup.psfhosted.org> Change by Andre Roberge : ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 07:08:05 2021 From: report at bugs.python.org (Oscar Benjamin) Date: Fri, 16 Apr 2021 11:08:05 +0000 Subject: [issue43602] Include Decimal's in numbers.Real In-Reply-To: <1616481040.42.0.772549255299.issue43602@roundup.psfhosted.org> Message-ID: <1618571285.67.0.911820993843.issue43602@roundup.psfhosted.org> Oscar Benjamin added the comment: I've never found numbers.Real/Complex to be useful. The purpose of the ABCs should be that they enable you to write code that works for instances of any subclass but in practice writing good floating point code requires knowing something e.g. the base, precision, max exponent etc of the type. Also many implementations like Decimal have contexts and rounding control etc that need to be used and the ABC gives no way to know that or to do anything with it. The main thing that is useful about the Rational/Integer ABCs is that they define the numerator and denominator attributes which makes different implementations interoperable by providing exact conversion. If Real was presumed to represent some kind of floating point type then an analogous property/method would be something that can deconstruct the object in an exact way like: mantissa, base, exponent = deconstruct(real) You would also need a way to handle nan, inf etc. Note that as_integer_ratio() is not suitable because it could generate enormous integers unnecessarily e.g. Decimal('1E+100000000').as_integer_ratio(). Instead the Real ABC only defines conversion to float. That's useful in the sense that you can write code for float and pass in some other floating point type and have everything reduce to float. You don't need an ABC for that though because __float__ does everything. In practice most alternate "real" number implementations exist precisely to be better than float in some way by either having greater range/precision or a different base but anything written for the Real ABC is essentially reduced to float as a lowest common (inexact) denominator. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 07:09:04 2021 From: report at bugs.python.org (Yunlongs) Date: Fri, 16 Apr 2021 11:09:04 +0000 Subject: [issue43861] A potential double free in list_sort_impl Message-ID: <1618571344.31.0.812788267332.issue43861@roundup.psfhosted.org> New submission from Yunlongs : File: Objects/listobject.c There is a feasible path to trigger a double free if memory limited. Details as follow: In funtion list_sort_impl, it calls merge_collapse(&ms) at line 2,394 and there exist paths to free ms->a.keys: merge_collapse(&ms)->merge_at(ms, n) (line 1,938) ->merge_lo(ms, ssa, na, ssb, nb) (line 1,911)->MERGE_GETMEM(ms, na) (line 1,601)->merge_freemem(ms) (line 1,565)->PyMem_Free(ms->a.keys) (line 1,545). Then if memory is not enough, line 1,568 will return -1 and the error code will propagate to the caller list_sort_impl(). After receives the err code, list_sort_impl() goto fial and calls merge_freemem(&ms) again to free the ms->a.keys at the second time at line 2,431. The same problem also occurs when merge_force_collapse(&ms) is called at line 2,401. ---------- messages: 391184 nosy: Yunlongs priority: normal severity: normal status: open title: A potential double free in list_sort_impl type: security versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 07:32:34 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 16 Apr 2021 11:32:34 +0000 Subject: [issue43861] A potential double free in list_sort_impl In-Reply-To: <1618571344.31.0.812788267332.issue43861@roundup.psfhosted.org> Message-ID: <1618572754.11.0.955315461426.issue43861@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +rhettinger, tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 07:42:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 11:42:21 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1618573341.85.0.414012956067.issue42238@roundup.psfhosted.org> STINNER Victor added the comment: Julien Palard is working actively on the Python documentation. He is the one who removed suspicious "from the CI and docs builds". I trust his judgment here. I suggest to remove it again from there *and* from the release scripts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 07:46:18 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Apr 2021 11:46:18 +0000 Subject: [issue41506] Inclusion or documentation of extended with syntax in 3.9 In-Reply-To: <1596850320.21.0.142080709573.issue41506@roundup.psfhosted.org> Message-ID: <1618573578.87.0.844341679192.issue41506@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 07:58:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 11:58:36 +0000 Subject: [issue43842] test_logging: "OSError: [Errno 9] Bad file descriptor" logged on FreeBSD In-Reply-To: <1618398916.84.0.57759722491.issue43842@roundup.psfhosted.org> Message-ID: <1618574316.46.0.326879877907.issue43842@roundup.psfhosted.org> STINNER Victor added the comment: There is a race condition. The main thread closes a file descriptor which is part of the asyncore loop "map", a thread polls on the asyncore "map" file descriptors. -- Main thread -- Close a socket: File "/usr/home/vstinner/python/master/Lib/test/test_logging.py", line 1072, in test_basic server.stop() File "/usr/home/vstinner/python/master/Lib/test/test_logging.py", line 870, in stop self.close() -- TestSMTPServer thread -- Wait in asyncore.loop(): Exception in thread Thread-1 (serve_forever): Traceback (most recent call last): File "/usr/home/vstinner/python/master/Lib/threading.py", line 990, in _bootstrap_inner self.run() File "/usr/home/vstinner/python/master/Lib/threading.py", line 928, in run self._target(*self._args, **self._kwargs) File "/usr/home/vstinner/python/master/Lib/test/test_logging.py", line 863, in serve_forever asyncore.loop(poll_interval, map=self._map) File "/usr/home/vstinner/python/master/Lib/asyncore.py", line 211, in loop poll_fun(timeout, map) File "/usr/home/vstinner/python/master/Lib/asyncore.py", line 145, in poll r, w, e = select.select(r, w, e, timeout) OSError: [Errno 9] Bad file descriptor ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 08:08:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 12:08:57 +0000 Subject: [issue43842] test_logging: "OSError: [Errno 9] Bad file descriptor" logged on FreeBSD In-Reply-To: <1618398916.84.0.57759722491.issue43842@roundup.psfhosted.org> Message-ID: <1618574937.25.0.336808108336.issue43842@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +24166 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25436 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 08:32:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 12:32:06 +0000 Subject: [issue43842] test_logging: "OSError: [Errno 9] Bad file descriptor" logged on FreeBSD In-Reply-To: <1618398916.84.0.57759722491.issue43842@roundup.psfhosted.org> Message-ID: <1618576326.95.0.646940570349.issue43842@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 75ec103b3adbb7c619a0e22fa60f3d34c5a9e603 by Victor Stinner in branch 'master': bpo-43842: Fix race condition in test_logging SMTP test (GH-25436) https://github.com/python/cpython/commit/75ec103b3adbb7c619a0e22fa60f3d34c5a9e603 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 08:33:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 12:33:13 +0000 Subject: [issue43843] libregrtest: mark a test as failed if a thread logs an unexpected exception In-Reply-To: <1618399223.2.0.989011891247.issue43843@roundup.psfhosted.org> Message-ID: <1618576393.55.0.664904732081.issue43843@roundup.psfhosted.org> STINNER Victor added the comment: New changeset b136b1aac4b7d07e3120ee59e41c02bc86032162 by Victor Stinner in branch 'master': bpo-43843: libregrtest uses threading.excepthook (GH-25400) https://github.com/python/cpython/commit/b136b1aac4b7d07e3120ee59e41c02bc86032162 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 08:36:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 12:36:39 +0000 Subject: [issue43842] test_logging: "OSError: [Errno 9] Bad file descriptor" logged on FreeBSD In-Reply-To: <1618398916.84.0.57759722491.issue43842@roundup.psfhosted.org> Message-ID: <1618576599.64.0.869008177103.issue43842@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24167 pull_request: https://github.com/python/cpython/pull/25437 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 08:42:08 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 16 Apr 2021 12:42:08 +0000 Subject: [issue28528] Pdb.checkline() In-Reply-To: <1477401123.41.0.136094342663.issue28528@psf.upfronthosting.co.za> Message-ID: <1618576928.28.0.0215159971821.issue28528@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- nosy: +erlendaasland nosy_count: 3.0 -> 4.0 pull_requests: +24168 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25438 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 09:03:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 13:03:59 +0000 Subject: [issue43843] libregrtest: mark a test as failed if a thread logs an unexpected exception In-Reply-To: <1618399223.2.0.989011891247.issue43843@roundup.psfhosted.org> Message-ID: <1618578239.89.0.301622601541.issue43843@roundup.psfhosted.org> STINNER Victor added the comment: test_concurrent_futures logs two warnings. s390x Debian 3.x: https://buildbot.python.org/all/#/builders/49/builds/1124 AMD64 RHEL7 3.x: https://buildbot.python.org/all/#/builders/15/builds/1074 0:03:18 load avg: 4.78 [302/427] test_concurrent_futures passed (2 min 46 sec) -- running: test_tokenize (37.8 sec), test_peg_generator (59.2 sec) Warning -- Uncaught thread exception: SystemExit Warning -- Uncaught thread exception: SystemExit ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 09:06:47 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 13:06:47 +0000 Subject: [issue43862] warnings: -W option and PYTHONWARNINGS now use the message as a regex Message-ID: <1618578407.09.0.811659309688.issue43862@roundup.psfhosted.org> New submission from STINNER Victor : I propose to change the -W command line option and the PYTHONWARNINGS environment variable to use the message as a regular expression in Python 3.10. Or does anyone have a reason to keep the current behavior as it is? -- Python provides two ways to specify warnings filters: * -W command line option: can be used multiple times * PYTHONWARNINGS environment variable: can contain multiple options separated by commas While the Python API warnings.filterwarnings(action, message="", ...) uses the message as a regular expression, -W and PYTHONWARNINGS require to match *exactly* the *whole* message. For example, if you only want to ignore the new distutils deprecation warning, you must write exactly: $ ./python -X dev -W 'ignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning' -c 'import distutils' I use -X dev to show DeprecationWarning, or you can also use -Wdefault if you prefer. If the deprecation warning changes in Python or if you have a single typo, the warning is not ignored. Example with a typo ("3.13" rather than "3.12"): $ ./python -X dev -W 'ignore:The distutils package is deprecated and slated for removal in Python 3.13. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning' -c 'import distutils' :1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives The PYTHONWARNINGS has another limitation: you cannot specify a message if it contains a comma (","). Hopefully, Python doesn't raise warnings containing comma, right? Well... Just one example: Lib/distutils/sysconfig.py:554: ? ? ? ?warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning, 2) You cannot only ignore the message: $ PYTHONWARNINGS='ignore:SO is deprecated, use EXT_SUFFIX:DeprecationWarning' ./python -c 'import sys; print(sys.warnoptions); print(len(sys.warnoptions))' Invalid -W option ignored: invalid action: 'use EXT_SUFFIX' ['ignore:SO is deprecated', ' use EXT_SUFFIX:DeprecationWarning'] 2 You can only try to use "module" and "lineno" parameters of a warning filter, which are more fragile and hard to use to use. ---------- components: Library (Lib) messages: 391190 nosy: vstinner priority: normal severity: normal status: open title: warnings: -W option and PYTHONWARNINGS now use the message as a regex versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 09:10:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 13:10:40 +0000 Subject: [issue43863] [Windows] test_distutils logs: DeprecationWarning: bdist_msi command is deprecated since Python 3.9, use bdist_wheel (wheel packages) instead Message-ID: <1618578640.73.0.80306334611.issue43863@roundup.psfhosted.org> New submission from STINNER Victor : On Windows, test_distutils logs the warning: DeprecationWarning: "bdist_msi command is deprecated (...)". Example: vstinner at DESKTOP-DK7VBIL C:\vstinner\python\master>python -m test -v test_distutils (...) test_skip_build (distutils.tests.test_bdist.BuildTestCase) ... C:\vstinner\python\master\lib\distutils\dist.py:858: DeprecationWarning: bdist_msi command is deprecated since Python 3.9, use bdist_wheel (wheel packages) instead cmd_obj = self.command_obj[command] = klass(self) ok (...) ---------- components: Tests messages: 391191 nosy: vstinner priority: normal severity: normal status: open title: [Windows] test_distutils logs: DeprecationWarning: bdist_msi command is deprecated since Python 3.9, use bdist_wheel (wheel packages) instead versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 09:10:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 13:10:51 +0000 Subject: [issue43863] [Windows] test_distutils logs: DeprecationWarning: bdist_msi command is deprecated since Python 3.9, use bdist_wheel (wheel packages) instead In-Reply-To: <1618578640.73.0.80306334611.issue43863@roundup.psfhosted.org> Message-ID: <1618578651.35.0.97056374039.issue43863@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 09:12:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 13:12:55 +0000 Subject: [issue43864] [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead Message-ID: <1618578775.46.0.785924432695.issue43864@roundup.psfhosted.org> New submission from STINNER Victor : On Windows, test_importlib logs "DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated (...)". Example: vstinner at DESKTOP-DK7VBIL C:\vstinner\python\master>python -m test -v test_importlib (...) test_find_module_missing (test.test_importlib.test_windows.Frozen_WindowsRegistryFinderTests) ... :848: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead ok (...) test_find_module_missing (test.test_importlib.test_windows.Source_WindowsRegistryFinderTests) ... C:\vstinner\python\master\lib\importlib\_bootstrap_external.py:848: DeprecationWarning: WindowsRegistryFinder.find_module() is de precated and slated for removal in Python 3.12; use find_spec() instead _warnings.warn("WindowsRegistryFinder.find_module() is deprecated and " ok (...) ---------- components: Tests, Windows messages: 391192 nosy: brett.cannon, paul.moore, steve.dower, tim.golden, vstinner, xtreak, zach.ware priority: normal severity: normal status: open title: [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 09:17:08 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 16 Apr 2021 13:17:08 +0000 Subject: [issue43862] warnings: -W option and PYTHONWARNINGS now use the message as a regex In-Reply-To: <1618578407.09.0.811659309688.issue43862@roundup.psfhosted.org> Message-ID: <1618579028.98.0.656234308032.issue43862@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: See also https://bugs.python.org/issue34624 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 09:18:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 13:18:52 +0000 Subject: [issue43862] warnings: -W option and PYTHONWARNINGS now use the message as a regex In-Reply-To: <1618578407.09.0.811659309688.issue43862@roundup.psfhosted.org> Message-ID: <1618579132.91.0.977783878099.issue43862@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +24169 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25439 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 09:19:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 13:19:32 +0000 Subject: [issue43862] warnings: -W option and PYTHONWARNINGS now use the message as a regex In-Reply-To: <1618578407.09.0.811659309688.issue43862@roundup.psfhosted.org> Message-ID: <1618579172.95.0.420124328936.issue43862@roundup.psfhosted.org> STINNER Victor added the comment: Sadly, the current -W option documentation is wrong :-( I started by writing PR 25439 to fix the documentation, before changing its behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 09:22:38 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 16 Apr 2021 13:22:38 +0000 Subject: [issue38748] 32 bit ctypes stdcall callback fails to restore stack pointer In-Reply-To: <1573232254.38.0.286098798289.issue38748@roundup.psfhosted.org> Message-ID: <1618579358.43.0.96028312397.issue38748@roundup.psfhosted.org> Steve Dower added the comment: My previous post still stands. This requires a test and then (hopefully) a fix in ctypes or (potentially) a fix upstream in libffi. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 09:44:56 2021 From: report at bugs.python.org (hai shi) Date: Fri, 16 Apr 2021 13:44:56 +0000 Subject: [issue43845] test_concurrent_futures leaks many dangling threads on FreeBSD In-Reply-To: <1618401460.69.0.519102056132.issue43845@roundup.psfhosted.org> Message-ID: <1618580696.22.0.285828965258.issue43845@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 09:49:45 2021 From: report at bugs.python.org (David Heffernan) Date: Fri, 16 Apr 2021 13:49:45 +0000 Subject: [issue38748] 32 bit ctypes stdcall callback fails to restore stack pointer In-Reply-To: <1573232254.38.0.286098798289.issue38748@roundup.psfhosted.org> Message-ID: <1618580985.77.0.014813817269.issue38748@roundup.psfhosted.org> David Heffernan added the comment: @Steve as a user of Python rather than a Python developer, I don't know what the process here. I understand the need for a test, and then a fix. And I would not be surprised if the act of fixing the issue led to a broadening of the test if the scope of the defect turns out to be wider than noted in the comments so far. What is the process for a resolution to the issue being found. You've outlined the steps required, but how will they happen? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 09:54:16 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 16 Apr 2021 13:54:16 +0000 Subject: [issue38748] 32 bit ctypes stdcall callback fails to restore stack pointer In-Reply-To: <1573232254.38.0.286098798289.issue38748@roundup.psfhosted.org> Message-ID: <1618581256.18.0.711752630332.issue38748@roundup.psfhosted.org> Christian Heimes added the comment: It would help us if you or Michael could provide a minimal reproducer of the crash in form of a unit test and submit it as pull request. ---------- nosy: +christian.heimes versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 09:56:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 13:56:00 +0000 Subject: [issue43862] warnings: -W option and PYTHONWARNINGS now use the message as a regex In-Reply-To: <1618578407.09.0.811659309688.issue43862@roundup.psfhosted.org> Message-ID: <1618581360.09.0.951514028874.issue43862@roundup.psfhosted.org> STINNER Victor added the comment: > Sadly, the current -W option documentation is wrong :-( I started by writing PR 25439 to fix the documentation, before changing its behavior. Hum, "wrong" may be too strong. I would say that it is at least misleading. It starts with "file:line: category: message". I understood that it was the format the option, whereas it is not. Moreover, the full format is simply... not documented at all! Only the short -Waction format :-( https://docs.python.org/dev/using/cmdline.html#cmdoption-W ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 10:00:31 2021 From: report at bugs.python.org (Michael Dudley) Date: Fri, 16 Apr 2021 14:00:31 +0000 Subject: [issue43865] win32_ver and getwindowsversion return different Windows 10 build numbers Message-ID: <1618581631.1.0.315230933416.issue43865@roundup.psfhosted.org> New submission from Michael Dudley : On my machine platform.win32_ver() and sys.getwindowsversion() are returning different Windows build numbers. I have confirmed this with Python 3.7.6, 3.8.5, and 3.9.2 (all 64-bit) on Windows 10. platform.win32_ver() returns: ('10', '10.0.18362', 'SP0', '') sys.getwindowsversion() returns: major=10, minor=0, build=18363, platform=2, service_pack='' The sys.getwindowsversion() value is correct. The Windows About panel reports Windows 10 Enterprise, version 1909, build 18363.1440. My kernel32.dll version is 10.0.18362.1350. ---------- components: Library (Lib), Windows messages: 391199 nosy: emddudley, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: win32_ver and getwindowsversion return different Windows 10 build numbers type: behavior versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 10:06:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 14:06:46 +0000 Subject: [issue43842] test_logging: "OSError: [Errno 9] Bad file descriptor" logged on FreeBSD In-Reply-To: <1618398916.84.0.57759722491.issue43842@roundup.psfhosted.org> Message-ID: <1618582006.3.0.794094942557.issue43842@roundup.psfhosted.org> STINNER Victor added the comment: New changeset e1903e11a3d42512effe336026e0c67f602e5848 by Victor Stinner in branch '3.9': bpo-43842: Fix race condition in test_logging SMTP test (GH-25436) (GH-25437) https://github.com/python/cpython/commit/e1903e11a3d42512effe336026e0c67f602e5848 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 10:07:03 2021 From: report at bugs.python.org (Muhammad Hussein Ammari) Date: Fri, 16 Apr 2021 14:07:03 +0000 Subject: [issue43866] Installation files of the Python Message-ID: <1618582023.9.0.574924434196.issue43866@roundup.psfhosted.org> New submission from Muhammad Hussein Ammari : I have WhatsApp installed for all users. (on %ProgramFiles%) Unfortunately, I just saw that installation files of the Python are stored on "%LocalAppData%\Package Cache". Installation files should be stored on "%ProgramData%\Package Cache". The problem now is that other users can no longer delete or update Python. Please fix this issue. Thanks. ---------- components: Installation, Windows files: Untitled.png messages: 391201 nosy: paul.moore, steve.dower, tim.golden, xmha97, zach.ware priority: normal severity: normal status: open title: Installation files of the Python type: enhancement versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file49964/Untitled.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 10:08:48 2021 From: report at bugs.python.org (Muhammad Hussein Ammari) Date: Fri, 16 Apr 2021 14:08:48 +0000 Subject: [issue43866] Installation files of the Python In-Reply-To: <1618582023.9.0.574924434196.issue43866@roundup.psfhosted.org> Message-ID: <1618582128.18.0.795197981812.issue43866@roundup.psfhosted.org> Muhammad Hussein Ammari added the comment: Sorry, I have Python installed for all users. (not WhatsApp) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 10:08:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 14:08:56 +0000 Subject: [issue43842] test_logging: "OSError: [Errno 9] Bad file descriptor" logged on FreeBSD In-Reply-To: <1618398916.84.0.57759722491.issue43842@roundup.psfhosted.org> Message-ID: <1618582136.16.0.0150458382443.issue43842@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24170 pull_request: https://github.com/python/cpython/pull/25440 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 10:17:23 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 16 Apr 2021 14:17:23 +0000 Subject: [issue43817] Add typing.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1618582643.55.0.0510121198283.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: > Should this feature implemented in typing module? How about inspect module? That's a reasonable idea. Part of the reasoning behind putting it in the typing module was to share its implementation with typing.get_type_hints(). However, I was reading the source to typing.get_type_hints() yesterday, and its implementation is completely based on the assumption that the annotations are type hints. It might be possible to rework its implementation to isolate these assumptions, but the remaining shared code would be probably less than fifty lines. So the code reuse isn't a big deal. If the two functions don't share an implementation, you're right, the inspect module is probably a better place for this new function. > Additionally, how about adding `get_annotation_str()`, which returns str always? Some use cases (e.g. `help(f)`) need just string. I want to skip eval() in it. I don't know if I'd want to add a third function. Perhaps a parameter to get_annotation? eval_str=True? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 10:37:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 14:37:13 +0000 Subject: [issue43842] test_logging: "OSError: [Errno 9] Bad file descriptor" logged on FreeBSD In-Reply-To: <1618398916.84.0.57759722491.issue43842@roundup.psfhosted.org> Message-ID: <1618583833.85.0.99287372881.issue43842@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 816da333c8ee848dab7c830c561b8df0b8d23915 by Victor Stinner in branch '3.8': bpo-43842: Fix race condition in test_logging SMTP test (GH-25436) (GH-25437) (GH-25440) https://github.com/python/cpython/commit/816da333c8ee848dab7c830c561b8df0b8d23915 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 10:37:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 14:37:42 +0000 Subject: [issue43842] test_logging: "OSError: [Errno 9] Bad file descriptor" logged on FreeBSD In-Reply-To: <1618398916.84.0.57759722491.issue43842@roundup.psfhosted.org> Message-ID: <1618583862.3.0.0215930296198.issue43842@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 10:41:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 14:41:31 +0000 Subject: [issue43867] concurrent.futures: handle explicitly SystemExit in managers.Server Message-ID: <1618584091.17.0.579971617999.issue43867@roundup.psfhosted.org> New submission from STINNER Victor : In bpo-43843, I modified libregrtest to log a warning if a thread raises an uncaught exception. test_concurrent_futures now logs two warnings. s390x Debian 3.x: https://buildbot.python.org/all/#/builders/49/builds/1124 AMD64 RHEL7 3.x: https://buildbot.python.org/all/#/builders/15/builds/1074 0:03:18 load avg: 4.78 [302/427] test_concurrent_futures passed (2 min 46 sec) -- running: test_tokenize (37.8 sec), test_peg_generator (59.2 sec) Warning -- Uncaught thread exception: SystemExit Warning -- Uncaught thread exception: SystemExit The problem can be seen with test_ressources_gced_in_workers(): $ ./python -m test test_concurrent_futures -m test.test_concurrent_futures.ProcessPoolForkProcessPoolExecutorTest.test_ressources_gced_in_workers -v (...) test_ressources_gced_in_workers (test.test_concurrent_futures.ProcessPoolForkProcessPoolExecutorTest) ... Warning -- Uncaught thread exception: SystemExit Warning -- Uncaught thread exception: SystemExit (...) Tests result: SUCCESS I propose to explicitly catch this SystemExit. We can take the opportunity to call c.close() explicitly: see attached PR. ---------- components: Library (Lib) messages: 391205 nosy: bquinlan, davin, pablogsal, pitrou, vstinner priority: normal severity: normal status: open title: concurrent.futures: handle explicitly SystemExit in managers.Server versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 10:47:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 14:47:42 +0000 Subject: [issue43867] concurrent.futures: handle explicitly SystemExit in managers.Server In-Reply-To: <1618584091.17.0.579971617999.issue43867@roundup.psfhosted.org> Message-ID: <1618584462.67.0.663909633377.issue43867@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +24171 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25441 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 10:48:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 14:48:15 +0000 Subject: [issue43867] multiprocess: catch explicitly SystemExit in the Server class In-Reply-To: <1618584091.17.0.579971617999.issue43867@roundup.psfhosted.org> Message-ID: <1618584495.89.0.327711273358.issue43867@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: concurrent.futures: handle explicitly SystemExit in managers.Server -> multiprocess: catch explicitly SystemExit in the Server class _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 10:48:28 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 16 Apr 2021 14:48:28 +0000 Subject: [issue43868] Remove PyOS_ReadlineFunctionPointer from the stable ABI list Message-ID: <1618584508.44.0.195246221039.issue43868@roundup.psfhosted.org> New submission from Petr Viktorin : The inclusion of PyOS_ReadlineFunctionPointer in python3dll.c (*) was a mistake. According to PEP 384: > functions expecting FILE* are not part of the ABI, to avoid depending on a specific version of the Microsoft C runtime DLL on Windows. The situation may have changed and it might be reasonable to revisit this decision, but that would call for a larger discussion. There are FILE*-taking functions that are probably much ore useful than this one. (But, I think it's a good idea to limit the stable ABI to file-like Python objects anyway.) I see PEP 384 as being definitive (where it's not ambiguous). The python3dll.c list and public/private headers do not actually define the stable ABI. So, I'd like to remove the function from the list. --- (*) it was actually PC/python3.def in 3.2 ---------- components: C API, Windows messages: 391206 nosy: paul.moore, petr.viktorin, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Remove PyOS_ReadlineFunctionPointer from the stable ABI list versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 10:48:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 14:48:48 +0000 Subject: [issue43867] multiprocess: catch explicitly SystemExit in the Server class In-Reply-To: <1618584091.17.0.579971617999.issue43867@roundup.psfhosted.org> Message-ID: <1618584528.39.0.64817776251.issue43867@roundup.psfhosted.org> STINNER Victor added the comment: Oh sorry, I was confused. While the issue is seen in test_concurrent_futures, my PR 25441 changes the multiprocessing module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 10:50:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 14:50:04 +0000 Subject: [issue43843] libregrtest: mark a test as failed if a thread logs an unexpected exception In-Reply-To: <1618399223.2.0.989011891247.issue43843@roundup.psfhosted.org> Message-ID: <1618584604.85.0.741181368685.issue43843@roundup.psfhosted.org> STINNER Victor added the comment: test_concurrent_futures logs two warnings: I created bpo-43867 for this one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:00:25 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 16 Apr 2021 15:00:25 +0000 Subject: [issue43868] Remove PyOS_ReadlineFunctionPointer from the stable ABI list In-Reply-To: <1618584508.44.0.195246221039.issue43868@roundup.psfhosted.org> Message-ID: <1618585225.95.0.213682239812.issue43868@roundup.psfhosted.org> Change by Petr Viktorin : ---------- keywords: +patch pull_requests: +24172 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25442 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:00:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 15:00:49 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1618585249.7.0.724833118488.issue42238@roundup.psfhosted.org> STINNER Victor added the comment: I wrote a PR to enhance -W option documentation. The suspicious job complains whereas my Sphinx format is valid: The full form of argument is:: action:message:category:module:lineno Example of suspicious error: [using/cmdline:438] ":message" found in "action:message:category:module:lineno" I see that Doc/tools/suspicious.csv already contains an ignore rule for Doc/using/cmdline.rst. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:07:25 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 16 Apr 2021 15:07:25 +0000 Subject: [issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument In-Reply-To: <1615387121.09.0.336024174905.issue43463@roundup.psfhosted.org> Message-ID: <1618585645.59.0.116223318374.issue43463@roundup.psfhosted.org> Guido van Rossum added the comment: Hey Larry, it would seem that PEP 649 as currently specified would make it impossible to access annotations via the inspect module in cases where x.__annotations__ raises (because one of the annotations references an undefined variable). I really think that we need *some* way of accessing partial annotations. Even just leaving the failing key out of __annotations__ (but keeping other keys if their annotation works) would be better than failing to return an __annotations__ dict at all. ---------- nosy: +larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:06:42 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Apr 2021 15:06:42 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618585602.76.0.589775599451.issue38530@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24173 pull_request: https://github.com/python/cpython/pull/25443 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:09:48 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 16 Apr 2021 15:09:48 +0000 Subject: [issue43865] win32_ver and getwindowsversion return different Windows 10 build numbers In-Reply-To: <1618581631.1.0.315230933416.issue43865@roundup.psfhosted.org> Message-ID: <1618585788.82.0.802204141968.issue43865@roundup.psfhosted.org> Shreyan Avigyan added the comment: I'm also able to reproduce the problem you just described. It's actually not the fault of platform.win32_ver. Just type in sys.getwindowsversion().platform_version and you'll achieve a similar result. Behind the scenes platform.win32_ver is actually deriving it's result from sys.getwindowsversion().platform_version. I'm not sure if the result is intended or is a bug but Microsoft seems to claim in this post https://answers.microsoft.com/en-us/insider/forum/insider_wintp-insider_install-insiderplat_pc/wrong-version-of-kernel32dll-in-win10-insider/b0053ba0-f6e5-48f1-86e3-ddac28d6c4eb that both builds are same just the versions are different. ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:09:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 15:09:54 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1618585794.76.0.968499711523.issue42238@roundup.psfhosted.org> STINNER Victor added the comment: > Doc/tools/extensions/suspicious.py is a CPython specific extension, it's not part of Sphinx. Maybe someone should open a feature request on Sphinx to get a similar feature without false positives (or at least less false positives). This extension was written by Gabriel Genellina in 2009 when he discovered that: Several documents contain invalid reST markup that "leaks" into the html output (missing ``, incorrect indentation, etc.) Extension added in bpo-4811 with: commit 700cf28f410521066f40671f1da7db0302d753fd Author: Georg Brandl Date: Sun Jan 4 10:23:49 2009 +0000 Add "suspicious" builder which finds leftover markup in the HTML files. Patch by Gabriel Genellina. The code didn't evolved much since it was added in 2009. Main changes. commit 144c269cc8b82ab3b877797e1c7c26b0849e2b56 Author: Ezio Melotti Date: Thu Mar 28 18:01:11 2013 +0200 Update the suspicious builder to detect unused rules, and remove currently unusued rules. bpo-22537: commit 14b5a4da2732d3464c6b40527458005ccf19f95c Author: Georg Brandl Date: Thu Oct 2 08:26:26 2014 +0200 Closes #22537: Make sphinx extensions compatible with Python 2 or 3, like in the 3.x branches Filename renamed: * master: Doc/tools/extensions/suspicious.py * Commit 160cbce92adc3ccbe4ae6e231ea27fb5ff28dca9 renames Doc/tools/suspicious.py to Doc/tools/extensions/suspicious.py * Commit f16fbf940fdaec594eb1f4c5f9c61e926db53c5d renames Doc/tools/sphinxext/suspicious.py to Doc/tools/suspicious.py ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:10:03 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 16 Apr 2021 15:10:03 +0000 Subject: [issue43817] Add typing.get_annotations() In-Reply-To: <1618582643.55.0.0510121198283.issue43817@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Also, for crosslinking, see issue43463. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:11:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Apr 2021 15:11:51 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618585911.09.0.601065218787.issue38530@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24174 pull_request: https://github.com/python/cpython/pull/25444 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:15:58 2021 From: report at bugs.python.org (Ofek Lev) Date: Fri, 16 Apr 2021 15:15:58 +0000 Subject: [issue43869] Fix documentation of epoch/time.time Message-ID: <1618586158.57.0.649486184749.issue43869@roundup.psfhosted.org> New submission from Ofek Lev : The descriptions for the following: - https://docs.python.org/3/library/time.html#epoch - https://docs.python.org/3/library/time.html#time.time indicate that it is platform dependent. However, that is likely untrue. See the brief discussion here: https://github.com/DataDog/integrations-core/pull/6692#discussion_r427469097 ---------- assignee: docs at python components: Documentation messages: 391214 nosy: Ofekmeister, docs at python, p-ganssle priority: normal severity: normal status: open title: Fix documentation of epoch/time.time type: enhancement versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:21:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 15:21:01 +0000 Subject: [issue43869] Fix documentation of epoch/time.time In-Reply-To: <1618586158.57.0.649486184749.issue43869@roundup.psfhosted.org> Message-ID: <1618586461.92.0.770617533994.issue43869@roundup.psfhosted.org> STINNER Victor added the comment: On Windows 10 (build 20H2), I get: Python 3.10.0a7+ (heads/master:b136b1aac4, Apr 16 2021, 14:36:39) [MSC v.1928 64 bit (AMD64)] on win32 >>> import time >>> time.gmtime(0) time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=0) ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:22:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 15:22:52 +0000 Subject: [issue43869] Fix documentation of epoch/time.time In-Reply-To: <1618586158.57.0.649486184749.issue43869@roundup.psfhosted.org> Message-ID: <1618586572.72.0.972216537442.issue43869@roundup.psfhosted.org> STINNER Victor added the comment: time.time doc says "On Windows and most Unix systems, the epoch is January 1, 1970, 00:00:00 (UTC)" The epoch doc says "For Unix, the epoch is January 1, 1970, 00:00:00 (UTC)". At least, the epoch doc can be completed to also mention that it's the same on Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:25:38 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 16 Apr 2021 15:25:38 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1618586738.01.0.664255583286.issue43795@roundup.psfhosted.org> Petr Viktorin added the comment: Opened as a separate issue: bpo-43868, Remove PyOS_ReadlineFunctionPointer from the stable ABI list ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:31:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 15:31:39 +0000 Subject: [issue43869] Fix documentation of epoch/time.time In-Reply-To: <1618586158.57.0.649486184749.issue43869@roundup.psfhosted.org> Message-ID: <1618587099.25.0.575823848681.issue43869@roundup.psfhosted.org> STINNER Victor added the comment: "platform dependent" was added in 2017 by the commit (bpo-29026): commit 23557d59b819f57800ddef0b1373acef8e024670 Author: Eric Appelt Date: Thu Feb 16 05:00:45 2017 -0500 bpo-29026: Clarify documentation of time.time (#34) * bpo-29026: Clarity documentation of time.time Clarify the documentation of time.time by more precisely defining what is meant by "seconds since the epoch" on most platforms. Additionally explain how gmtime and localtime may be used to extract calendar components and convert to a more common date format. * bpo-29026: Minor improvements for time.time doc * bpo-29026: Consistency fixes for time.time doc --- MS-DOS (no longer supported by Python since 2014) uses 1980-01-01 epoch. The Windows FILETIME type uses 1601-01-01 epoch. Python has convention functions to the Unix 1970-01-01 Epoch: static __int64 secs_between_epochs = 11644473600; /* Seconds between 1.1.1601 and 1.1.1970 */ static void FILE_TIME_to_time_t_nsec(FILETIME *in_ptr, time_t *time_out, int* nsec_out) { /* XXX endianness. Shouldn't matter, as all Windows implementations are little-endian */ /* Cannot simply cast and dereference in_ptr, since it might not be aligned properly */ __int64 in; memcpy(&in, in_ptr, sizeof(in)); *nsec_out = (int)(in % 10000000) * 100; /* FILETIME is in units of 100 nsec. */ *time_out = Py_SAFE_DOWNCAST((in / 10000000) - secs_between_epochs, __int64, time_t); } void _Py_time_t_to_FILE_TIME(time_t time_in, int nsec_in, FILETIME *out_ptr) { /* XXX endianness */ __int64 out; out = time_in + secs_between_epochs; out = out * 10000000 + nsec_in / 100; memcpy(out_ptr, &out, sizeof(out)); } More epochs for more fun: https://en.wikipedia.org/wiki/Epoch_(computing)#Notable_epoch_dates_in_computing ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:38:58 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 16 Apr 2021 15:38:58 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1618587538.49.0.0495282969172.issue43284@roundup.psfhosted.org> Change by Eryk Sun : ---------- stage: -> needs patch title: Inability to fetch build 20H2 -> sys.getwindowsversion().platform_version is incorrect versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:39:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Apr 2021 15:39:12 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618587552.62.0.230340116496.issue38530@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 3b82cae774638ecf2baaee8fe2cac8fedafb2ca7 by Pablo Galindo in branch 'master': bpo-38530: Properly extend UnboundLocalError from NameError (GH-25444) https://github.com/python/cpython/commit/3b82cae774638ecf2baaee8fe2cac8fedafb2ca7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:39:41 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 16 Apr 2021 15:39:41 +0000 Subject: [issue43865] win32_ver and getwindowsversion return different Windows 10 build numbers In-Reply-To: <1618581631.1.0.315230933416.issue43865@roundup.psfhosted.org> Message-ID: <1618587581.73.0.222347346981.issue43865@roundup.psfhosted.org> Change by Eryk Sun : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> sys.getwindowsversion().platform_version is incorrect _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:50:14 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 16 Apr 2021 15:50:14 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1618588214.18.0.623364443133.issue43284@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:53:05 2021 From: report at bugs.python.org (Ian H) Date: Fri, 16 Apr 2021 15:53:05 +0000 Subject: [issue43870] C API Functions Bypass __import__ Override Message-ID: <1618588385.66.0.211694514597.issue43870@roundup.psfhosted.org> New submission from Ian H : Some of the import-related C API functions are documented as bypassing an override to builtins.__import__. This appears to be the case, but the documentation is incomplete in this regard. For example, PyImport_ImportModule is implemented by calling PyImport_Import which does respect an override to builtins.__import__, but PyImport_ImportModule doesn't mention respecting an override. On the other hand some routines (like?PyImport_ImportModuleLevelObject) do not respect an override to the builtin import. Is this something that people are open to having fixed? I've been working on an academic project downstream that involved some overrides to the __import__ machinery (I haven't figured out a way to do this with just import hooks) and having some modules skip going through our override threw us for a bad debugging loop. The easiest long-term fix from our perspective is to patch the various PyImport routines?to always respect an __import__ override. This technically is a backwards compatibility break, but I'm unsure if anyone is actually relying on the fact that specific C API functions bypass builtins.__import__ entirely. It seems more likely that the current behavior will cause bugs downstream like it did for us. ---------- messages: 391220 nosy: Ian.H priority: normal severity: normal status: open title: C API Functions Bypass __import__ Override type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 11:58:25 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 16 Apr 2021 15:58:25 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1618588705.07.0.133368520819.issue43284@roundup.psfhosted.org> Shreyan Avigyan added the comment: When we're talking about version are we talking about the kernel32.dll version or the Windows version? If we're talking about Windows version then why not use the return value of sys.getwindowsversion() itself? How is that function getting the Windows version? Moreover shouldn't the documentation provide the information that sys.getwindowsversion().platform_version returns the kernel32.dll version? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 12:01:10 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 16 Apr 2021 16:01:10 +0000 Subject: [issue43817] Add typing.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1618588870.87.0.60075527996.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: Assuming this function is added for Python 3.10, I propose that uses of typing.get_type_hints() in the standard library that aren't specifically dealing with type hints should change to calling this function instead. I currently know of two sites: * inspect.signature() * functools.singledispatch() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 12:12:07 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Apr 2021 16:12:07 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618589527.15.0.412499145073.issue38530@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0ad81d4db2f409d72f469d0b74ab597be772a68e by Pablo Galindo in branch 'master': bpo-38530: Match exactly AttributeError and NameError when offering suggestions (GH-25443) https://github.com/python/cpython/commit/0ad81d4db2f409d72f469d0b74ab597be772a68e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 12:19:29 2021 From: report at bugs.python.org (Zackery Spytz) Date: Fri, 16 Apr 2021 16:19:29 +0000 Subject: [issue43856] Docs for importlib.metadata should mention Python version In-Reply-To: <1618502050.6.0.847154133714.issue43856@roundup.psfhosted.org> Message-ID: <1618589969.67.0.477283065998.issue43856@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 7.0 -> 8.0 pull_requests: +24175 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25445 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 12:20:23 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 16 Apr 2021 16:20:23 +0000 Subject: [issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument In-Reply-To: <1615387121.09.0.336024174905.issue43463@roundup.psfhosted.org> Message-ID: <1618590023.82.0.656456922038.issue43463@roundup.psfhosted.org> Larry Hastings added the comment: > Hey Larry, it would seem that PEP 649 as currently specified would make it impossible to access annotations via the inspect module in cases where x.__annotations__ raises (because one of the annotations references an undefined variable). That's true. If PEP 649 is accepted, inspect.signature() might want to catch NameError when examining __annotations__ on the object. Though I'm not sure what it should do when the exception is raised. > I really think that we need *some* way of accessing partial annotations. Even just leaving the failing key out of __annotations__ (but keeping other keys if their annotation works) would be better than failing to return an __annotations__ dict at all. Unfortunately I don't agree--"errors should never pass silently." Silently omitting the failed annotation seems like it would be a bad experience. What if the value you needed from the annotation was the one that was omitted? Now you have a mystery obscuring your existing problem. There is a PR against PEP 649 specifically to suppress NameErrors: https://github.com/larryhastings/co_annotations/pull/3 I haven't merged the PR as I don't agree with it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 12:08:19 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 16 Apr 2021 16:08:19 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1618589299.67.0.0715731779413.issue43795@roundup.psfhosted.org> Petr Viktorin added the comment: I unsure about the following symbols. Victor, do you think they should be part of the stable ABI? - PyThreadState_DeleteCurrent - Py_GetArgcArgv - PyInterpreterState_GetID ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 12:46:32 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 16:46:32 +0000 Subject: [issue41163] test_weakref hangs In-Reply-To: <1593452107.04.0.340745139309.issue41163@roundup.psfhosted.org> Message-ID: <1618591592.44.0.836942403236.issue41163@roundup.psfhosted.org> Irit Katriel added the comment: Python 36. is no longer maintained. Are you seeing this issue with a more recent version? ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 12:50:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 16:50:04 +0000 Subject: [issue30898] SSL cert failure running make test during Python 3.6 install In-Reply-To: <1499752922.62.0.288067889565.issue30898@psf.upfronthosting.co.za> Message-ID: <1618591804.15.0.782664169867.issue30898@roundup.psfhosted.org> Irit Katriel added the comment: Python 3.6 is no longer maintained. Are you seeing this on a more recent version? ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 12:52:18 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 16 Apr 2021 16:52:18 +0000 Subject: [issue43817] Add typing.get_annotations() In-Reply-To: <1618588870.87.0.60075527996.issue43817@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Putting it in inspect makes sense then. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 12:58:47 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 16 Apr 2021 16:58:47 +0000 Subject: [issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument In-Reply-To: <1615387121.09.0.336024174905.issue43463@roundup.psfhosted.org> Message-ID: <1618592327.94.0.71608277063.issue43463@roundup.psfhosted.org> Guido van Rossum added the comment: If the NameError were to leave behind a marker wrapping the string, that might allow the best of both worlds -- errors don't pass *silently* (an error value is returned) and you can still inspect the other annotations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 13:01:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 17:01:31 +0000 Subject: [issue29799] Add tests for header API of 'urllib.request.Request' class In-Reply-To: <1489357967.78.0.336863380753.issue29799@psf.upfronthosting.co.za> Message-ID: <1618592491.25.0.0651737184707.issue29799@roundup.psfhosted.org> Irit Katriel added the comment: Jaysinh, I see you closed the PR. Did you intend to close this issue as well or are you still planning to work on this? ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 13:07:48 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 16 Apr 2021 17:07:48 +0000 Subject: [issue42967] [CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator In-Reply-To: <1611068809.96.0.58823274544.issue42967@roundup.psfhosted.org> Message-ID: <1618592868.69.0.334425494898.issue42967@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset d5b80eb11b4812b4a579ce129ba4a10c5f5d27f6 by Miss Islington (bot) in branch '3.8': bpo-42967: coerce bytes separator to string in urllib.parse_qs(l) (GH-24818) (#25345) https://github.com/python/cpython/commit/d5b80eb11b4812b4a579ce129ba4a10c5f5d27f6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 13:10:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 17:10:04 +0000 Subject: [issue41163] test_weakref hangs In-Reply-To: <1593452107.04.0.340745139309.issue41163@roundup.psfhosted.org> Message-ID: <1618593004.78.0.571263870064.issue41163@roundup.psfhosted.org> STINNER Victor added the comment: > Command make hangs on test_weakref You don't provide enough information to investigate. You should re-run tests in verbose mode and use --timeout=60 to get a traceback where the test hangs. Since Python 3.6, the test suite (in general) got tons of fixes to make tests more reliable, and so it sounds likely that your issue has been fixed in the meanwhile. https://bugs.python.org/issue29796 was specific to Python 2.7 which sounds time.sleep() argument towards zero. In Python 3.6, the argument is rounded away from zero. I close the issue. Reopen the issue if you can still reproduce it on Python 3.10. ---------- nosy: +vstinner stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 13:12:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 17:12:21 +0000 Subject: [issue43862] warnings: -W option and PYTHONWARNINGS now use the message as a regex In-Reply-To: <1618578407.09.0.811659309688.issue43862@roundup.psfhosted.org> Message-ID: <1618593141.84.0.0453206806389.issue43862@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 62ec63864822de1dd1933225584e8503ac40c1f9 by Victor Stinner in branch 'master': bpo-43862: Enhance -W cmdline option documentation (GH-25439) https://github.com/python/cpython/commit/62ec63864822de1dd1933225584e8503ac40c1f9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 13:18:30 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 16 Apr 2021 17:18:30 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1618593510.88.0.973079545407.issue43284@roundup.psfhosted.org> Eryk Sun added the comment: > shouldn't the documentation provide the information that > sys.getwindowsversion().platform_version returns the > kernel32.dll version? platform_version is documented as an "accurate major version, minor version and build number of the current operating system, rather than the version that is being emulated for the process". That's it's currently using the file version of "kernel32.dll" is an implementation detail, one that needs to be changed to something more reliable. Keep in mind that the Python DLL can be embedded in any application, which may not be manifested to get the true OS version via GetVersionExW(). For example, when running in Windows 10, the default with no manifest reports Windows 8 (NT 6.2): >>> sys.getwindowsversion() sys.getwindowsversion(major=6, minor=2, build=9200, platform=2, service_pack='') Here it is with a manifest that supports Windows 8.1 (NT 6.3): >>> sys.getwindowsversion() sys.getwindowsversion(major=6, minor=3, build=9600, platform=2, service_pack='') This is the OS version that's relevant to the application, but for logging and other diagnostics, platform_version is provided to get the real version, at least if all goes according to plan. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 13:23:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 17:23:35 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1618593815.46.0.649510723858.issue43795@roundup.psfhosted.org> STINNER Victor added the comment: > PyThreadState_DeleteCurrent No. bpo-37878 explicitly excluded it from the limited C API. IMO it's too close to the CPython implementation and so must not be added to the stable ABI. > Py_GetArgcArgv No. Python 3.10 now provides sys.orig_argv which can be read in C. https://docs.python.org/dev/library/sys.html#sys.orig_argv Py_GetArgcArgv() is part of the "legacy" C API to initialize Python. The "new" PyConfig API provides PyConfig.orig_argv. FYI in the PyPI top 4000 projects, the function seems to be called by the following projects: 2021-02-18/uWSGI-2.0.19.1.tar.gz 2021-02-18/stem-1.8.0.tar.gz 2021-02-18/sphinx-gallery-0.8.2.tar.gz 2021-02-18/setproctitle-1.2.2.tar.gz 2021-02-18/pyuwsgi-2.0.19.1.post0.tar.gz 2021-02-18/mercurial-5.7.tar.gz 2021-02-18/httpretty-1.0.5.tar.gz 2021-02-18/CherryPy-18.6.0.tar.gz 2021-02-18/aws-encryption-sdk-cli-2.1.0.tar.gz > PyInterpreterState_GetID Yes. It's part of the limited C API. IMO technically, it's ok to add to the stable ABI. I added it to PC/python3dll.c on purpose. Sadly, it's not available on PyPy, but I don't think that the stable ABI must care about PyPy which is a different use case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 13:24:12 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 17:24:12 +0000 Subject: [issue15907] move doctest test-data files into a subdirectory of Lib/test In-Reply-To: <1347296459.35.0.660655246065.issue15907@psf.upfronthosting.co.za> Message-ID: <1618593852.33.0.159621119907.issue15907@roundup.psfhosted.org> Irit Katriel added the comment: The patch needs to be converted into a github PR. ---------- keywords: +easy nosy: +iritkatriel stage: patch review -> needs patch versions: +Python 3.10 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 13:28:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 17:28:05 +0000 Subject: [issue43868] Remove PyOS_ReadlineFunctionPointer from the stable ABI list In-Reply-To: <1618584508.44.0.195246221039.issue43868@roundup.psfhosted.org> Message-ID: <1618594085.82.0.157931032949.issue43868@roundup.psfhosted.org> STINNER Victor added the comment: Yes, please remove it from the limited C API. PyOS_ReadlineFunctionPointer has a bad API. I fixed recently PyOS_StdioReadline because it used the Python C API without holding the GIL. To acquire the GIL, you need to access a *private* _PyOS_ReadlineTState variable which is kind of unfortunate :-( commit c353764fd564e401cf47a5d9efab18c72c60014e Author: Victor Stinner Date: Mon Jun 1 20:59:35 2020 +0200 bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579) Fix GIL usage in PyOS_Readline(): lock the GIL to set an exception. Pass tstate to my_fgets() and _PyOS_WindowsConsoleReadline(). Cleanup these functions. See also: commit fa7ab6aa0f9a4f695e5525db5a113cd21fa93787 Author: Victor Stinner Date: Wed Jun 3 14:39:59 2020 +0200 bpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599) my_fgets() now calls _PyOS_InterruptOccurred(tstate) to check for pending signals, rather calling PyOS_InterruptOccurred(). my_fgets() is called with the GIL released, whereas PyOS_InterruptOccurred() must be called with the GIL held. test_repl: use text=True and avoid SuppressCrashReport in test_multiline_string_parsing(). Fix my_fgets() on Windows: fgets(fp) does crash if fileno(fp) is closed. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 13:30:08 2021 From: report at bugs.python.org (Alexei Pastuchov) Date: Fri, 16 Apr 2021 17:30:08 +0000 Subject: [issue43871] urllib.parse.urlparse doesn't check port Message-ID: <1618594208.69.0.606171015487.issue43871@roundup.psfhosted.org> New submission from Alexei Pastuchov : It is possible to get valid ParseResult from the urlparse function even for a non-numeric port value. Only by requesting the port it fails[1]. Would it be an improvement if _checknetloc[2] validates the value of port properly? // code snippet Python 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from urllib.parse import urlparse >>> uri = 'xx://foo:bar' >>> uri_parts = urlparse(uri) >>> uri_parts.netloc 'foo:bar' >>> uri_parts.port Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.8/urllib/parse.py", line 174, in port raise ValueError(message) from None ValueError: Port could not be cast to integer value as 'bar' // code snippet [1] https://github.com/python/cpython/blob/e1903e11a3d42512effe336026e0c67f602e5848/Lib/urllib/parse.py#L172 [2] https://github.com/python/cpython/blob/e1903e11a3d42512effe336026e0c67f602e5848/Lib/urllib/parse.py#L416 ---------- messages: 391238 nosy: palik priority: normal severity: normal status: open title: urllib.parse.urlparse doesn't check port _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 13:39:48 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 16 Apr 2021 17:39:48 +0000 Subject: [issue43872] Unable to compile cpython in Visual Studio 2019 Message-ID: <1618594788.56.0.562957194552.issue43872@roundup.psfhosted.org> New submission from Shreyan Avigyan : Recently, I'm having some problem compiling cpython from Visual Studio 2019. I'm able to compile using the build.bat script. I'm using Visual Studio 2019 for about 2-3 months now for compiling and developing cpython. But unfortunately, some error occurs. While compiling cpython from Visual Studio 2019 the asdl_c.py, if I remember correctly, raises an exception that it was passed no arguments and therefore the build fails. After I compile cpython using build.bat script I'm able to build and rebuild cpython from Visual Studio 2019 without facing any problem for 2-3 days. Then again the error occurs. Can anyone explain to why this is happening? Or is this a bug in cpython? ---------- messages: 391239 nosy: shreyanavigyan priority: normal severity: normal status: open title: Unable to compile cpython in Visual Studio 2019 type: compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 13:42:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 17:42:45 +0000 Subject: [issue43867] multiprocess: catch explicitly SystemExit in the Server class In-Reply-To: <1618584091.17.0.579971617999.issue43867@roundup.psfhosted.org> Message-ID: <1618594965.72.0.125154290728.issue43867@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7c29ae1f0585378dba4d220a2c0fb5dd49fdab3e by Victor Stinner in branch 'master': bpo-43867: multiprocessing Server catchs SystemExit (GH-25441) https://github.com/python/cpython/commit/7c29ae1f0585378dba4d220a2c0fb5dd49fdab3e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 13:43:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 16 Apr 2021 17:43:28 +0000 Subject: [issue43867] multiprocess: catch explicitly SystemExit in the Server class In-Reply-To: <1618584091.17.0.579971617999.issue43867@roundup.psfhosted.org> Message-ID: <1618595008.4.0.50659819413.issue43867@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 13:43:49 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 16 Apr 2021 17:43:49 +0000 Subject: [issue43872] Unable to compile cpython in Visual Studio 2019 In-Reply-To: <1618594788.56.0.562957194552.issue43872@roundup.psfhosted.org> Message-ID: <1618595029.63.0.0714605289685.issue43872@roundup.psfhosted.org> Eric V. Smith added the comment: It's almost certainly not a bug in CPython. But you haven't even shown us what the error is, so it's impossible to say. What error are you seeing? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 14:00:41 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 16 Apr 2021 18:00:41 +0000 Subject: [issue43871] urllib.parse.urlparse doesn't check port In-Reply-To: <1618594208.69.0.606171015487.issue43871@roundup.psfhosted.org> Message-ID: <1618596041.56.0.29883101376.issue43871@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: I guess moving port validation logic to parsing time is done as part of https://github.com/python/cpython/pull/16780 ---------- nosy: +orsenthil, vstinner, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 14:12:57 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 16 Apr 2021 18:12:57 +0000 Subject: [issue43872] Unable to compile cpython in Visual Studio 2019 In-Reply-To: <1618594788.56.0.562957194552.issue43872@roundup.psfhosted.org> Message-ID: <1618596777.8.0.795814833799.issue43872@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 14:12:49 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 16 Apr 2021 18:12:49 +0000 Subject: [issue43872] Unable to compile cpython in Visual Studio 2019 In-Reply-To: <1618594788.56.0.562957194552.issue43872@roundup.psfhosted.org> Message-ID: <1618596769.5.0.49333325855.issue43872@roundup.psfhosted.org> Shreyan Avigyan added the comment: I'm not able to reproduce the error right now. I think I forgot to clean all object files and other stuff created during compilation and therefore was witnessing the error during rebuilding. I'm closing this issue for now. If I come across this error in the future I'll reopen this issue and attach a screenshot of the error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 14:15:04 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 16 Apr 2021 18:15:04 +0000 Subject: [issue43872] Unable to compile cpython in Visual Studio 2019 In-Reply-To: <1618594788.56.0.562957194552.issue43872@roundup.psfhosted.org> Message-ID: <1618596904.93.0.183167274873.issue43872@roundup.psfhosted.org> Eric V. Smith added the comment: Okay, and good luck! ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 14:16:59 2021 From: report at bugs.python.org (Roy Smith) Date: Fri, 16 Apr 2021 18:16:59 +0000 Subject: [issue43873] bz2.open() docs give conflicting defaults for mode Message-ID: <1618597019.31.0.436475861063.issue43873@roundup.psfhosted.org> New submission from Roy Smith : See https://docs.python.org/3.7/library/bz2.html For bz2.open(), the section header says: bz2.open(filename, mode='r' ...) but the text says: The mode argument ... The default is 'rb'. As I understand it, 'r' and 'rb' actually do the same thing, but the docs should at least be consistent. ---------- components: Library (Lib) messages: 391245 nosy: roysmith priority: normal severity: normal status: open title: bz2.open() docs give conflicting defaults for mode versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 14:21:48 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 16 Apr 2021 18:21:48 +0000 Subject: [issue43873] bz2.open() docs give conflicting defaults for mode In-Reply-To: <1618597019.31.0.436475861063.issue43873@roundup.psfhosted.org> Message-ID: <1618597308.56.0.258234260663.issue43873@roundup.psfhosted.org> Shreyan Avigyan added the comment: The documentation has been corrected in 3.9. Prior to 3.9 the header was bz2.open(filename, mode='r' ...). Now in 3.9 or later the header is bz2.open(filename, mode='rb' ...). ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 14:32:59 2021 From: report at bugs.python.org (Paulie Pena) Date: Fri, 16 Apr 2021 18:32:59 +0000 Subject: [issue42256] BaseCookie.__parse_string() doesn't work with expires= between cookies In-Reply-To: <1604431041.17.0.875441243707.issue42256@roundup.psfhosted.org> Message-ID: <1618597979.01.0.855585409209.issue42256@roundup.psfhosted.org> Paulie Pena added the comment: Here's a simple example. This is correctly parsed via a `SimpleCookie().load()` call: 'key1=val1, key2=val2' but this fails to parse: 'key1=val1; expires=Wed, 21 Oct 2015 07:28:00 GMT, key2=val2' My suggested fix: str = re.sub(r'(=\w{3},\s[\w\d\s-]{9,11}\s[\d:]{8}\sGMT),', r'\1;', str) will convert the comma separator to a semicolon, so this will correctly parse: 'key1=val1; expires=Wed, 21 Oct 2015 07:28:00 GMT; key2=val2' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 14:43:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 18:43:21 +0000 Subject: [issue1676820] Add a PeriodicTimer to threading Message-ID: <1618598601.17.0.855154803171.issue1676820@roundup.psfhosted.org> Irit Katriel added the comment: I'm closing this as rejected because the comments were not very supportive of the idea and there has been no activity for over 10 years. There are also more possibilities for this now with asyncio. ---------- resolution: -> rejected stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 14:52:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 18:52:57 +0000 Subject: [issue27835] SystemExit in setUpClass etc. terminates test run In-Reply-To: <1471945955.42.0.0930690369777.issue27835@psf.upfronthosting.co.za> Message-ID: <1618599177.6.0.196477667768.issue27835@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 15:03:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 19:03:21 +0000 Subject: [issue35342] email "default" policy raises exception iterating over unparseable date headers In-Reply-To: <1543426629.99.0.788709270274.issue35342@psf.upfronthosting.co.za> Message-ID: <1618599801.71.0.263454575654.issue35342@roundup.psfhosted.org> Irit Katriel added the comment: I get the same result on macOS as on Windows, it seems this was fixed in https://github.com/python/cpython/pull/22090, there are unit tests there for invalid dates passed to parsedate_to_datetime. ---------- status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 15:04:07 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 19:04:07 +0000 Subject: [issue21728] Confusing error message when initialising type inheriting object.__init__ In-Reply-To: <1402524417.59.0.0212668512702.issue21728@psf.upfronthosting.co.za> Message-ID: <1618599847.44.0.930851533414.issue21728@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 15:07:46 2021 From: report at bugs.python.org (Terence Honles) Date: Fri, 16 Apr 2021 19:07:46 +0000 Subject: [issue43874] argparse crashes on subparsers with no dest/metava Message-ID: <1618600066.88.0.240618154113.issue43874@roundup.psfhosted.org> New submission from Terence Honles : When creating a simple required subparser the following will result in an error instead of an error message: >>> from argparse import ArgumentParser >>> >>> parser = ArgumentParser() >>> subparsers = parser.add_subparsers(required=True) >>> subparsers.add_parser('one') >>> subparsers.add_parser('two') >>> >>> parser.parse_args([]) Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.8/argparse.py", line 1768, in parse_args args, argv = self.parse_known_args(args, namespace) File "/usr/lib64/python3.8/argparse.py", line 1800, in parse_known_args namespace, args = self._parse_known_args(args, namespace) File "/usr/lib64/python3.8/argparse.py", line 2035, in _parse_known_args ', '.join(required_actions)) TypeError: sequence item 0: expected str instance, NoneType found Looking at the code this is because the subparser is actually an action and when resolving the name it uses `None` as the subparser name which results in the error above. ---------- components: Library (Lib) messages: 391250 nosy: terence.honles priority: normal pull_requests: 24176 severity: normal status: open title: argparse crashes on subparsers with no dest/metava type: crash versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 15:37:05 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 16 Apr 2021 19:37:05 +0000 Subject: [issue43864] [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead In-Reply-To: <1618578775.46.0.785924432695.issue43864@roundup.psfhosted.org> Message-ID: <1618601825.82.0.769326028831.issue43864@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 15:45:15 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 16 Apr 2021 19:45:15 +0000 Subject: [issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument In-Reply-To: <1615387121.09.0.336024174905.issue43463@roundup.psfhosted.org> Message-ID: <1618602315.16.0.293258728865.issue43463@roundup.psfhosted.org> Larry Hastings added the comment: It would also cause the code generated for the annotations function to balloon--the calculation of every value would have to be wrapped in a try/except, and for what I assume is an obscure use case. I'm already getting some pushback on the code generated with PEP 649 as it is. My goal in designing PEP 649 was to take stock semantics and time-shift the evaluation of the annotations, adding as little opinion as possible. I think catching NameErrors is too opinionated, much less catching every plausible error. Still, the approach is mentioned in PEP 649. I assume the Steering Committee rules is aware this option exists. If they rule in favor of adding PEP 649, but stipulate that this feature is necessary, I will of course implement it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:07:20 2021 From: report at bugs.python.org (Brett Cannon) Date: Fri, 16 Apr 2021 20:07:20 +0000 Subject: [issue43864] [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead In-Reply-To: <1618578775.46.0.785924432695.issue43864@roundup.psfhosted.org> Message-ID: <1618603640.08.0.170588815931.issue43864@roundup.psfhosted.org> Brett Cannon added the comment: Darn, forgot about Windows when I hunted down all the warnings on macOS. ---------- assignee: -> brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:08:19 2021 From: report at bugs.python.org (Reuben Thomas) Date: Fri, 16 Apr 2021 20:08:19 +0000 Subject: [issue43875] path.glob with ** does not always detect symlink loops Message-ID: <1618603699.0.0.0318164618776.issue43875@roundup.psfhosted.org> New submission from Reuben Thomas : Example session: $ mkdir foo $ cd foo $ ln -s .. bar $ ln -s .. baz $ python3.9 Python 3.9.0+ (default, Oct 20 2020, 08:43:38) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from glob import glob >>> glob('**/README', recursive=True) [HANG] Removing either of the symlinks fixes the hang. ---------- messages: 391253 nosy: rrt priority: normal severity: normal status: open title: path.glob with ** does not always detect symlink loops _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:08:29 2021 From: report at bugs.python.org (Reuben Thomas) Date: Fri, 16 Apr 2021 20:08:29 +0000 Subject: [issue43875] path.glob with ** does not always detect symlink loops In-Reply-To: <1618603699.0.0.0318164618776.issue43875@roundup.psfhosted.org> Message-ID: <1618603709.87.0.738583326166.issue43875@roundup.psfhosted.org> Change by Reuben Thomas : ---------- components: +Library (Lib) versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:10:06 2021 From: report at bugs.python.org (Reuben Thomas) Date: Fri, 16 Apr 2021 20:10:06 +0000 Subject: [issue43875] glob.glob with ** does not always detect symlink loops In-Reply-To: <1618603699.0.0.0318164618776.issue43875@roundup.psfhosted.org> Message-ID: <1618603806.65.0.446738018257.issue43875@roundup.psfhosted.org> Change by Reuben Thomas : ---------- title: path.glob with ** does not always detect symlink loops -> glob.glob with ** does not always detect symlink loops _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:21:20 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Apr 2021 20:21:20 +0000 Subject: [issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring In-Reply-To: <1618106073.56.0.0553736134144.issue43803@roundup.psfhosted.org> Message-ID: <1618604480.94.0.468547086401.issue43803@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:22:50 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Apr 2021 20:22:50 +0000 Subject: [issue43805] multiprocessing.Queue hangs when process on other side dies In-Reply-To: <1618141970.93.0.19986621438.issue43805@roundup.psfhosted.org> Message-ID: <1618604570.92.0.268461215259.issue43805@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +davin, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:23:14 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Apr 2021 20:23:14 +0000 Subject: [issue43806] asyncio.StreamReader hangs when reading from pipe and other process exits unexpectedly In-Reply-To: <1618143469.5.0.154132734242.issue43806@roundup.psfhosted.org> Message-ID: <1618604594.8.0.0922602180237.issue43806@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +asvetlov, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:24:29 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Apr 2021 20:24:29 +0000 Subject: [issue43807] JSONDecodeError: Extra Data Raised on Long Valid JSON In-Reply-To: <1618143948.32.0.607083588761.issue43807@roundup.psfhosted.org> Message-ID: <1618604669.33.0.901946908505.issue43807@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +ezio.melotti, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:27:09 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Apr 2021 20:27:09 +0000 Subject: [issue43821] Undocumented behavior of sleep functions and asyncio delayed execution In-Reply-To: <1618265480.34.0.661337068336.issue43821@roundup.psfhosted.org> Message-ID: <1618604829.06.0.924655429479.issue43821@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +asvetlov, yselivanov versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:29:27 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Apr 2021 20:29:27 +0000 Subject: [issue43827] abc conflicts with __init_subclass__ In-Reply-To: <1618300635.23.0.984081288048.issue43827@roundup.psfhosted.org> Message-ID: <1618604967.56.0.123306905618.issue43827@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +rhettinger, stutzbach type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:32:39 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 16 Apr 2021 20:32:39 +0000 Subject: [issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument In-Reply-To: <1615387121.09.0.336024174905.issue43463@roundup.psfhosted.org> Message-ID: <1618605159.49.0.443155765446.issue43463@roundup.psfhosted.org> Guido van Rossum added the comment: I thought Jelle?s solution would avoid code bloat ? a dedicated opcode. It can do whatever is decided. ---------- nosy: +Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:34:13 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Apr 2021 20:34:13 +0000 Subject: [issue43834] Use context manager in StringIO example In-Reply-To: <1618344155.0.0.639710984937.issue43834@roundup.psfhosted.org> Message-ID: <1618605253.56.0.329893724599.issue43834@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +benjamin.peterson, stutzbach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:35:14 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Apr 2021 20:35:14 +0000 Subject: [issue43835] Dataclasses don't call base class __init__ In-Reply-To: <1618352500.63.0.0280826468162.issue43835@roundup.psfhosted.org> Message-ID: <1618605314.2.0.575044358913.issue43835@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:35:56 2021 From: report at bugs.python.org (Vince Reuter) Date: Fri, 16 Apr 2021 20:35:56 +0000 Subject: [issue43876] argparse documentation contrasting nargs '*' vs. '+' is misleading Message-ID: <1618605356.69.0.0775347773509.issue43876@roundup.psfhosted.org> New submission from Vince Reuter : Standard library docs for argparse, at https://docs.python.org/3/library/argparse.html#nargs, suggest that setting nargs='+' differs from nargs='*' in that the former will raise a parsing error when the argument's omitted while the latter will not. In other words, nargs='+' sounds like it's distinguished from nargs='*' by virtue of implicitly making `required=True`. This implication isn't valid when the option name has a double-hyphen prefix, though: no argument parsing error is thrown for a double-hyphen-prefix-named option, even with `nargs='+'`. The docs neglect to mention this qualification that prevents `nargs='+'` from implicitly making the option required. Originally noticed while using a port of the library to R: https://github.com/trevorld/r-argparse/issues/31 ---------- messages: 391255 nosy: vreuter priority: normal severity: normal status: open title: argparse documentation contrasting nargs '*' vs. '+' is misleading _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:39:04 2021 From: report at bugs.python.org (Vince Reuter) Date: Fri, 16 Apr 2021 20:39:04 +0000 Subject: [issue43876] argparse documentation contrasting nargs '*' vs. '+' is misleading In-Reply-To: <1618605356.69.0.0775347773509.issue43876@roundup.psfhosted.org> Message-ID: <1618605544.23.0.956101286583.issue43876@roundup.psfhosted.org> Vince Reuter added the comment: Here's the docs excerpt that seems misleading: """ '+'. Just like '*', all command-line args present are gathered into a list. Additionally, an error message will be generated if there wasn?t at least one command-line argument present. """ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:47:26 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 16 Apr 2021 20:47:26 +0000 Subject: [issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument In-Reply-To: <1615387121.09.0.336024174905.issue43463@roundup.psfhosted.org> Message-ID: <1618606046.0.0.710122988506.issue43463@roundup.psfhosted.org> Larry Hastings added the comment: I admit I hadn't looked that closely at Jelle's PR. You're right, its effects on code size should be minimal. If I'm reading it correctly, Jelle's PR would suppress NameError by replacing the failed value with a new "AnnotationName" object. It wouldn't handle any other exceptions (e.g. ValueError). Also, as currently implemented it doesn't permit getting attributes or indexing into the AnnotationName--if "o" is the object we failed to look up, "o.value" and "o[1]" would raise exceptions. The AnnotationName could be extended with __getattr__ and __getitem__, but this makes it even more opinionated. Also, the PR only adds LOAD_ANNOTATION_GLOBAL; it would presumably also need LOAD_ANNOTATION_NAME and LOAD_ANNOTATION_CLASSDEREF. (I don't think we'd need LOAD_ANNOTATION_LOCAL.) I'll file these comments on the PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 16:59:11 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 16 Apr 2021 20:59:11 +0000 Subject: [issue43856] Docs for importlib.metadata should mention Python version In-Reply-To: <1618502050.6.0.847154133714.issue43856@roundup.psfhosted.org> Message-ID: <1618606751.83.0.69795402601.issue43856@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +24177 pull_request: https://github.com/python/cpython/pull/25448 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 17:02:09 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 16 Apr 2021 21:02:09 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1618606929.81.0.36217109253.issue43795@roundup.psfhosted.org> Petr Viktorin added the comment: Thanks! I'll send PRs later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 17:11:55 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Apr 2021 21:11:55 +0000 Subject: [issue43837] Operator precedence documentation could be more clear In-Reply-To: <1618375085.85.0.211628673766.issue43837@roundup.psfhosted.org> Message-ID: <1618607515.83.0.437211522795.issue43837@roundup.psfhosted.org> Terry J. Reedy added the comment: When I looked at the table yesterday (after several years), I was initially confused at the 'reversed' order (before I checked the text above). Besides precedence usually (nearly always) being listed high to low*, the chapter itself is highest to lowest, so the table is reversed from the chapter order. * I checked K&R C and several sites and images and all I saw had highest at the top (highest). This include other Python charts. The table has been this way since at least 1.4 https://docs.python.org/release/1.4/ref/ref5.html#HDR18 Guido, how would you feel about reversing it to follow what seems to be the de facto standard? The header 'Operator' could be changed to 'Operator (lowest first)' but I would prefer to make that 'Operator (highest first)'. ---------- nosy: +gvanrossum, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 17:21:07 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Apr 2021 21:21:07 +0000 Subject: [issue43857] Fix the AttributeError message for deletion of a missing attribute In-Reply-To: <1618504291.99.0.55591533554.issue43857@roundup.psfhosted.org> Message-ID: <1618608067.29.0.356916583726.issue43857@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +pablogsal versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 17:21:22 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 16 Apr 2021 21:21:22 +0000 Subject: [issue43837] Operator precedence documentation could be more clear In-Reply-To: <1618375085.85.0.211628673766.issue43837@roundup.psfhosted.org> Message-ID: <1618608082.33.0.586271273974.issue43837@roundup.psfhosted.org> Guido van Rossum added the comment: I defer to Raymond on this. Honestly without looking at the website I don?t even recall whether ?higher precedence? means ?binds more tightly? or the opposite. :-) So maybe we should change the terminology while we?re at it. ---------- nosy: +Guido.van.Rossum, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 17:23:01 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Apr 2021 21:23:01 +0000 Subject: [issue43866] Installation files of the Python In-Reply-To: <1618582023.9.0.574924434196.issue43866@roundup.psfhosted.org> Message-ID: <1618608181.15.0.502810716355.issue43866@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 18:44:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 22:44:16 +0000 Subject: [issue10794] Infinite recursion while garbage collecting loops indefinitely In-Reply-To: <1293670287.34.0.585233901325.issue10794@psf.upfronthosting.co.za> Message-ID: <1618613056.29.0.831712339148.issue10794@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: needs patch -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 18:44:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 22:44:45 +0000 Subject: [issue22128] patch: steer people away from codecs.open In-Reply-To: <1407071838.74.0.684483503953.issue22128@psf.upfronthosting.co.za> Message-ID: <1618613085.84.0.0152243078578.issue22128@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 18:45:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 22:45:13 +0000 Subject: [issue16718] Mysterious atexit fail In-Reply-To: <1355862940.68.0.167478798513.issue16718@psf.upfronthosting.co.za> Message-ID: <1618613113.0.0.0574230225019.issue16718@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 18:46:42 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 22:46:42 +0000 Subject: [issue6253] optparse.OptionParser.get_usage uses wrong formatter In-Reply-To: <1244644097.18.0.346116774289.issue6253@psf.upfronthosting.co.za> Message-ID: <1618613202.27.0.0638108758881.issue6253@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 18:48:22 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 22:48:22 +0000 Subject: [issue31481] telnetlib fails to read continous large output from Windows Telnet Server In-Reply-To: <1505475181.12.0.220673686741.issue31481@psf.upfronthosting.co.za> Message-ID: <1618613302.34.0.0689531847965.issue31481@roundup.psfhosted.org> Irit Katriel added the comment: Nisar, if you are still having the problem (in Python 3) please create a new issue with detail on how we can reproduce it. ---------- resolution: -> rejected stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 23:35:22 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 17 Apr 2021 03:35:22 +0000 Subject: [issue43877] Logging Cookbook ambiguity In-Reply-To: <1618622288.58.0.221543721652.issue43877@roundup.psfhosted.org> Message-ID: <1618630522.05.0.736773961819.issue43877@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 23:10:35 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 17 Apr 2021 03:10:35 +0000 Subject: [issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py In-Reply-To: <1597516564.62.0.520187732663.issue41559@roundup.psfhosted.org> Message-ID: <1618629035.49.0.0863939016996.issue41559@roundup.psfhosted.org> Ken Jin added the comment: Guido, I hope I didn't choose a bad time to send this PR over (I suspect you may already be flooded by emails about PEP 563). The jist of the PR is that it's possible to implement PEP 612 in pure-Python. Specifically, PEP 612 says: > As before, parameters_expressions by themselves are not acceptable in places where a type is expected https://www.python.org/dev/peps/pep-0612/#valid-use-locations Currently, the implementation treats ``ParamSpec`` specially in all builtin ``GenericAlias`` objects just for the sake of ``collections.abc.Callable``. There isn't a need for that - it just needs ``collections.abc.Callable`` to exhibit that behaviour. By implementing this in pure Python, we can: - Conform more strictly to the PEP. - Reduce complexity of the builtin ``GenericAlias`` and also speed it up because less checks are required. - Not tie more typing.py stuff to builtin ``GenericAlias``, which is a plus in my book. What do you think? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 19:41:36 2021 From: report at bugs.python.org (William Pickard) Date: Fri, 16 Apr 2021 23:41:36 +0000 Subject: [issue43866] Installation files of the Python In-Reply-To: <1618582023.9.0.574924434196.issue43866@roundup.psfhosted.org> Message-ID: <1618616496.01.0.337505947436.issue43866@roundup.psfhosted.org> William Pickard added the comment: Python, when installed for all users, installs to %ProgramFiles% (or %ProgramFiles(x86)% for 32-bit version on 64-bit Windows). The %LocalAppData% install is just for you... you didn't install it for everyone or you didn't provide Python with the Administrator privileges it needs for %ProgramFiles% (IE: No process elevation) ---------- nosy: +WildCard65 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 22:46:16 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 17 Apr 2021 02:46:16 +0000 Subject: [issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py In-Reply-To: <1597516564.62.0.520187732663.issue41559@roundup.psfhosted.org> Message-ID: <1618627576.69.0.144518824244.issue41559@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +24178 pull_request: https://github.com/python/cpython/pull/25449 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 19:59:47 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 16 Apr 2021 23:59:47 +0000 Subject: [issue43873] bz2.open() docs give conflicting defaults for mode In-Reply-To: <1618597019.31.0.436475861063.issue43873@roundup.psfhosted.org> Message-ID: <1618617587.86.0.207501703995.issue43873@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 00:19:57 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 17 Apr 2021 04:19:57 +0000 Subject: [issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py In-Reply-To: <1597516564.62.0.520187732663.issue41559@roundup.psfhosted.org> Message-ID: <1618633197.65.0.584539824531.issue41559@roundup.psfhosted.org> Guido van Rossum added the comment: Yeah, like this idea. Let?s get this in before beta 1. ---------- nosy: +Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 22:34:09 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 17 Apr 2021 02:34:09 +0000 Subject: [issue43873] bz2.open() docs give conflicting defaults for mode In-Reply-To: <1618597019.31.0.436475861063.issue43873@roundup.psfhosted.org> Message-ID: <1618626849.31.0.720724312479.issue43873@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This was fixed in https://github.com/python/cpython/pull/15100 and not backported. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 20:38:25 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 17 Apr 2021 00:38:25 +0000 Subject: [issue43762] Add audit events for loading of sqlite3 extensions In-Reply-To: <1617792679.62.0.407303342016.issue43762@roundup.psfhosted.org> Message-ID: <1618619905.25.0.483080500409.issue43762@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 20:45:40 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 17 Apr 2021 00:45:40 +0000 Subject: [issue43768] Possible race condition on multiprocessing.Manager().dict() on macOS In-Reply-To: <1617822753.2.0.370273367232.issue43768@roundup.psfhosted.org> Message-ID: <1618620340.92.0.850294720331.issue43768@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +davin, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 00:43:11 2021 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Sat, 17 Apr 2021 04:43:11 +0000 Subject: [issue10663] configure shouldn't set a default OPT In-Reply-To: <1291922731.34.0.0931517118305.issue10663@psf.upfronthosting.co.za> Message-ID: <1618634591.75.0.701205069666.issue10663@roundup.psfhosted.org> Arfrever Frehtes Taifersar Arahesis added the comment: configure.in is old name of Autoconf input file. configure.ac is new name of Autoconf input file (and the only name to be supported in some future version of Autoconf). configure.in in CPython project was renamed to configure.ac in 2012 (commit 0f4c16e29cd7925bd99cb68dba5595eed6e19b62). Problem described in this issue is still present in configure.ac. ---------- resolution: out of date -> stage: resolved -> status: closed -> open versions: +Python 3.10 -Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 21:18:08 2021 From: report at bugs.python.org (Gene Ratzlaff) Date: Sat, 17 Apr 2021 01:18:08 +0000 Subject: [issue43877] Logging Cookbook ambiguity Message-ID: <1618622288.58.0.221543721652.issue43877@roundup.psfhosted.org> New submission from Gene Ratzlaff : In the section titled "Logging to a single file from multiple processes" I am puzzled by the second example, as follows: The first example has the listener/logger is in a separate >process< and the listener/logger process is (as I would anticipate) started >before< the worker/sender processes. In the 2nd example, the listener/logger is in a separate >thread< and the listener/logger thread is (oddly) started >after< the worker/sender processes. Please correct it, or explain in the Cookbook what is OK about doing it that way, and if it is OK, are there limitations to doing it that way? ---------- assignee: docs at python components: Documentation messages: 391267 nosy: bluebloodpole, docs at python priority: normal severity: normal status: open title: Logging Cookbook ambiguity type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 01:15:18 2021 From: report at bugs.python.org (Keith Smiley) Date: Sat, 17 Apr 2021 05:15:18 +0000 Subject: [issue43878] ./configure fails on Apple Silicon Message-ID: <1618636518.04.0.898249551468.issue43878@roundup.psfhosted.org> New submission from Keith Smiley : It seems that Apple Silicon support has been added in https://github.com/python/cpython/pull/22855, but when I try to build locally I see this error: ``` % ./configure checking for git... found checking build system type... Invalid configuration `arm64-apple-darwin20.3.0': machine `arm64-apple' not recognized configure: error: /bin/sh ./config.sub arm64-apple-darwin20.3.0 failed ``` I went through the `autoreconf` instructions to see if the checked in configure script was outdated, but it doesn't seem to have fixed the issue. I was able to fix this locally by updating the config.sub and config.guess files (only the former was required but I noticed in previous updates that they were updated in lockstep). I'm a bit wary about that change because it doesn't seem like they are updated frequently (they haven't been in over 3 years), but I will submit it for discussion. ---------- components: Build messages: 391272 nosy: keith priority: normal severity: normal status: open title: ./configure fails on Apple Silicon type: compile error versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 01:19:13 2021 From: report at bugs.python.org (Keith Smiley) Date: Sat, 17 Apr 2021 05:19:13 +0000 Subject: [issue43878] ./configure fails on Apple Silicon In-Reply-To: <1618636518.04.0.898249551468.issue43878@roundup.psfhosted.org> Message-ID: <1618636753.25.0.142326456572.issue43878@roundup.psfhosted.org> Change by Keith Smiley : ---------- keywords: +patch pull_requests: +24179 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25450 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 18:50:43 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 22:50:43 +0000 Subject: [issue30425] Python 3.6.1 (32-bit)_20170522020736.log In-Reply-To: <1495394003.66.0.824232071766.issue30425@psf.upfronthosting.co.za> Message-ID: <1618613443.96.0.379636425332.issue30425@roundup.psfhosted.org> Irit Katriel added the comment: Please open a new issue if you are still having a problem, and please explain what the problem is and why you think it's a bug in Python. ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 19:06:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 23:06:17 +0000 Subject: [issue10663] configure shouldn't set a default OPT In-Reply-To: <1291922731.34.0.0931517118305.issue10663@psf.upfronthosting.co.za> Message-ID: <1618614377.85.0.98377963299.issue10663@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 19:08:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 23:08:48 +0000 Subject: [issue14322] More test coverage for hmac In-Reply-To: <1331831609.33.0.520236800519.issue14322@psf.upfronthosting.co.za> Message-ID: <1618614528.55.0.709566183392.issue14322@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 19:13:57 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Apr 2021 23:13:57 +0000 Subject: [issue43856] Docs for importlib.metadata should mention Python version In-Reply-To: <1618502050.6.0.847154133714.issue43856@roundup.psfhosted.org> Message-ID: <1618614837.39.0.677613409808.issue43856@roundup.psfhosted.org> miss-islington added the comment: New changeset adf24bd835ed8f76dcc51aa98c8c54275e86965b by Zackery Spytz in branch 'master': bpo-43856: Add a versionadded directive to the importlib.metadata docs (GH-25445) https://github.com/python/cpython/commit/adf24bd835ed8f76dcc51aa98c8c54275e86965b ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 19:13:51 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 23:13:51 +0000 Subject: [issue41943] unittest.assertLogs passes unexpectedly In-Reply-To: <1601908800.0.0.297130696317.issue41943@roundup.psfhosted.org> Message-ID: <1618614831.35.0.0962038502598.issue41943@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 19:18:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Apr 2021 23:18:16 +0000 Subject: [issue16221] tokenize.untokenize() "compat" mode misses the encoding when using an iterator In-Reply-To: <1350192416.31.0.110132465833.issue16221@psf.upfronthosting.co.za> Message-ID: <1618615096.47.0.731717868407.issue16221@roundup.psfhosted.org> Irit Katriel added the comment: This was fixed here under issue719888. ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 19:24:04 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 16 Apr 2021 23:24:04 +0000 Subject: [issue43871] urllib.parse.urlparse doesn't check port In-Reply-To: <1618594208.69.0.606171015487.issue43871@roundup.psfhosted.org> Message-ID: <1618615444.55.0.738291768526.issue43871@roundup.psfhosted.org> Senthil Kumaran added the comment: Treating this as bug in itself might be a better idea than waiting for a ipv6 scope introduction, which had few caveats. > Would it be an improvement if _checknetloc[2] validates the value of port properly? Yes, we could check if it is an int. That should be sufficient. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 16 19:24:20 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 16 Apr 2021 23:24:20 +0000 Subject: [issue43871] urllib.parse.urlparse doesn't check port In-Reply-To: <1618594208.69.0.606171015487.issue43871@roundup.psfhosted.org> Message-ID: <1618615460.25.0.360397179464.issue43871@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- assignee: -> orsenthil versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 03:34:25 2021 From: report at bugs.python.org (Steve Kelem) Date: Sat, 17 Apr 2021 07:34:25 +0000 Subject: [issue43860] unittest increment tests executed In-Reply-To: <1618551542.77.0.0261778711624.issue43860@roundup.psfhosted.org> Message-ID: <1618644865.22.0.214090687086.issue43860@roundup.psfhosted.org> Steve Kelem added the comment: Technically, you're right, however each domain his its own notion of what "adequate coverage" means. Some projects use software code coverage. I deal with integrated circuit observability/controllability, and stocastic functional testing. Until something, outside of the scope of unittest, becomes available (or affordable) having a count of the number of test points for each test gives me a good idea of what testing has been done and what needs to be expanded. Practically, having a count of the number of tests is a first-order useful measure for many of the projects I deal with. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 03:38:11 2021 From: report at bugs.python.org (da-woods) Date: Sat, 17 Apr 2021 07:38:11 +0000 Subject: [issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled In-Reply-To: <1474611707.66.0.467568151114.issue28254@psf.upfronthosting.co.za> Message-ID: <1618645091.9.0.0698178914491.issue28254@roundup.psfhosted.org> da-woods added the comment: Cython currently does an elaborate process of importing the GC module and loading the "isenabled", "enable" and "disable" attributes each time it creates a cdef type https://github.com/cython/cython/blob/master/Cython/Utility/ExtensionTypes.c#L73-L107 Admittedly that's partly because it's abusing the Py_TPFLAGS_HEAPTYPE to allow multiple inheritance where Python doesn't really allow it. But the up-shot is that Cython definite has a use-case for doing this directly in the C API, and would use these functions if provided. ---------- nosy: +da-woods _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 04:07:26 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 08:07:26 +0000 Subject: [issue43522] SSLContext.hostname_checks_common_name appears to have no effect In-Reply-To: <1615925270.47.0.272234983925.issue43522@roundup.psfhosted.org> Message-ID: <1618646846.39.0.508793707588.issue43522@roundup.psfhosted.org> Christian Heimes added the comment: New changeset b467d9a24011992242c95d9157d3455f8a84466b by Christian Heimes in branch 'master': bpo-43522: Fix SSLContext.hostname_checks_common_name (GH-24899) https://github.com/python/cpython/commit/b467d9a24011992242c95d9157d3455f8a84466b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 05:07:15 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 09:07:15 +0000 Subject: [issue43522] SSLContext.hostname_checks_common_name appears to have no effect In-Reply-To: <1615925270.47.0.272234983925.issue43522@roundup.psfhosted.org> Message-ID: <1618650435.16.0.430071124921.issue43522@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24181 pull_request: https://github.com/python/cpython/pull/25452 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 05:06:24 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 09:06:24 +0000 Subject: [issue43522] SSLContext.hostname_checks_common_name appears to have no effect In-Reply-To: <1615925270.47.0.272234983925.issue43522@roundup.psfhosted.org> Message-ID: <1618650384.51.0.521468235569.issue43522@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24180 pull_request: https://github.com/python/cpython/pull/25451 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 05:18:44 2021 From: report at bugs.python.org (Gabriele Tornetta) Date: Sat, 17 Apr 2021 09:18:44 +0000 Subject: [issue43879] Add native_id to PyThreadState Message-ID: <1618651124.52.0.543120021636.issue43879@roundup.psfhosted.org> New submission from Gabriele Tornetta : I would like to propose adding the native_id field to the PyThreadState structure to store the result of PyThread_get_thread_native_id. On some systems, like Linux, it is not easy to retrieve this information from outside of the Python interpreter process. Tools like Austin (https://github.com/P403n1x87/austin) could benefit from this for CPU time sampling. Currently, if one wants to retrieve the TID from a PyThreadState instance is to regard thread_id as a pointer to a struct pthread structure, loop over all the Python threads to find the one that has the PID for TID and infer the offset of the tid field within struct pthread, which is not ideal. ---------- components: C API messages: 391276 nosy: Gabriele Tornetta priority: normal severity: normal status: open title: Add native_id to PyThreadState type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 05:35:48 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 09:35:48 +0000 Subject: [issue43522] SSLContext.hostname_checks_common_name appears to have no effect In-Reply-To: <1615925270.47.0.272234983925.issue43522@roundup.psfhosted.org> Message-ID: <1618652148.33.0.418001314424.issue43522@roundup.psfhosted.org> Christian Heimes added the comment: New changeset cdf02879790b8e52456df6e9d58fb8c0842fc359 by Christian Heimes in branch '3.9': [3.9] bpo-43522: Fix SSLContext.hostname_checks_common_name (GH-24899) (GH-25451) https://github.com/python/cpython/commit/cdf02879790b8e52456df6e9d58fb8c0842fc359 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 05:36:04 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 09:36:04 +0000 Subject: [issue43522] SSLContext.hostname_checks_common_name appears to have no effect In-Reply-To: <1615925270.47.0.272234983925.issue43522@roundup.psfhosted.org> Message-ID: <1618652164.12.0.254075816077.issue43522@roundup.psfhosted.org> Christian Heimes added the comment: New changeset f77ca86f75d5ad9b52e5f3cd19c0024b204b168c by Christian Heimes in branch '3.8': [3.8] bpo-43522: Fix SSLContext.hostname_checks_common_name (GH-24899) (GH-25452) https://github.com/python/cpython/commit/f77ca86f75d5ad9b52e5f3cd19c0024b204b168c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 05:36:42 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 09:36:42 +0000 Subject: [issue43669] PEP 644: Require OpenSSL 1.1.1 or newer In-Reply-To: <1617106246.37.0.0210118077092.issue43669@roundup.psfhosted.org> Message-ID: <1618652202.94.0.135702739999.issue43669@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 39258d3595300bc7b952854c915f63ae2d4b9c3e by Christian Heimes in branch 'master': bpo-43669: PEP 644: Require OpenSSL 1.1.1 or newer (GH-23014) https://github.com/python/cpython/commit/39258d3595300bc7b952854c915f63ae2d4b9c3e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 05:37:20 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 09:37:20 +0000 Subject: [issue43669] PEP 644: Require OpenSSL 1.1.1 or newer In-Reply-To: <1617106246.37.0.0210118077092.issue43669@roundup.psfhosted.org> Message-ID: <1618652240.56.0.382300519582.issue43669@roundup.psfhosted.org> Christian Heimes added the comment: - Remove HAVE_X509_VERIFY_PARAM_SET1_HOST check - Update hashopenssl to require OpenSSL 1.1.1 - multissltests only OpenSSL > 1.1.0 - ALPN is always supported - SNI is always supported - Remove deprecated NPN code. Python wrappers are no-op. - ECDH is always supported - Remove OPENSSL_VERSION_1_1 macro - Remove locking callbacks - Drop PY_OPENSSL_1_1_API macro - Drop HAVE_SSL_CTX_CLEAR_OPTIONS macro - SSL_CTRL_GET_MAX_PROTO_VERSION is always defined now - security level is always available now - get_num_tickets is available with TLS 1.3 - X509_V_ERR MISMATCH is always available now - Always set SSL_MODE_RELEASE_BUFFERS - X509_V_FLAG_TRUSTED_FIRST is always available - get_ciphers is always supported - SSL_CTX_set_keylog_callback is always available - Update Modules/Setup with static link example - Mention PEP in whatsnew - Drop 1.0.2 and 1.1.0 from GHA tests ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 06:10:08 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 10:10:08 +0000 Subject: [issue43669] PEP 644: Require OpenSSL 1.1.1 or newer In-Reply-To: <1617106246.37.0.0210118077092.issue43669@roundup.psfhosted.org> Message-ID: <1618654208.84.0.207110227639.issue43669@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24182 pull_request: https://github.com/python/cpython/pull/25453 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 06:37:57 2021 From: report at bugs.python.org (Jeremy Kloth) Date: Sat, 17 Apr 2021 10:37:57 +0000 Subject: [issue40432] Pegen regenerate project for Windows not working In-Reply-To: <1588127830.15.0.595745305392.issue40432@roundup.psfhosted.org> Message-ID: <1618655877.13.0.757115510514.issue40432@roundup.psfhosted.org> Jeremy Kloth added the comment: Adding windows team to the nosy list ---------- components: +Windows nosy: +jkloth, paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 06:45:19 2021 From: report at bugs.python.org (Alexei Pastuchov) Date: Sat, 17 Apr 2021 10:45:19 +0000 Subject: [issue43871] urllib.parse.urlparse doesn't check port In-Reply-To: <1618594208.69.0.606171015487.issue43871@roundup.psfhosted.org> Message-ID: <1618656319.35.0.319323080195.issue43871@roundup.psfhosted.org> Alexei Pastuchov added the comment: Thank you for your swift response and your willingness to add port validation to _checknetloc. I think the validation itself should compound both exceptional branches implemented in port[3] * port is an int * port is in the range [3] https://github.com/python/cpython/blob/e1903e11a3d42512effe336026e0c67f602e5848/Lib/urllib/parse.py#L173-L178 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 06:47:03 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 10:47:03 +0000 Subject: [issue43522] SSLContext.hostname_checks_common_name appears to have no effect In-Reply-To: <1615925270.47.0.272234983925.issue43522@roundup.psfhosted.org> Message-ID: <1618656423.89.0.201541278087.issue43522@roundup.psfhosted.org> Christian Heimes added the comment: Workaround has been added to upcoming 3.8 to 3.10 releases. Older versions will get fixed by next OpenSSL update. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 06:48:13 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 10:48:13 +0000 Subject: [issue28022] SSL releated deprecation for 3.6 In-Reply-To: <1473347942.69.0.310193437319.issue28022@psf.upfronthosting.co.za> Message-ID: <1618656493.82.0.541517139262.issue28022@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 06:55:55 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 10:55:55 +0000 Subject: [issue43880] 3.10 SSL module deprecations Message-ID: <1618656955.76.0.569824483108.issue43880@roundup.psfhosted.org> New submission from Christian Heimes : With PEP 644 accepted I can finally raise deprecation warnings for a lot of features that have been deprecated since Python 3.6 / 3.7 or by OpenSSL 1.1.1: * ssl.OP_NO_SSLv2 * ssl.OP_NO_SSLv3 * ssl.OP_NO_TLSv1 * ssl.OP_NO_TLSv1_1 * ssl.OP_NO_TLSv1_2 * ssl.OP_NO_TLSv1_3 * ssl.PROTOCOL_SSLv2 * ssl.PROTOCOL_SSLv3 * ssl.PROTOCOL_SSLv23 (alias for PROTOCOL_TLS) * ssl.PROTOCOL_TLS * ssl.PROTOCOL_TLSv1 * ssl.PROTOCOL_TLSv1_1 * ssl.PROTOCOL_TLSv1_2 * ssl.TLSVersion.SSLv3 * ssl.TLSVersion.TLSv1 * ssl.TLSVersion.TLSv1_1 * ssl.wrap_socket() * ssl.RAND_pseudo_bytes() * ssl.RAND_egd() (already removed since it's not supported by OpenSSL 1.1.1) ---------- assignee: christian.heimes components: SSL messages: 391284 nosy: christian.heimes priority: high severity: normal status: open title: 3.10 SSL module deprecations type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 07:04:45 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 17 Apr 2021 11:04:45 +0000 Subject: [issue43879] Add native_id to PyThreadState In-Reply-To: <1618651124.52.0.543120021636.issue43879@roundup.psfhosted.org> Message-ID: <1618657485.13.0.758948539013.issue43879@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 08:00:11 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 17 Apr 2021 12:00:11 +0000 Subject: [issue42248] Raised exception in Enum keeping user objects alive unnecessarily In-Reply-To: <1604350009.17.0.208770748804.issue42248@roundup.psfhosted.org> Message-ID: <1618660811.11.0.274942560694.issue42248@roundup.psfhosted.org> Mark Dickinson added the comment: Thank you for the quick fix! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 09:15:01 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 13:15:01 +0000 Subject: [issue43880] 3.10 SSL module deprecations In-Reply-To: <1618656955.76.0.569824483108.issue43880@roundup.psfhosted.org> Message-ID: <1618665301.93.0.111888636428.issue43880@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +24183 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25455 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 09:49:53 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 13:49:53 +0000 Subject: [issue43669] PEP 644: Require OpenSSL 1.1.1 or newer In-Reply-To: <1617106246.37.0.0210118077092.issue43669@roundup.psfhosted.org> Message-ID: <1618667393.67.0.971343480374.issue43669@roundup.psfhosted.org> Christian Heimes added the comment: New changeset b8d0fa035d74ae6ae00794c9af636b427c5dc650 by Christian Heimes in branch 'master': bpo-43669: Remove OpenSSL 0.9 to 1.1.0 specific documentation (GH-25453) https://github.com/python/cpython/commit/b8d0fa035d74ae6ae00794c9af636b427c5dc650 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 10:14:46 2021 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Apr 2021 14:14:46 +0000 Subject: [issue43879] Add native_id to PyThreadState In-Reply-To: <1618651124.52.0.543120021636.issue43879@roundup.psfhosted.org> Message-ID: <1618668886.07.0.320643414377.issue43879@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +24184 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25458 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 10:26:09 2021 From: report at bugs.python.org (Gabriele N Tornetta) Date: Sat, 17 Apr 2021 14:26:09 +0000 Subject: [issue43879] Add native_thread_id to PyThreadState In-Reply-To: <1618651124.52.0.543120021636.issue43879@roundup.psfhosted.org> Message-ID: <1618669569.94.0.284868522246.issue43879@roundup.psfhosted.org> Change by Gabriele N Tornetta : ---------- title: Add native_id to PyThreadState -> Add native_thread_id to PyThreadState _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 11:18:36 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 15:18:36 +0000 Subject: [issue43878] ./configure fails on Apple Silicon In-Reply-To: <1618636518.04.0.898249551468.issue43878@roundup.psfhosted.org> Message-ID: <1618672716.21.0.0124877650398.issue43878@roundup.psfhosted.org> Christian Heimes added the comment: The files are auto-generated by autoconf. The common Linux platforms do not have autoconf 2.71 yet. A large amount of core developers use Debian, Fedora, or Ubuntu. The latest releases of these distros only have autoconf 2.69. Until we can update, you have to recreate the configure script locally. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 11:29:59 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 15:29:59 +0000 Subject: [issue43878] ./configure fails on Apple Silicon In-Reply-To: <1618636518.04.0.898249551468.issue43878@roundup.psfhosted.org> Message-ID: <1618673399.22.0.636019015898.issue43878@roundup.psfhosted.org> Christian Heimes added the comment: It looks like we might be able to update the files after all. It's hard to say, though. The older tickets and commits for config.guess don't contain much context or explanation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 11:32:51 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 15:32:51 +0000 Subject: [issue43880] 3.10 SSL module deprecations In-Reply-To: <1618656955.76.0.569824483108.issue43880@roundup.psfhosted.org> Message-ID: <1618673571.06.0.525132164827.issue43880@roundup.psfhosted.org> Christian Heimes added the comment: * ssl.SSLContext() without a protocol argument * ssl.match_hostname() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 12:06:33 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 17 Apr 2021 16:06:33 +0000 Subject: [issue43646] ForwardRef name conflict during evaluation In-Reply-To: <1616925169.4.0.788953716536.issue43646@roundup.psfhosted.org> Message-ID: <1618675593.44.0.170589261216.issue43646@roundup.psfhosted.org> Ken Jin added the comment: @tefra, thanks for testing. That's great to hear! And once again, thanks for the excellent bug report in your original message. @tefra and @gvanrossum, I'm closing this issue as it is now fixed in 3.10. If any of you feel that's wrong, please don't hesitate to re-open the issue. For anyone wanting to discuss the fix further. I recommend going to issue42904 - it's the root cause of this issue and what the patch is linked to. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 12:21:43 2021 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 17 Apr 2021 16:21:43 +0000 Subject: [issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled In-Reply-To: <1474611707.66.0.467568151114.issue28254@psf.upfronthosting.co.za> Message-ID: <1618676503.07.0.0792735017317.issue28254@roundup.psfhosted.org> Stefan Behnel added the comment: I support that there should be a simple way to do this from C. The way via importing the "gc" module and then looking up an attribute (possibly building a Unicode string) and calling a function in it involves several operations that can take some time and require useless error handling since each of them will practically never fail but may. An operation as simple as changing the GC status shouldn't require that. A use case is building large data structures, or critical rearrangements of data structures that involve object operations that might trigger a GC run, maybe even including temporarily invalid object states and graphs. When larger data structures are involved but no collectable cycles, then the GC will probably not do anything useful except slowing down the creation process and/or running arbitrary code in between. I consider the need to disable garbage collection in critical sections of C code similar to locking and GIL handling. It isn't quite the same as locking, since other code can enable it again when it runs, which isn't the case for a lock, but especially in that case, being able to detect quickly whether it was re-enabled when my own code gains back control seems beneficial. Having to call a Python function for that and taking care of the object result is way too much overhead for this case. The fact that this is a rare request may not necessarily mean that it's rarely needed. There is certainly a bunch of C code out there that would benefit from temporarily disabling the GC in critical sections. I would imagine that people simply don't think of doing it and fail to notice any resulting slow-downs or even crashes since those often require elaborate circumstances to occur, and thus may not become visible at all in test or benchmark scenarios. Note that the GC state is now part of the PyInterpreterState, so a patch would need to do what "gc_enable_impl" and "gc_disable_impl" do in Modules/gcmodule.c, or, rather, become their implementation to share code. ---------- components: +C API -Extension Modules nosy: +scoder resolution: rejected -> stage: -> needs patch status: closed -> open type: -> resource usage versions: +Python 3.10 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 13:12:10 2021 From: report at bugs.python.org (Guo Ci Teo) Date: Sat, 17 Apr 2021 17:12:10 +0000 Subject: [issue43881] add platform availabity information for os.sched_getaffinity Message-ID: <1618679530.53.0.161636381643.issue43881@roundup.psfhosted.org> Change by Guo Ci Teo : ---------- assignee: docs at python components: Documentation nosy: docs at python, guoci priority: normal severity: normal status: open title: add platform availabity information for os.sched_getaffinity type: enhancement versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 13:18:45 2021 From: report at bugs.python.org (Guo Ci Teo) Date: Sat, 17 Apr 2021 17:18:45 +0000 Subject: [issue43881] add platform availabity information for os.sched_getaffinity Message-ID: <1618679925.53.0.448672358109.issue43881@roundup.psfhosted.org> Change by Guo Ci Teo : ---------- keywords: +patch pull_requests: +24185 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25459 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 13:24:23 2021 From: report at bugs.python.org (Kevin Shweh) Date: Sat, 17 Apr 2021 17:24:23 +0000 Subject: [issue38908] Troubles with @runtime_checkable protocols In-Reply-To: <1574617196.5.0.297633036854.issue38908@roundup.psfhosted.org> Message-ID: <1618680263.88.0.942642035875.issue38908@roundup.psfhosted.org> Kevin Shweh added the comment: It seems like the straightforward, minimal fix would be to just add if (getattr(cls, '_is_protocol', False) and not getattr(cls, '_is_runtime_protocol', False) and not _allow_reckless_class_cheks()): raise TypeError(...) to _ProtocolMeta.__instancecheck__. Does that fail on some edge case (that the current implementation works on)? It's a little weird that _ProtocolMeta.__instancecheck__ doesn't explicitly check that the protocol is runtime-checkable. ---------- nosy: +Kevin Shweh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:06:41 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:06:41 +0000 Subject: [issue42333] Port ssl module to heap types and module state (PEP 573) In-Reply-To: <1605201558.44.0.0361525548575.issue42333@roundup.psfhosted.org> Message-ID: <1618682801.81.0.475467565605.issue42333@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 7f1305ef9ea7234e1a5aacbea17490232e9b7dc2 by Christian Heimes in branch 'master': bpo-42333: Port _ssl extension to multiphase initialization (PEP 489) (GH-23253) https://github.com/python/cpython/commit/7f1305ef9ea7234e1a5aacbea17490232e9b7dc2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:08:05 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:08:05 +0000 Subject: [issue42333] Port ssl module to heap types and module state (PEP 573) In-Reply-To: <1605201558.44.0.0361525548575.issue42333@roundup.psfhosted.org> Message-ID: <1618682885.47.0.676583967325.issue42333@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:13:02 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:13:02 +0000 Subject: [issue42746] python3.7.3 - ssl.SSLContext() - "Killed" In-Reply-To: <1608939379.31.0.291479274657.issue42746@roundup.psfhosted.org> Message-ID: <1618683182.69.0.378720846287.issue42746@roundup.psfhosted.org> Christian Heimes added the comment: The op hasn't replied in over 3 months. I'm closing the bug as staled. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:14:02 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:14:02 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1618683242.14.0.834005677196.issue42854@roundup.psfhosted.org> Christian Heimes added the comment: 3.10 branch now requires OpenSSL 1.1.1. This should be easy to implement. ---------- keywords: +easy (C) priority: normal -> high stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:15:48 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:15:48 +0000 Subject: [issue43000] All SSL requests fail with WRONG_VERSION_NUMBER when a packet sniffer is open In-Reply-To: <1611290773.31.0.124833320524.issue43000@roundup.psfhosted.org> Message-ID: <1618683348.91.0.949569452798.issue43000@roundup.psfhosted.org> Christian Heimes added the comment: The op hasn't replied in three months. I'm closing the issue. Please feel free to reopen the issue with more information. ---------- resolution: -> out of date stage: -> resolved status: open -> closed type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:18:08 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:18:08 +0000 Subject: [issue42952] Incorrect handling of EC_KEY_new_by_curve_name() in the _ssl module In-Reply-To: <1610951179.15.0.310007065401.issue42952@roundup.psfhosted.org> Message-ID: <1618683488.17.0.980182553844.issue42952@roundup.psfhosted.org> Christian Heimes added the comment: I have removed the code from master. Do you want to remove it from 3.9 and 3.8 or should we just ignore the dead code? ---------- resolution: -> fixed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:19:39 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:19:39 +0000 Subject: [issue38815] test_ssl: test_min_max_version() fails on FreeBSD and Fedora In-Reply-To: <1573836860.92.0.531253629667.issue38815@roundup.psfhosted.org> Message-ID: <1618683579.28.0.725783376511.issue38815@roundup.psfhosted.org> Christian Heimes added the comment: I haven't seen the problem in a while. ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:20:31 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:20:31 +0000 Subject: [issue41195] Interface to OpenSSL's security level In-Reply-To: <1593685697.4.0.691411084209.issue41195@roundup.psfhosted.org> Message-ID: <1618683631.54.0.254300363006.issue41195@roundup.psfhosted.org> Christian Heimes added the comment: The getter is available in 3.10. Thanks for your contribution! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:21:50 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:21:50 +0000 Subject: [issue34078] Broken CRL functionality in ssl.py In-Reply-To: <1531163616.13.0.56676864532.issue34078@psf.upfronthosting.co.za> Message-ID: <1618683710.06.0.692980565803.issue34078@roundup.psfhosted.org> Christian Heimes added the comment: No response in over two years. I'm closing the issue. Please feel free to reopen the issue with more information. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:23:06 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:23:06 +0000 Subject: [issue23239] SSL match_hostname does not accept IP Address In-Reply-To: <1421226292.77.0.451398063166.issue23239@psf.upfronthosting.co.za> Message-ID: <1618683786.37.0.187594840721.issue23239@roundup.psfhosted.org> Christian Heimes added the comment: Python 2 is out of support. Python 3 can verify IP addresses in certificates correctly. ---------- resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:24:35 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:24:35 +0000 Subject: [issue33023] Unable to copy ssl.SSLContext In-Reply-To: <1520489361.61.0.467229070634.issue33023@psf.upfronthosting.co.za> Message-ID: <1618683875.24.0.0284497436986.issue33023@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:26:25 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:26:25 +0000 Subject: [issue35136] test_ssl fails in AMD64 FreeBSD CURRENT Shared 3.6 buildbot, OpenSSL 1.1.1a In-Reply-To: <1541081962.85.0.788709270274.issue35136@psf.upfronthosting.co.za> Message-ID: <1618683985.54.0.365648124927.issue35136@roundup.psfhosted.org> Christian Heimes added the comment: I'm closing the issue as outdated. ---------- resolution: -> out of date stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:27:00 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:27:00 +0000 Subject: [issue39344] Getting error while importing ssl " import _ssl # if we can't import it, let the error propagate ImportError: DLL load failed while importing _ssl: The specified module could not be found." In-Reply-To: <1579095353.91.0.817394645763.issue39344@roundup.psfhosted.org> Message-ID: <1618684020.89.0.290590157118.issue39344@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:47:22 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:47:22 +0000 Subject: [issue30141] If you forget to call do_handshake, then everything seems to work but hostname checking is disabled In-Reply-To: <1492943449.26.0.474412408504.issue30141@psf.upfronthosting.co.za> Message-ID: <1618685242.92.0.573474291267.issue30141@roundup.psfhosted.org> Christian Heimes added the comment: 3.6 will be out of support very soon. I'm closing this old bug as wontfix. Thanks for your investigation! :) ---------- resolution: -> wont fix status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:49:26 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:49:26 +0000 Subject: [issue32219] SSLWantWriteError being raised by blocking SSL socket In-Reply-To: <1512446468.03.0.213398074469.issue32219@psf.upfronthosting.co.za> Message-ID: <1618685366.18.0.476673400918.issue32219@roundup.psfhosted.org> Christian Heimes added the comment: Nathaniel, is this still an issue with recent OpenSSL and Python versions? ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:58:56 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:58:56 +0000 Subject: [issue35888] ssl module - could not get the server certificate w/o completed handshake In-Reply-To: <1549087795.05.0.177157894622.issue35888@roundup.psfhosted.org> Message-ID: <1618685936.38.0.871249446558.issue35888@roundup.psfhosted.org> Christian Heimes added the comment: You are correct. The ssl.get_server_certificate() helper function performs a full handshake and then returns the certificate. It's technically possible to get the cert chain from the ServerHello message, but Python does not provide an API for that. I don't know any Python package for the task either. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 14:59:48 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 18:59:48 +0000 Subject: [issue33808] ssl.get_server_certificate fails with openssl 1.1.0 but works with 1.0.2g for self-signed certificate In-Reply-To: <1528462754.61.0.592728768989.issue33808@psf.upfronthosting.co.za> Message-ID: <1618685988.9.0.208065788963.issue33808@roundup.psfhosted.org> Christian Heimes added the comment: The issue has been stale for over two years. Closing. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 15:02:33 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 19:02:33 +0000 Subject: [issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders In-Reply-To: <1520492267.34.0.467229070634.issue33025@psf.upfronthosting.co.za> Message-ID: <1618686153.66.0.305257535455.issue33025@roundup.psfhosted.org> Change by Christian Heimes : ---------- components: -SSL nosy: -christian.heimes versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 15:17:42 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 17 Apr 2021 19:17:42 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618687062.87.0.797490135643.issue38530@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24187 pull_request: https://github.com/python/cpython/pull/25460 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 15:26:11 2021 From: report at bugs.python.org (Nathaniel Smith) Date: Sat, 17 Apr 2021 19:26:11 +0000 Subject: [issue32219] SSLWantWriteError being raised by blocking SSL socket In-Reply-To: <1512446468.03.0.213398074469.issue32219@psf.upfronthosting.co.za> Message-ID: <1618687571.76.0.533235963181.issue32219@roundup.psfhosted.org> Nathaniel Smith added the comment: I don't know :-( After filing this upstream we started ignoring these exceptions, to make our CI less flaky: https://github.com/python-trio/trio/pull/365/files But unfortunately that means I don't know if we've been hitting them since then or not. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 15:31:08 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 19:31:08 +0000 Subject: [issue34669] test_ssl fails if SSLv2 is enabled In-Reply-To: <1536880287.69.0.956365154283.issue34669@psf.upfronthosting.co.za> Message-ID: <1618687868.38.0.00686850054676.issue34669@roundup.psfhosted.org> Christian Heimes added the comment: We are no longer testing with any OpenSSL version that has SSL 2.0 enabled or even available. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 15:33:08 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 19:33:08 +0000 Subject: [issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS In-Reply-To: <1505317705.14.0.640405907228.issue31453@psf.upfronthosting.co.za> Message-ID: <1618687988.57.0.952757692656.issue31453@roundup.psfhosted.org> Christian Heimes added the comment: Python 2.7 is out of supports. 3.6 will reach end of security support soon. More recent Python versions have TLS 1.0 and 1.1 deprecated and contain workarounds for tests. ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 15:34:44 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 19:34:44 +0000 Subject: [issue36866] Certificate verification errors in urllib.request become URLError In-Reply-To: <1557416912.64.0.674817399159.issue36866@roundup.psfhosted.org> Message-ID: <1618688084.28.0.287614505872.issue36866@roundup.psfhosted.org> Change by Christian Heimes : ---------- assignee: christian.heimes -> components: -SSL nosy: -christian.heimes versions: +Python 3.10 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 15:35:09 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 19:35:09 +0000 Subject: [issue28453] SSLObject.selected_alpn_protocol() not documented In-Reply-To: <1476589791.51.0.926571047111.issue28453@psf.upfronthosting.co.za> Message-ID: <1618688109.03.0.387331579573.issue28453@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 15:36:19 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 19:36:19 +0000 Subject: [issue36868] New behavior of OpenSSL hostname verification not exposed, incorrectly documented In-Reply-To: <1557425747.49.0.948212766878.issue36868@roundup.psfhosted.org> Message-ID: <1618688179.67.0.0974550305405.issue36868@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 15:36:30 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 19:36:30 +0000 Subject: [issue34001] LibreSSL does not tolerate setting minimum_version greater than maximum_version In-Reply-To: <1530288553.74.0.56676864532.issue34001@psf.upfronthosting.co.za> Message-ID: <1618688190.72.0.942914107471.issue34001@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 15:36:53 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 19:36:53 +0000 Subject: [issue34271] Please support logging of SSL master secret by env variable SSLKEYLOGFILE In-Reply-To: <1532867889.16.0.56676864532.issue34271@psf.upfronthosting.co.za> Message-ID: <1618688213.48.0.953373868222.issue34271@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 15:40:27 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 19:40:27 +0000 Subject: [issue40079] NULL pointer deref on error path in _ssl debughelpers.c In-Reply-To: <1585259813.8.0.527414757133.issue40079@roundup.psfhosted.org> Message-ID: <1618688427.89.0.0931723836245.issue40079@roundup.psfhosted.org> Christian Heimes added the comment: The issue has been fixed by fbf94af2af3c09493481b8559b84f6e9f0628c37 in on 2020-Jun-21. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 15:41:03 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 19:41:03 +0000 Subject: [issue40482] _hashlib: register Python names as OpenSSL aliases In-Reply-To: <1588503129.6.0.253291975104.issue40482@roundup.psfhosted.org> Message-ID: <1618688463.59.0.0451970967598.issue40482@roundup.psfhosted.org> Christian Heimes added the comment: I decided against the approach. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 15:41:23 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 19:41:23 +0000 Subject: [issue37550] SSL Pip Error In-Reply-To: <1562783044.13.0.555415202194.issue37550@roundup.psfhosted.org> Message-ID: <1618688483.04.0.0546187244095.issue37550@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 15:43:29 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 19:43:29 +0000 Subject: [issue30226] Modernize make_ssl_certs In-Reply-To: <1493715171.18.0.434787469545.issue30226@psf.upfronthosting.co.za> Message-ID: <1618688609.95.0.87447476836.issue30226@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 17:20:15 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 21:20:15 +0000 Subject: [issue43362] Bad free in py_sha3_new_impl function In-Reply-To: <1614653395.68.0.861850864871.issue43362@roundup.psfhosted.org> Message-ID: <1618694415.31.0.381748000469.issue43362@roundup.psfhosted.org> Change by Christian Heimes : ---------- assignee: -> christian.heimes nosy: +christian.heimes type: crash -> behavior versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 17:27:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 17 Apr 2021 21:27:01 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618694821.71.0.836916350759.issue38530@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 3ab4bea5a3ac28820781cf62a768c65370c9054c by Pablo Galindo in branch 'master': bpo-38530: Include builtins in NameError suggestions (GH-25460) https://github.com/python/cpython/commit/3ab4bea5a3ac28820781cf62a768c65370c9054c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 17:27:15 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 17 Apr 2021 21:27:15 +0000 Subject: [issue37630] Investigate replacing SHA3 code with OpenSSL In-Reply-To: <1563535856.49.0.726904541971.issue37630@roundup.psfhosted.org> Message-ID: <1618694835.44.0.0430211141684.issue37630@roundup.psfhosted.org> miss-islington added the comment: New changeset 685719871ac3fb6aff3468b9c5328fc66f5486d7 by stratakis in branch 'master': bpo-37630: Do not skip the sha3 tests in case of missing builtin sha3 module (GH-20986) https://github.com/python/cpython/commit/685719871ac3fb6aff3468b9c5328fc66f5486d7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 17:31:34 2021 From: report at bugs.python.org (da-woods) Date: Sat, 17 Apr 2021 21:31:34 +0000 Subject: [issue39432] Distutils generates the wrong export symbol for unicode module names In-Reply-To: <1579787295.61.0.899007188072.issue39432@roundup.psfhosted.org> Message-ID: <1618695094.49.0.86649378418.issue39432@roundup.psfhosted.org> da-woods added the comment: It looks like this wasn't quite fixed by the patch: the patch encoded `_` when it should have encoded ``. I've submitted a revised version to setuptools https://github.com/pypa/setuptools/pull/2646. My impression is that distutils is no longer updated and so there's no value in submitting this patch to Python too. However, I can do so if it would be used. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 18:04:25 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 22:04:25 +0000 Subject: [issue43362] Bad free in py_sha3_new_impl function In-Reply-To: <1614653395.68.0.861850864871.issue43362@roundup.psfhosted.org> Message-ID: <1618697065.66.0.963825242789.issue43362@roundup.psfhosted.org> Christian Heimes added the comment: Excellent finding! The issue was introduced in commit 93d50a6a8d0c5d332c11aef267e66573a09765ac as part of bpo-1635741 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 18:10:18 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 17 Apr 2021 22:10:18 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618697418.35.0.133227365449.issue38530@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24188 pull_request: https://github.com/python/cpython/pull/25462 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 18:28:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 17 Apr 2021 22:28:53 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618698533.28.0.881784537511.issue38530@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0b1c169c4a009e1094fe5df938d2367e63ebeea0 by Pablo Galindo in branch 'master': bpo-38530: Cover more error paths in error suggestion functions (GH-25462) https://github.com/python/cpython/commit/0b1c169c4a009e1094fe5df938d2367e63ebeea0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 18:51:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 17 Apr 2021 22:51:25 +0000 Subject: [issue43860] unittest increment tests executed In-Reply-To: <1618551542.77.0.0261778711624.issue43860@roundup.psfhosted.org> Message-ID: <1618699885.38.0.520148006444.issue43860@roundup.psfhosted.org> Irit Katriel added the comment: See the section on "Distinguishing test iterations using subtests" https://docs.python.org/3/library/unittest.html#distinguishing-test-iterations-using-subtests ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 18:57:30 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 17 Apr 2021 22:57:30 +0000 Subject: [issue43362] Bad free in py_sha3_new_impl function In-Reply-To: <1614653395.68.0.861850864871.issue43362@roundup.psfhosted.org> Message-ID: <1618700250.67.0.297821979836.issue43362@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24189 pull_request: https://github.com/python/cpython/pull/25463 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 20:46:45 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 18 Apr 2021 00:46:45 +0000 Subject: [issue38908] Troubles with @runtime_checkable protocols In-Reply-To: <1618680263.88.0.942642035875.issue38908@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Hi Kevin, If you want to work on this, could you come up with some test cases that try to explore edge cases for this behavior? Ideally some that already pass, and some that currently don't pass (because of the limitation mentioned by Ivan). It's possible that the tests for typing.py already contain some suitable passing tests. You could then investigate whether your proposal seems to work. If it does, you can submit a PR and we can lay this issue to rest! --Guido ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 22:20:43 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 18 Apr 2021 02:20:43 +0000 Subject: [issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled In-Reply-To: <1474611707.66.0.467568151114.issue28254@psf.upfronthosting.co.za> Message-ID: <1618712443.62.0.530155670447.issue28254@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: -rhettinger, scoder, superbobry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 17 22:33:06 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 18 Apr 2021 02:33:06 +0000 Subject: [issue43879] Add native_thread_id to PyThreadState In-Reply-To: <1618651124.52.0.543120021636.issue43879@roundup.psfhosted.org> Message-ID: <1618713186.05.0.262259026057.issue43879@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 00:06:26 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 18 Apr 2021 04:06:26 +0000 Subject: [issue43876] argparse documentation contrasting nargs '*' vs. '+' is misleading In-Reply-To: <1618605356.69.0.0775347773509.issue43876@roundup.psfhosted.org> Message-ID: <1618718786.85.0.203913037488.issue43876@roundup.psfhosted.org> Raymond Hettinger added the comment: For me, it is the opposite. I would have been completely surprised if setting nargs caused an optional argument to become required. The "nargs" parameter is entirely about the number of data arguments, not about the option itself. When nargs=1, then one datum is expected. When nargs=2, two are expected. The "+" means one or more. The "*" means two or more. Sorry you got confused, but I don't think this is a documentation problem. We have multiple examples of using nargs as intended. ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 00:15:37 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 18 Apr 2021 04:15:37 +0000 Subject: [issue43874] argparse crashes on subparsers with no dest/metava In-Reply-To: <1618600066.88.0.240618154113.issue43874@roundup.psfhosted.org> Message-ID: <1618719337.71.0.736568761577.issue43874@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +paul.j3, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 00:25:35 2021 From: report at bugs.python.org (Vince Reuter) Date: Sun, 18 Apr 2021 04:25:35 +0000 Subject: [issue43876] argparse documentation contrasting nargs '*' vs. '+' is misleading In-Reply-To: <1618605356.69.0.0775347773509.issue43876@roundup.psfhosted.org> Message-ID: <1618719935.91.0.927941006525.issue43876@roundup.psfhosted.org> Vince Reuter added the comment: Got it, I see. I guess I'd prefer to be able to control the expectation about argument number through the keyword, without changing the option name, but I understand if the other way (as implemented) is preferred. Can you clarify, though, or direct me in the docs, the distinction in the number expectation between "one or more" vs. "two or more?" What does it mean for "two or more" to be expected (for nargs='*') if there's no parse error thrown even when the option's entirely omitted? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 00:52:00 2021 From: report at bugs.python.org (Vince Reuter) Date: Sun, 18 Apr 2021 04:52:00 +0000 Subject: [issue43876] argparse documentation contrasting nargs '*' vs. '+' is misleading In-Reply-To: <1618605356.69.0.0775347773509.issue43876@roundup.psfhosted.org> Message-ID: <1618721520.93.0.356050655927.issue43876@roundup.psfhosted.org> Vince Reuter added the comment: There are two small related issues, but I'm not sure how they relate and/or if they've been addressed previously, so I'm sorry for duplicate messaging if that's the case. 1. If it's the case that absent an explicit `required=` statement, the option name prefix (hyphen(s) or not) determines whether the option's required, then it seems contradictory to have nargs='*' make a positional arg behave as if it's optional (i.e., no parse error if omitted). 2. Prefixing the option name with hyphen(s) seems to remove any distinction between `nargs='*'` and `nargs='+'` (at least without passing anything explicit about required) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 01:26:16 2021 From: report at bugs.python.org (Vince Reuter) Date: Sun, 18 Apr 2021 05:26:16 +0000 Subject: [issue43876] argparse documentation contrasting nargs '*' vs. '+' is misleading In-Reply-To: <1618605356.69.0.0775347773509.issue43876@roundup.psfhosted.org> Message-ID: <1618723576.8.0.393098003038.issue43876@roundup.psfhosted.org> Vince Reuter added the comment: Looking a bit more at the examples in the "nargs" section of the argparse docs, and on the rest of that page, I think I see the intended usage pattern emerging. nargs='*' is only ever used on that page with an optional (by prefix) option, or with the last positional defined. Conversely, nargs='+' (or "+") is only used with a positional or with an optional that's paired with action="extend". This makes sense given the 0-or-more vs. 1-or-more distinction, but could it be enforced by exception or by warning? Specifically, I can think of a couple dangerous (as far as unintended consequences) cases: 1. Define a sequence of positionals with a nargs='*' sandwiched somewhere in the middle. Then passing fewer arguments at the command-line than defined positionals will cause the nargs='*' one to be skipped, rather than populating truly in order. Example: def _parse_cmdl(cmdl): parser = argparse.ArgumentParser() parser.add_argument("outdata", help="Path to output data file") parser.add_argument("plotTimes", nargs='*', help="Times to plot") parser.add_argument("outplot", help="Path to output plot file") return parser.parse_args(cmdl) would result in a parse of something like: $ ./tinytest.py a b outdata: a plotTimes: [] outplot: b 2. Case initially presented, i.e. a nargs='+' with a hyphen-prefixed option name. If the semantics are no different than for nargs='*', could a warning or exception be thrown for defining something this way? It would feel safer to not have the meaning of a value like this to nargs not be conditional on the name of the option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 01:46:28 2021 From: report at bugs.python.org (paul j3) Date: Sun, 18 Apr 2021 05:46:28 +0000 Subject: [issue43874] argparse crashes on subparsers with no dest/metava In-Reply-To: <1618600066.88.0.240618154113.issue43874@roundup.psfhosted.org> Message-ID: <1618724788.3.0.690673555349.issue43874@roundup.psfhosted.org> paul j3 added the comment: This is a well known (if not fixed) issue - if subparsers is required, then a dest is needed to give a working error message. Looks like we've variously talked about documenting the requirement, or using some sort of substitute for the missing name. One of my higher-voted SO answers: https://stackoverflow.com/questions/23349349/argparse-with-required-subparser/23354355#23354355 https://bugs.python.org/issue29298 https://github.com/python/cpython/pull/18564 https://github.com/python/cpython/pull/3027 https://github.com/python/cpython/pull/3680 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 01:51:42 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 18 Apr 2021 05:51:42 +0000 Subject: [issue43874] argparse crashes on subparsers with no dest/metava In-Reply-To: <1618600066.88.0.240618154113.issue43874@roundup.psfhosted.org> Message-ID: <1618725102.07.0.0461943709063.issue43874@roundup.psfhosted.org> Raymond Hettinger added the comment: Would it be more reasonable to provide a default name (which is what the PR does) or to raise an exception? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 01:53:26 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 18 Apr 2021 05:53:26 +0000 Subject: [issue43857] Fix the AttributeError message for deletion of a missing attribute In-Reply-To: <1618504291.99.0.55591533554.issue43857@roundup.psfhosted.org> Message-ID: <1618725206.62.0.241017546732.issue43857@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 02:20:02 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 18 Apr 2021 06:20:02 +0000 Subject: [issue43877] Logging Cookbook ambiguity In-Reply-To: <1618622288.58.0.221543721652.issue43877@roundup.psfhosted.org> Message-ID: <1618726802.77.0.974655751496.issue43877@roundup.psfhosted.org> Raymond Hettinger added the comment: The multiprocessing.Queue() instance will accumulate messages regardless of whether a producer or consumer is started first. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 02:39:47 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 18 Apr 2021 06:39:47 +0000 Subject: [issue43362] Bad free in py_sha3_new_impl function In-Reply-To: <1614653395.68.0.861850864871.issue43362@roundup.psfhosted.org> Message-ID: <1618727987.67.0.257062413113.issue43362@roundup.psfhosted.org> Christian Heimes added the comment: New changeset aa6da32edc3c6ddfda5e849561e20273b8d82771 by Christian Heimes in branch 'master': bpo-43362: Fix invalid free and return check in _sha3 module (GH-25463) https://github.com/python/cpython/commit/aa6da32edc3c6ddfda5e849561e20273b8d82771 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 02:40:39 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 18 Apr 2021 06:40:39 +0000 Subject: [issue43362] Bad free in py_sha3_new_impl function In-Reply-To: <1614653395.68.0.861850864871.issue43362@roundup.psfhosted.org> Message-ID: <1618728039.08.0.871548208898.issue43362@roundup.psfhosted.org> Christian Heimes added the comment: The issue affected Python 3.10a1 to latest alpha. 3.9 and earlier are not affected. Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 03:11:00 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 18 Apr 2021 07:11:00 +0000 Subject: [issue43641] Update `ssl.PROTOCOL_TLSv1_2` docs since it is not the newest TLS version In-Reply-To: <1616860213.53.0.619119120608.issue43641@roundup.psfhosted.org> Message-ID: <1618729860.48.0.352942101892.issue43641@roundup.psfhosted.org> miss-islington added the comment: New changeset 2798f247c0747d28cb857fa80803797b24696cb6 by Illia Volochii in branch 'master': bpo-43641: Stop stating that TLS 1.2 is the most modern version in docs (GH-25041) https://github.com/python/cpython/commit/2798f247c0747d28cb857fa80803797b24696cb6 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 03:15:52 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 18 Apr 2021 07:15:52 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1618730152.57.0.0600639630685.issue43284@roundup.psfhosted.org> Shreyan Avigyan added the comment: @eryksun described "Apparently the developers do not want to guarantee that the version information on any particular system DLL can be used to get the system version. Apparently they also do not want to officially sanction using the "CurrentMajorVersionNumber", "CurrentMinorVersionNumber", and "CurrentBuildNumber" values in the registry." If that's the case why not get the version from CurrentBuild registry key present in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion. This key at least goes back to Windows 7 and this is the key that's currently being used by winver command. And I don't think anyone at all uses windows version older than Windows 7. And chances are that the key maybe present even before Windows 7. At least the CurrentBuild is accurate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 03:16:04 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 18 Apr 2021 07:16:04 +0000 Subject: [issue43641] Update `ssl.PROTOCOL_TLSv1_2` docs since it is not the newest TLS version In-Reply-To: <1616860213.53.0.619119120608.issue43641@roundup.psfhosted.org> Message-ID: <1618730164.48.0.720038988301.issue43641@roundup.psfhosted.org> Christian Heimes added the comment: Thanks! ---------- nosy: +christian.heimes resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 07:11:51 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 18 Apr 2021 11:11:51 +0000 Subject: [issue36076] ssl.get_server_certificate should use SNI In-Reply-To: <1550832637.63.0.810742849841.issue36076@roundup.psfhosted.org> Message-ID: <1618744311.9.0.604473146568.issue36076@roundup.psfhosted.org> miss-islington added the comment: New changeset 49fdf118aeda891401d638ac32296c7d55d54678 by juhovh in branch 'master': bpo-36076: Add SNI support to ssl.get_server_certificate. (GH-16820) https://github.com/python/cpython/commit/49fdf118aeda891401d638ac32296c7d55d54678 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 07:29:25 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 18 Apr 2021 11:29:25 +0000 Subject: [issue36076] ssl.get_server_certificate should use SNI In-Reply-To: <1550832637.63.0.810742849841.issue36076@roundup.psfhosted.org> Message-ID: <1618745365.62.0.512936006723.issue36076@roundup.psfhosted.org> Christian Heimes added the comment: Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 08:19:16 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 18 Apr 2021 12:19:16 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1618748356.68.0.918723176635.issue43284@roundup.psfhosted.org> Shreyan Avigyan added the comment: I researched a little more and found that before Vista the winver command used the CurrentBuildNumber key instead of CurrentBuild key. In fact before Vista CurrentBuild was marked as obsolete by Microsoft. But that changed in Vista, when Microsoft started using CurrentBuild key instead of the CurrentBuildNumber key. Though still today CurrentBuildNumber key actually gives the exact version (for backward compatibilities maybe?). Therefore why not use CurrentBuildNumber? At least CurrentBuildNumber gives the right info. The only problem is that we have to only use that key to determine the windows version (Eg - Windows 10, 8.1, 8, 7, Vista, etc.) and to do that we have to use a very long switch or if-else statement. https://en.wikipedia.org/wiki/Comparison_of_Microsoft_Windows_versions#Windows_NT has the whole list with the column "RTM build" as the CurrentBuildNumber value. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 11:01:04 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 18 Apr 2021 15:01:04 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1618758064.57.0.973724908018.issue43284@roundup.psfhosted.org> Eryk Sun added the comment: The "CurrentBuild" and "CurrentVersion" values go back to the first release of Windows NT 3.1 in 1993 (build 511, which was quickly replaced by build 528). In NT 3.1 (build 528), the "CurrentBuild" value was "1.528.1 () (July 1993)". In NT 3.5, this awkward string was replaced by the "CurrentBuildNumber" value, and up to NT 5.2 the old "CurrentBuild" value was set to the string "1.511.1 () (Obsolete data - do not use)". It was brought back as the build number starting with Windows Vista (NT 6.0). However, in Windows 10 the related "CurrentVersion" value is now obsolete and frozen at "6.3". The true value is now split into "CurrentMajorVersionNumber" and "CurrentMinorVersionNumber". These registry values aren't a reliable source source of truth. The reliable values are the kernel global variables NtMajorVersion, NtMinorVersion, and NtBuildNumber, which are compiled into the kernel image. They get copied into the process environment block (PEB) of each process as OSMajorVersion, OSMinorVersion, and OSBuildNumber. If the application manifest supports the current OS version, then GetVersion() and GetVersionExW() will simply return these values from the PEB. That's why it was suggested to spawn an instance of the system CMD shell and parse the output of its VER command. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 11:12:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Apr 2021 15:12:09 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618758729.82.0.11252532548.issue43833@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +24190 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25466 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 11:25:14 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Apr 2021 15:25:14 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618759514.92.0.294648517305.issue43833@roundup.psfhosted.org> Serhiy Storchaka added the comment: PR 25466 makes the tokenizer emitting a deprecation warning if the numeric literal is followed by one of keywords which are valid after numeric literals. In future releases it will be changed to syntax warning, and finally to syntax error. It is breaking change, because it makes invalid currently allowed syntax like `0 in x` or `1or x` (but `0or x` is already error). See also issue21642 which allowed parsing "1else" as "1 else". Not all were agreed with that fix. Perhaps we need to rewrite also some paragraphs in the language specification. ---------- components: +Interpreter Core nosy: +Joshua.Landau, gvanrossum, steve.dower versions: -Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 12:19:00 2021 From: report at bugs.python.org (sco1) Date: Sun, 18 Apr 2021 16:19:00 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618762740.16.0.266411571683.issue43833@roundup.psfhosted.org> sco1 added the comment: We can also see this kind of thing with other literals, would that be in scope here? e.g. ``` Python 3.9.4 (default, Apr 5 2021, 12:33:45) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> "foo"in ["foo", "bar"] True >>> [1,]in [[1,]] True ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 12:55:51 2021 From: report at bugs.python.org (Keith Smiley) Date: Sun, 18 Apr 2021 16:55:51 +0000 Subject: [issue43878] ./configure fails on Apple Silicon In-Reply-To: <1618636518.04.0.898249551468.issue43878@roundup.psfhosted.org> Message-ID: <1618764951.08.0.317572718058.issue43878@roundup.psfhosted.org> Keith Smiley added the comment: Thanks for taking a look. My limited understanding is also that these should be able to be updated separately from autoconf, and I feel slightly more confident knowing that in the past folks treated this update as trivial. It seems like the changes should be entirely additive, as in they support new triples but otherwise are API compatible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 12:56:41 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 18 Apr 2021 16:56:41 +0000 Subject: [issue18233] SSLSocket.getpeercertchain() In-Reply-To: <1371415195.44.0.636993698614.issue18233@psf.upfronthosting.co.za> Message-ID: <1618765001.47.0.537208933442.issue18233@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24191 pull_request: https://github.com/python/cpython/pull/25467 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 12:59:25 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 18 Apr 2021 16:59:25 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1618765165.6.0.200544303347.issue43284@roundup.psfhosted.org> Shreyan Avigyan added the comment: But kernel32.dll (since it's of a different version) isn't accurate at all right? To find the accurate result we have to use the CurrentBuildNumber registry key. I think this key will not be removed so easily by Microsoft. This key have been in existence from NT 3.5 till today. I think it's the safest and reliable way to get the version number other than WMI query. I know the key can be removed in the future but if it that happens what about reimplementing the kernel32.dll then. We need a way to get the accurate version right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 13:53:47 2021 From: report at bugs.python.org (Terence Honles) Date: Sun, 18 Apr 2021 17:53:47 +0000 Subject: [issue43874] argparse crashes on subparsers with no dest/metava In-Reply-To: <1618600066.88.0.240618154113.issue43874@roundup.psfhosted.org> Message-ID: <1618768427.26.0.0726977835971.issue43874@roundup.psfhosted.org> Terence Honles added the comment: Thanks for the context Paul. I didn't think to look in the tracker for an existing issue, sorry! I'm not sure if documenting the requirement is sufficient or something that a user would go towards with the error as it is. I _might_ suggest throwing an error if dest/metavar isn't provided when required is true but that would probably only work on creating the sub parser and not if setting attributes as I saw some tests doing. If an error is thrown I'd expect it to be where I placed the default name and it to basically say sub parser has no name (and possibly suggest setting dest or metavar). I think both might be confusing to the end user and likely something that a user relying on argparse might not test but expect to work (I am in that camp except I tested it... I was only wondering what it said). That is why I went with filling out the default of "command" (I also checked only one sub parser was allowed so that wouldn't be too ambiguous). Initially I went with "subcommand" because "subparser" didn't seem to make sense for an end user, but I settled with command since that's what some tests were using for dest and I liked it. I had also thought of expanding to all the options as one of the comments had in the other issue, but required argument: {command1,command2,...} looked a little funny and was less obvious what it meant since it could also looked like N arguments were missing and being represented in a collapsed representation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 14:17:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Apr 2021 18:17:50 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618769870.85.0.321072427264.issue43833@roundup.psfhosted.org> Serhiy Storchaka added the comment: There is no issues with lists and strings. "]" clearly ends the list display, and a quote ends a string literal. The problem with numeric literals is that they can contain letters, so it is not clear (for human reader) where the numeric literals ends and the keyword starts. Adding new numeric prefixes or suffixes or new keywords can break existing code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 14:28:42 2021 From: report at bugs.python.org (sco1) Date: Sun, 18 Apr 2021 18:28:42 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618770522.53.0.423962147278.issue43833@roundup.psfhosted.org> sco1 added the comment: Makes sense, thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 14:57:50 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sun, 18 Apr 2021 18:57:50 +0000 Subject: [issue43804] Add more info about building C/C++ Extensions on Windows using MSVC In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1618772270.71.0.006146909539.issue43804@roundup.psfhosted.org> Shreyan Avigyan added the comment: Kindly have a review of my PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 15:37:00 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 18 Apr 2021 19:37:00 +0000 Subject: [issue43882] urllib.parse should sanitize urls containing ASCII newline and tabs. Message-ID: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> New submission from Senthil Kumaran : A security issue was reported by Mike Lissner wherein an attacker was able to use `\r\n` in the url path, the urlparse method didn't sanitize and allowed those characters be present in the request. > In [9]: from urllib.parse import urlsplit > In [10]: urlsplit("java\nscript:alert('bad')") > Out[10]: SplitResult(scheme='', netloc='', path="java\nscript:alert('bad')", query='', fragment='') Firefox and other browsers ignore newlines in the scheme. From the browser console: >> new URL("java\nscript:alert(bad)") << URL { href: "javascript:alert(bad)", origin: "null", protocol: "javascript:", username: "", password: "", host: "", hostname: "", port: "", pathname: "alert(bad)", search: "" Mozilla Developers informed about the controlling specification for URLs is in fact defined by the "URL Spec" from WHATWG which updates RFC 3986 and specifies that tabs and newlines should be stripped from the scheme. See: https://url.spec.whatwg.org/#concept-basic-url-parser That link defines an automaton for URL parsing. From that link, steps 2 and 3 of scheme parsing read: If input contains any ASCII tab or newline, validation error. 3. Remove all ASCII tab or newline from input. ---- urlparse module behavior should be updated, and an ASCII tab or newline should be removed from the url (sanitized) before it is sent to the request, as WHATWG spec. ---------- assignee: orsenthil messages: 391343 nosy: orsenthil priority: normal severity: normal stage: needs patch status: open title: urllib.parse should sanitize urls containing ASCII newline and tabs. type: security versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 15:43:37 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 18 Apr 2021 19:43:37 +0000 Subject: [issue43883] Making urlparse WHATWG conformant Message-ID: <1618775017.08.0.625993552954.issue43883@roundup.psfhosted.org> New submission from Senthil Kumaran : Mike Lissner reported that a set test suites that exercise extreme conditions with URLs, but in conformance with url.spec.whatwg.org was maintained here: https://github.com/web-platform-tests/wpt/tree/77da471a234e03e65a22ee6df8ceff7aaba391f8/url These test cases were used against urlparse and urljoin method. https://gist.github.com/mlissner/4d2110d7083d74cff3893e261a801515 Quoting verbatim ``` The basic idea is to iterate over the test cases and try joining and parsing them. The script wound up messier than I wanted b/c there's a fair bit of normalization you have to do (e.g., the test cases expect blank paths to be '/', while urlparse returns an empty string), but you'll get the idea. The bad news is that of the roughly 600 test cases fewer than half pass. Some more normalization would fix some more of this, and I don't imagine all of these have security concerns (I haven't thought through it, honestly, but there are issues with domain parsing too that look meddlesome). For now I've taken it as far as I can, and it should be a good start, I think. The final numbers the script cranks out are: Done. 231/586 successes. 1 skipped. ``` ---------- assignee: orsenthil messages: 391344 nosy: orsenthil priority: normal severity: normal stage: needs patch status: open title: Making urlparse WHATWG conformant type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 16:45:25 2021 From: report at bugs.python.org (Jacob Walls) Date: Sun, 18 Apr 2021 20:45:25 +0000 Subject: [issue43802] Seg fault on macOS using multiprocessing.JoinableQueue In-Reply-To: <1618071422.03.0.709836796295.issue43802@roundup.psfhosted.org> Message-ID: <1618778725.62.0.105167431385.issue43802@roundup.psfhosted.org> Jacob Walls added the comment: Unfortunately, at the outset I should have tested this without multiprocessing. I can reproduce without multiprocessing[1], which meant I could more easily pinpoint the failure. There is an expensive O(nm) algorithm[2] in the music21 library that is overflowing. I appreciate your time looking into this. Closing. Regards, Jacob [1] in the provided script, after one call to lc.save() call lc.rebuildMetadataCache(useMultiprocessing=False) [2] music21.analysis.discrete.Ambitus.getPitchRanges(), and I plan to do something about it. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 17:23:18 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 18 Apr 2021 21:23:18 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1618780998.78.0.780163958912.issue43284@roundup.psfhosted.org> Eryk Sun added the comment: > But kernel32.dll (since it's of a different version) isn't > accurate at all right? To clarify, CMD's VER command calls GetVersion(). It has nothing to do with the file version of any system DLL. Because CMD is a system component, the GetVersion() call returns the true OS version number and build number, directly from its PEB OSMajorVersion, OSMinorVersion, and OSBuildNumber values. When the PEB for a process is created, these values are copied from the kernel's NtMajorVersion, NtMinorVersion, and NtBuildNumber values. While the latter may be and most likely are the same as the "CurrentMajorVersionNumber", "CurrentMinorVersionNumber", and "CurrentBuildNumber" values in the registry, the kernel values are not based on the registry. They're compiled into the kernel image when it's built. At boot, the configuration manager sets the registry values to the current values, so that's all fine -- unless someone with admin or system access changes the values (but if a hacker has admin or system access; they own the OS, so such a prank would be the least of one's problems). My concern, if you read my previous comments, is that an engineer at Microsoft rejected someone's attempt to recommend using "CurrentBuildNumber" as a replacement for the old advice to use the file version of "kernel32.dll". That's enough to make me worry about what's planned for a future release. So I'd rather just parse the output from CMD. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 18:01:16 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Apr 2021 22:01:16 +0000 Subject: [issue43883] Making urlparse WHATWG conformant In-Reply-To: <1618775017.08.0.625993552954.issue43883@roundup.psfhosted.org> Message-ID: <1618783276.34.0.574720498186.issue43883@roundup.psfhosted.org> Serhiy Storchaka added the comment: It would be interesting to test also with the yarl module. It is based on urlparse and urljoin, but does extra normalization of %-encoding. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 22:47:38 2021 From: report at bugs.python.org (Ronal Abraham) Date: Mon, 19 Apr 2021 02:47:38 +0000 Subject: [issue43884] Cannot cleanly kill a subprocess using high-level asyncio APIs Message-ID: <1618800458.29.0.766698985684.issue43884@roundup.psfhosted.org> New submission from Ronal Abraham : There doesn't appear to be a way to prematurely kill a subprocess using the high-level asyncio subprocess APIs (https://docs.python.org/3.9/library/asyncio-subprocess.html) without getting a traceback on exit. On exit, the attached program writes the following to stderr: $ python3.9 kill_subprocess.py Exception ignored in: Traceback (most recent call last): ... raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed If I uncomment `# process._transport.close()` or comment `asyncio.sleep(1)`, the walkback disappears. (I get the same behavior in python 3.8. I haven't tried other python versions.) ---------- components: asyncio files: kill_subprocess.py messages: 391349 nosy: asvetlov, rabraham, yselivanov priority: normal severity: normal status: open title: Cannot cleanly kill a subprocess using high-level asyncio APIs type: behavior versions: Python 3.8, Python 3.9 Added file: https://bugs.python.org/file49965/kill_subprocess.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 22:50:04 2021 From: report at bugs.python.org (Ronal Abraham) Date: Mon, 19 Apr 2021 02:50:04 +0000 Subject: [issue43884] Cannot cleanly kill a subprocess using high-level asyncio APIs In-Reply-To: <1618800458.29.0.766698985684.issue43884@roundup.psfhosted.org> Message-ID: <1618800604.01.0.955764715037.issue43884@roundup.psfhosted.org> Ronal Abraham added the comment: Reproducing the program here: import asyncio async def test(): process = await asyncio.create_subprocess_shell( "sleep 2 && echo done", stdout=asyncio.subprocess.PIPE, ) await asyncio.sleep(1) process.kill() await process.wait() # process._transport.close() asyncio.run(test()) Can I use the high-level API to kill a subprocess cleanly without having to access the protected member process._transport? Seems like an oversight perhaps? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 22:56:21 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Apr 2021 02:56:21 +0000 Subject: [issue43837] Operator precedence documentation could be more clear In-Reply-To: <1618375085.85.0.211628673766.issue43837@roundup.psfhosted.org> Message-ID: <1618800981.71.0.721713830127.issue43837@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 23:13:02 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Apr 2021 03:13:02 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618801982.79.0.139086111881.issue43833@roundup.psfhosted.org> Raymond Hettinger added the comment: I recommend just letting this be. Aside from it allowing for a cute riddle, in the real world seems to be harmless and not worth breaking code. There are lots of other harmless oddities such as the space-invader increment operator: x -=- 1 FWIW, a code reformatter such as Black will remove any weirdness. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 23:24:07 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 19 Apr 2021 03:24:07 +0000 Subject: [issue43882] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1618802647.6.0.186507799248.issue43882@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: See also a related issue to sanitise newline on other helper functions https://bugs.python.org/issue30713 See also discussion and compatibility on disallowing control characters : https://bugs.python.org/issue30458 ---------- nosy: +gregory.p.smith, vstinner, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 23:24:56 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 19 Apr 2021 03:24:56 +0000 Subject: [issue43883] Making urlparse WHATWG conformant In-Reply-To: <1618775017.08.0.625993552954.issue43883@roundup.psfhosted.org> Message-ID: <1618802696.06.0.907248524541.issue43883@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 23:38:29 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Apr 2021 03:38:29 +0000 Subject: [issue43602] Include Decimal's in numbers.Real In-Reply-To: <1616481040.42.0.772549255299.issue43602@roundup.psfhosted.org> Message-ID: <1618803509.5.0.93952714102.issue43602@roundup.psfhosted.org> Raymond Hettinger added the comment: Considering Oscar's response, Mark's comments, and prior discussions, we should close this. No strong use cases have emerged that would warrant overturning the long-standing prior decisions on this topic. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 23:43:26 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 19 Apr 2021 03:43:26 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1618803806.01.0.325935880007.issue43833@roundup.psfhosted.org> Guido van Rossum added the comment: Actually I believe a real case was reported on python-dev. I think it is not clean that the boundary between numbers and identifiers is so fluid. ---------- nosy: +Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 23:44:15 2021 From: report at bugs.python.org (Jack O'Connor) Date: Mon, 19 Apr 2021 03:44:15 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1618803855.39.0.520127653381.issue39298@roundup.psfhosted.org> Jack O'Connor added the comment: An update a year later: I have a proof-of-concept branch that adds BLAKE3 support to hashlib: https://github.com/oconnor663/cpython/tree/blake3. That branch is API compatible with the current master branch of https://github.com/oconnor663/blake3-py. Both that module and the upstream BLAKE3 repo are ready to be tagged 1.0, just waiting to see whether any integrations like this one end up requesting changes. Would anyone be interested in moving ahead with this? One of the open questions would be whether CPython would vendor the BLAKE3 optimized assembly files, or whether we'd prefer to stick to C intrinsics. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 23:55:43 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 03:55:43 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1618804543.88.0.105120763206.issue42854@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +24193 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25468 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 18 23:56:17 2021 From: report at bugs.python.org (Larry Hastings) Date: Mon, 19 Apr 2021 03:56:17 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1618804577.48.0.370812426832.issue39298@roundup.psfhosted.org> Larry Hastings added the comment: I note that Python already ships with some #ifdefs around SSE and the like. So, yes, we already do this sort of thing, although I think this usually uses compiler intrinsics rather than actual assembly. A quick grep shows zero .s files and only one .asm file (./Modules/_decimal/libmpdec/vcdiv64.asm) in the Python tree. Therefore it wouldn't be completely novel for Python but it's unusual. I assume there's a completely generic platform-agnostic C implementation, for build environments where the assembly won't work, yes? Disclaimer: I've been corresponding with Jack sporadically over the past year regarding the BLAKE3 Python API. I also think BLAKE3 is super duper cool neat-o, and I have uses for it. So I'd love to see it in Python 3.10. One note, just to draw attention to it: the "blake3-py" module, also published by Jack, is written using the Rust implementation, which I understand is even more performant. Obviously there's no chance Python would ship that implementation. But by maintaining exact API compatibility between "blake3-py" and the "blake3" added to hashlib, this means code can use the fast one when it's available, and the built-in one when it isn't, a la CStringIO: try: from blake3 import blake3 except ImportError: from hashlib import blake3 ---------- versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 00:01:15 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 04:01:15 +0000 Subject: [issue31711] ssl.SSLSocket.send(b"") fails In-Reply-To: <1507282980.19.0.213398074469.issue31711@psf.upfronthosting.co.za> Message-ID: <1618804875.8.0.635467616057.issue31711@roundup.psfhosted.org> Christian Heimes added the comment: Thanks to PEP 644 the issue will be fixed in 3.10 by using SSL_read_ex and SSL_write_ex() functions. I couldn't use the functions earlier because Python had to support older OpenSSL versions and LibreSSL. See https://github.com/python/cpython/pull/25468 and bpo-42854 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed superseder: -> OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() versions: +Python 3.10 -Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 00:03:40 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 04:03:40 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1618805020.1.0.170715938718.issue42854@roundup.psfhosted.org> Christian Heimes added the comment: SSL_write_ex() and SSL_read_ex() solve two issues: * bpo-42853: SSLSocket no longer raises overflow error when sending or receiving more than 2 GB of data * bpo-31711: empty send(b"") no longer fails with protocol violation exception ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 00:04:53 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 04:04:53 +0000 Subject: [issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB In-Reply-To: <1610006589.59.0.311109371799.issue42853@roundup.psfhosted.org> Message-ID: <1618805093.1.0.888449899454.issue42853@roundup.psfhosted.org> Christian Heimes added the comment: Python 3.10 will use SSL_write_ex() and SSL_read_ex(), which support > 2 GB data. ---------- versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 00:22:12 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 04:22:12 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1618806132.91.0.634621892909.issue39298@roundup.psfhosted.org> Christian Heimes added the comment: 3.10 feature freeze is in two weeks (May 3). I don't feel comfortable to add so much new C code shortly before beta 1. If I understandly correctly the code is new and hasn't been published on PyPI yet. I also don't have much time to properly review the code. OpenSSL 3.0.0 and PEP 644 is keeping me busy. I would prefer to postpone the inclusion of blake3. Could you please publish the C version on PyPI first and let people test it? Apropos OpenSSL, do you have plans to submit the algorithm to OpenSSL for inclusion in 3.1.0? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 00:28:21 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Apr 2021 04:28:21 +0000 Subject: [issue43837] Operator precedence documentation could be more clear In-Reply-To: <1618375085.85.0.211628673766.issue43837@roundup.psfhosted.org> Message-ID: <1618806501.13.0.415332922123.issue43837@roundup.psfhosted.org> Raymond Hettinger added the comment: Let's reverse the table in accordance with the de facto standard. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 00:28:45 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Apr 2021 04:28:45 +0000 Subject: [issue43837] Operator precedence documentation could be more clear In-Reply-To: <1618375085.85.0.211628673766.issue43837@roundup.psfhosted.org> Message-ID: <1618806525.02.0.8275054954.issue43837@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: rhettinger -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 00:49:38 2021 From: report at bugs.python.org (Ammar Askar) Date: Mon, 19 Apr 2021 04:49:38 +0000 Subject: [issue43837] Operator precedence documentation could be more clear In-Reply-To: <1618375085.85.0.211628673766.issue43837@roundup.psfhosted.org> Message-ID: <1618807778.09.0.316346302432.issue43837@roundup.psfhosted.org> Change by Ammar Askar : ---------- keywords: +patch nosy: +ammar2 nosy_count: 8.0 -> 9.0 pull_requests: +24194 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25469 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 00:55:30 2021 From: report at bugs.python.org (Ammar Askar) Date: Mon, 19 Apr 2021 04:55:30 +0000 Subject: [issue43837] Operator precedence documentation could be more clear In-Reply-To: <1618375085.85.0.211628673766.issue43837@roundup.psfhosted.org> Message-ID: <1618808130.77.0.319658153456.issue43837@roundup.psfhosted.org> Ammar Askar added the comment: Opened https://github.com/python/cpython/pull/25469 for the first suggestion of reversing the precedence table order since it seems like a good improvement. I think the tight binding to weak order is more natural and aside from K&R, the following other languages also follow the same ordering: * Javascript - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#table * PHP - https://www.php.net/manual/en/language.operators.precedence.php * Rust - https://doc.rust-lang.org/reference/expressions.html#expression-precedence ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 00:55:36 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 04:55:36 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1618808136.98.0.123904162494.issue42854@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 89d1550d14ba689af12eeb726e4ff8ce73cee7e1 by Christian Heimes in branch 'master': bpo-42854: Use SSL_read/write_ex() (GH-25468) https://github.com/python/cpython/commit/89d1550d14ba689af12eeb726e4ff8ce73cee7e1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 00:55:50 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 04:55:50 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1618808150.02.0.556953636867.issue42854@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 01:24:46 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Mon, 19 Apr 2021 05:24:46 +0000 Subject: [issue43837] Operator precedence documentation could be more clear In-Reply-To: <1618375085.85.0.211628673766.issue43837@roundup.psfhosted.org> Message-ID: <1618809886.1.0.838938310624.issue43837@roundup.psfhosted.org> Chris Jerdonek added the comment: > So maybe we should change the terminology while we?re at it. When math is taught to elementary school students in the US, it's called "order of operations": https://en.wikipedia.org/wiki/Order_of_operations Since this was raised in the context of newcomers to coding, it might be worth mentioning that parallel. Being able to connect to the familiar concepts of "first" and "last" might help people not familiar with precedence and binding. ---------- nosy: +chris.jerdonek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 01:27:18 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 05:27:18 +0000 Subject: [issue43880] 3.10 SSL module deprecations In-Reply-To: <1618656955.76.0.569824483108.issue43880@roundup.psfhosted.org> Message-ID: <1618810038.49.0.389282530207.issue43880@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 2875c603b2a7691b55c2046aca54831c91efda8e by Christian Heimes in branch 'master': bpo-43880: Show DeprecationWarnings for deprecated ssl module features (GH-25455) https://github.com/python/cpython/commit/2875c603b2a7691b55c2046aca54831c91efda8e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 01:56:55 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 05:56:55 +0000 Subject: [issue43669] PEP 644: Require OpenSSL 1.1.1 or newer In-Reply-To: <1617106246.37.0.0210118077092.issue43669@roundup.psfhosted.org> Message-ID: <1618811815.73.0.441539659809.issue43669@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24195 pull_request: https://github.com/python/cpython/pull/25470 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 02:31:36 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 06:31:36 +0000 Subject: [issue43669] PEP 644: Require OpenSSL 1.1.1 or newer In-Reply-To: <1617106246.37.0.0210118077092.issue43669@roundup.psfhosted.org> Message-ID: <1618813896.27.0.393669072863.issue43669@roundup.psfhosted.org> Christian Heimes added the comment: New changeset d37b74f341c5a215e2fdd5eb4f8c0182f327635c by Christian Heimes in branch 'master': bpo-43669: More test_ssl cleanups (GH-25470) https://github.com/python/cpython/commit/d37b74f341c5a215e2fdd5eb4f8c0182f327635c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 04:07:46 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 08:07:46 +0000 Subject: [issue43885] ResourceWarning: unclosed test_pha_required_nocert Message-ID: <1618819666.42.0.85346092092.issue43885@roundup.psfhosted.org> New submission from Christian Heimes : bpo-35926 and fb7e7505ed1337bf40fa7b8b68317d1e86675a86 introduced code that is triggered resource errors and unhandled exceptions. It has been bothering me for a while but I could never pin point the issue. Victor's and Hai's commits e80697d687b6 and 73ea54620a6f seem to be related, too. I don't understand the purpose of the test changes in fb7e7505ed1337bf40fa7b8b68317d1e86675a86. The commit looks wrong to me. Could you please take a look? $ ./python -X tracemalloc=10 -m test test_ssl 0:00:00 load avg: 1.37 Run tests sequentially 0:00:00 load avg: 1.37 [1/1] test_ssl /home/heimes/dev/python/cpython/Lib/test/support/threading_helper.py:209: ResourceWarning: unclosed del self.thread Object allocated at (most recent call last): File "/home/heimes/dev/python/cpython/Lib/threading.py", lineno 948 self._bootstrap_inner() File "/home/heimes/dev/python/cpython/Lib/threading.py", lineno 990 self.run() File "/home/heimes/dev/python/cpython/Lib/test/test_ssl.py", lineno 2404 if not self.wrap_conn(): File "/home/heimes/dev/python/cpython/Lib/test/test_ssl.py", lineno 2331 self.sslconn = self.server.context.wrap_socket( File "/home/heimes/dev/python/cpython/Lib/ssl.py", lineno 513 return self.sslsocket_class._create( File "/home/heimes/dev/python/cpython/Lib/ssl.py", lineno 1028 self = cls.__new__(cls, **kwargs) $ ./python -W "error::ResourceWarning" -m test test_ssl 0:00:00 load avg: 1.24 Run tests sequentially 0:00:00 load avg: 1.24 [1/1] test_ssl Warning -- Unraisable exception Exception ignored in: Traceback (most recent call last): File "/home/heimes/dev/python/cpython/Lib/test/support/threading_helper.py", line 209, in __exit__ del self.thread ResourceWarning: unclosed test_ssl failed (env changed) ---------- assignee: steve.dower components: SSL messages: 391367 nosy: christian.heimes, shihai1991, steve.dower, vstinner priority: normal severity: normal stage: patch review status: open title: ResourceWarning: unclosed test_pha_required_nocert type: resource usage versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 04:25:12 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 19 Apr 2021 08:25:12 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1618820712.13.0.620803281636.issue43284@roundup.psfhosted.org> Shreyan Avigyan added the comment: But isn't calling CMD's VER command risky? A process can overwrite its PEB OSMajorVersion, OSMinorVersion, and OSBuildNumber. If the cmd has been set to compatibility mode somehow then the same problem will occur since it will then overwrite its PEB OSMajorVersion, OSMinorVersion, and OSBuildNumber. Using a DLL or registry key bypasses this risk. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 04:25:20 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 19 Apr 2021 08:25:20 +0000 Subject: [issue43884] Cannot cleanly kill a subprocess using high-level asyncio APIs In-Reply-To: <1618800458.29.0.766698985684.issue43884@roundup.psfhosted.org> Message-ID: <1618820720.51.0.875065159741.issue43884@roundup.psfhosted.org> Dennis Sweeney added the comment: Running kill_subprocess.py on Windows 10, I get these results: Python 3.7.2 (tags/v3.7.2:9a3ffc0492) - raises NotImplementedError in base_events.py, _make_subprocess_transport Python 3.8.2 (tags/v3.8.2:7b3ab59) - Success Python 3.9.0 (tags/v3.9.0:9cf6752) - Success Python 3.10.0a6 (tags/v3.10.0a6:cc12888) - Success What is your OS? ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 05:03:51 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 19 Apr 2021 09:03:51 +0000 Subject: [issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring In-Reply-To: <1618106073.56.0.0553736134144.issue43803@roundup.psfhosted.org> Message-ID: <1618823031.62.0.733112648716.issue43803@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: +amaury.forgeotdarc, belopolsky, meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 05:06:07 2021 From: report at bugs.python.org (Federico Pellegrin) Date: Mon, 19 Apr 2021 09:06:07 +0000 Subject: [issue43886] Extending/embedding Python documentation outdated/incomplete Message-ID: <1618823167.79.0.105127180169.issue43886@roundup.psfhosted.org> New submission from Federico Pellegrin : Hello, We had lately some issues with various possible variants of compilation (static vs dynamic) with reference to both embedding and extending Python. There are a bunch of tickets on the topic (ie. #21536 or #34309) but I guess one important point is that the documentation seems to be not very clear on this. Also various Linux distros seem to take very different approaches (static/dynamic). Infact from the current documentation it seems unclear if python-config should be used for both or not. We found also some references to a newer --embed flag (see ie. #36721) which is not mentioned in the documentation. Some other sources suggest that python-config should not be used when Python is build with Py_ENABLE_SHARED=1. (ref. here: https://github.com/conda/conda-build/issues/2738#issuecomment-371148021) Also the example looks probably outdated, as it mentions Python 3.4 It would be nice if some light would be shed on the correct practice to use and the official documentation updated. Thanks, Federico ---------- assignee: docs at python components: Documentation messages: 391370 nosy: docs at python, fede.evol priority: normal severity: normal status: open title: Extending/embedding Python documentation outdated/incomplete type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 05:11:00 2021 From: report at bugs.python.org (Federico Pellegrin) Date: Mon, 19 Apr 2021 09:11:00 +0000 Subject: [issue43886] Extending/embedding Python documentation outdated/incomplete In-Reply-To: <1618823167.79.0.105127180169.issue43886@roundup.psfhosted.org> Message-ID: <1618823460.33.0.542337584506.issue43886@roundup.psfhosted.org> Federico Pellegrin added the comment: Just a small addition: Specifically in the documentation it talks about embedding: " It is not necessarily trivial to find the right flags to pass to your compiler (and linker) in order to embed the Python interpreter into your application, particularly because Python needs to load library modules implemented as C dynamic extensions (.so files) linked against it. To find out the required compiler and linker flags, you can execute the pythonX.Y-config script which is generated as part of the installation process (a python3-config script may also be available). This script has several options, of which the following will be directly useful to you: " But doesn't really say anything about extensions. Is the same python-config used therefore for extensions as well? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 07:48:23 2021 From: report at bugs.python.org (John Mish) Date: Mon, 19 Apr 2021 11:48:23 +0000 Subject: [issue43887] it seems that sorted built-in always return floats before int if they appear to be equal Message-ID: <1618832903.3.0.808077811631.issue43887@roundup.psfhosted.org> New submission from John Mish : A1 >>> sorted([12.000000000000001, 2, 1.999, 2.1, 4, 12]) [1.999, 2, 2.1, 4, 12, 12.000000000000002] A2 >>> sorted([12.0000000000000001, 2, 1.999, 2.1, 4, 12]) [1.999, 2, 2.1, 4, 12.0, 12] B1 >>> sorted([11.999999999999999, 2, 1.999, 2.1, 4, 12]) [1.999, 2, 2.1, 4, 11.999999999999998, 12] B2 >>> sorted([11.9999999999999999, 2, 1.999, 2.1, 4, 12]) [1.999, 2, 2.1, 4, 12.0, 12] Hello, In A2 and in B2 we see the same output for 2 not equal expected values. It seems to be that floats are always first in list. So, what about trying to "store" if some float is 12 "in limit" of 12 but from "left/-"? So then it is < than 12. 12.000000000000000000000000000001 would be then 12 but in upper limit, right/+ so > 12 What do You think? Best regards. PS ofc I could use decimal, but if it shouldn't work, why it does not raise exception and ask for forgiveness... ? ---------- components: Interpreter Core messages: 391372 nosy: johnmish.iam priority: normal severity: normal status: open title: it seems that sorted built-in always return floats before int if they appear to be equal type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 07:50:46 2021 From: report at bugs.python.org (Sviatoslav Sydorenko) Date: Mon, 19 Apr 2021 11:50:46 +0000 Subject: [issue43888] GitHub Actions CI/CD `Coverage` job is broken on master Message-ID: <1618833046.45.0.972351861197.issue43888@roundup.psfhosted.org> New submission from Sviatoslav Sydorenko : I noticed that https://github.com/python/cpython/runs/2378199636 (a coverage job on the last commit on master at the time of writing) takes suspiciously long to complete. I did some investigation and noticed that this job on the 3.9 branch succeeds (all of the job runs on the first page in the list are green ? https://github.com/python/cpython/actions/workflows/coverage.yml?query=branch%3A3.9) But then I took a look at the runs on master and discovered that the last successful run was 4 months ago ? https://github.com/python/cpython/actions.html?query=is%3Asuccess+branch%3Amaster&workflow_file_name=coverage.yml. The last success is https://github.com/python/cpython/actions/runs/444323166 and after that, starting with https://github.com/python/cpython/actions/runs/444405699, if fails consistently. Notably, all of the failures are caused by the job timeout after *6 hours* ? GitHub platform just kills those, 6h is a default per-job timeout in GHA. It's also important to mention that before every job starting timing out effectively burning 6 hours of GHA time for each merge and producing no useful reports, there were occasional 6h-timeouts but they weren't consistent. Looking into the successful runs from the past, on master and other jobs, I haven't noticed it taking more than 1h35m to complete with a successful outcome. Taking into account this as a baseline, I suggest changing the timeout of the whole job or maybe just one step that actually runs coverage. Action items: * Set job timeout in GHA to 1h40m (allowing a bit of extra time for exceptionally slow jobs) ? this will make sure that the failure/timeout is reported sooner than 6h * Figure out why this started happening in the first place. I'm going to send a PR addressing the first point but feel free to pick up the investigation part ? I don't expect to have time for this anytime soon. P.S. FTR the last timeout of this type happened two months ago ? https://github.com/python/cpython/actions.html?page=4&query=branch%3A3.9&workflow_file_name=coverage.yml. ---------- messages: 391373 nosy: webknjaz priority: normal severity: normal status: open title: GitHub Actions CI/CD `Coverage` job is broken on master type: crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 07:51:07 2021 From: report at bugs.python.org (Sviatoslav Sydorenko) Date: Mon, 19 Apr 2021 11:51:07 +0000 Subject: [issue43888] GitHub Actions CI/CD `Coverage` job is broken on master In-Reply-To: <1618833046.45.0.972351861197.issue43888@roundup.psfhosted.org> Message-ID: <1618833067.92.0.645967939272.issue43888@roundup.psfhosted.org> Change by Sviatoslav Sydorenko : ---------- type: crash -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 07:51:22 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 19 Apr 2021 11:51:22 +0000 Subject: [issue40849] Expose X509_V_FLAG_PARTIAL_CHAIN ssl flag In-Reply-To: <1591125628.93.0.87420657479.issue40849@roundup.psfhosted.org> Message-ID: <1618833082.11.0.447264782866.issue40849@roundup.psfhosted.org> miss-islington added the comment: New changeset 64d975202f7a91cb8c61a050fafb4e934fcbaa4e by l0x in branch 'master': bpo-40849: Expose X509_V_FLAG_PARTIAL_CHAIN ssl flag (GH-20463) https://github.com/python/cpython/commit/64d975202f7a91cb8c61a050fafb4e934fcbaa4e ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 08:00:33 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 12:00:33 +0000 Subject: [issue40849] Expose X509_V_FLAG_PARTIAL_CHAIN ssl flag In-Reply-To: <1591125628.93.0.87420657479.issue40849@roundup.psfhosted.org> Message-ID: <1618833633.17.0.0747333181543.issue40849@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 08:06:18 2021 From: report at bugs.python.org (Sviatoslav Sydorenko) Date: Mon, 19 Apr 2021 12:06:18 +0000 Subject: [issue43888] GitHub Actions CI/CD `Coverage` job is broken on master In-Reply-To: <1618833046.45.0.972351861197.issue43888@roundup.psfhosted.org> Message-ID: <1618833978.89.0.25008917231.issue43888@roundup.psfhosted.org> Change by Sviatoslav Sydorenko : ---------- keywords: +patch pull_requests: +24196 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25471 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 08:41:47 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 19 Apr 2021 12:41:47 +0000 Subject: [issue43887] it seems that sorted built-in always return floats before int if they appear to be equal In-Reply-To: <1618832903.3.0.808077811631.issue43887@roundup.psfhosted.org> Message-ID: <1618836107.54.0.140163203413.issue43887@roundup.psfhosted.org> Steven D'Aprano added the comment: Hi John, you said: > it seems that sorted built-in always return floats before int if they appear to be equal But that's not correct: >>> sorted([5.0, 5]) [5.0, 5] >>> sorted([5, 5.0]) [5, 5.0] Python's sort is *stable*, which means that the order of two equal values will always be the same as before they were sorted. You then ask: > So, what about trying to "store" if some float is 12 "in limit" of 12 but from "left/-"? So then it is < than 12. Short answer: no. Longer answer: no, we're not going to complicate and slow down both floats and sorting in order to give "do what I mean" results for sorting. What you are seeing is a fundamental limitation of floating point arithmetic. On the web, you can find dozens of sites that talk about this, in pretty much every single programming language with floating point numbers. You might like to start with the Python FAQ: https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate In your case, you are being tripped up by the fact that there is no such float as either 11.9999999999999999 or 12.0000000000000001. Both of those are rounded to *exactly* 12.0, as the float data type only has (approximately) 17 decimal places of precision. This is a fundamental feature of floating point numbers and there is nothing we can do about that without massively complicating and slowing down floats. By the way, Decimal are floating point numbers too. They are equally affected by this, except that being stored in decimal with more digits by default, rather than binary, it is not so easy to trip over it. But it can certainly happen to Decimals as well. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 09:21:30 2021 From: report at bugs.python.org (John Mish) Date: Mon, 19 Apr 2021 13:21:30 +0000 Subject: [issue43887] it seems that sorted built-in always return floats before int if they appear to be equal In-Reply-To: <1618832903.3.0.808077811631.issue43887@roundup.psfhosted.org> Message-ID: <1618838490.99.0.102297606042.issue43887@roundup.psfhosted.org> John Mish added the comment: Thanks, I should go deeper with it before filing. Wish You have great day Steven. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 09:31:39 2021 From: report at bugs.python.org (Romuald Brunet) Date: Mon, 19 Apr 2021 13:31:39 +0000 Subject: [issue26779] pdb continue followed by an exception in the same frame shows incorrect frame linenumber In-Reply-To: <1460812092.64.0.640871964672.issue26779@psf.upfronthosting.co.za> Message-ID: <1618839099.45.0.152707064436.issue26779@roundup.psfhosted.org> Romuald Brunet added the comment: Ran into a similar issue today This issue (and mine is fixed) in python 3.10. Most probaly related to #24565 fix ---------- nosy: +Romuald versions: +Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 09:32:12 2021 From: report at bugs.python.org (Romuald Brunet) Date: Mon, 19 Apr 2021 13:32:12 +0000 Subject: [issue26779] pdb continue followed by an exception in the same frame shows incorrect frame linenumber In-Reply-To: <1460812092.64.0.640871964672.issue26779@psf.upfronthosting.co.za> Message-ID: <1618839132.15.0.676319680724.issue26779@roundup.psfhosted.org> Romuald Brunet added the comment: I meant: this issue is fixed in 3.10 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 09:54:44 2021 From: report at bugs.python.org (Ronal Abraham) Date: Mon, 19 Apr 2021 13:54:44 +0000 Subject: [issue43884] Cannot cleanly kill a subprocess using high-level asyncio APIs In-Reply-To: <1618800458.29.0.766698985684.issue43884@roundup.psfhosted.org> Message-ID: <1618840484.24.0.489406339724.issue43884@roundup.psfhosted.org> Ronal Abraham added the comment: I see this on MacOS and Linux, but I suspect any Unix-like system would have the same behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 11:12:15 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 19 Apr 2021 15:12:15 +0000 Subject: [issue43889] Pickle performance regression in 3.10 Message-ID: <1618845135.21.0.985662855004.issue43889@roundup.psfhosted.org> New submission from Ken Jin : Hi everyone, I noticed on speed.python.org that the pickle benchmarks are noticeably slower: Overall, pickle slowed down by >10% https://speed.python.org/timeline/?exe=12&base=&ben=pickle&env=1&revs=200&equid=off&quarts=on&extr=on Pickling list and dict is also slower by >10%: https://speed.python.org/timeline/?exe=12&base=&ben=pickle_list&env=1&revs=200&equid=off&quarts=on&extr=on https://speed.python.org/timeline/?exe=12&base=&ben=pickle_dict&env=1&revs=200&equid=off&quarts=on&extr=on For some reason, the pickle_pure_python benchmark which doesn't use the _pickle C library has no change. The regression happened somewhere between commit 11159d2c9d6616497ef4cc62953a5c3cc8454afb and 3fc65b97d09fd29272fdf60d2e567bfb070da824. I don't know which commit caused it as there doesn't seem to be a change to _pickle.c. I have a weak hunch that it may be linked to Issue38530 (since the other commits in that time range are docs, sqllite3, ssl and unrelated python libraries) but I'm unsure. I'll try to bisect things this weekend if nobody's started on it by then. Thanks for your time! ---------- components: Library (Lib) messages: 391380 nosy: alexandre.vassalotti, kj, pablogsal, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Pickle performance regression in 3.10 versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 11:22:23 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Apr 2021 15:22:23 +0000 Subject: [issue43837] Operator precedence documentation could be more clear In-Reply-To: <1618375085.85.0.211628673766.issue43837@roundup.psfhosted.org> Message-ID: <1618845743.1.0.413741835662.issue43837@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 68ba0c67cac10c2545ea3b62d8b161e5b3594edd by Ammar Askar in branch 'master': bpo-43837: Reverse order of precedence table to show tightly binding operators first (GH-25469) https://github.com/python/cpython/commit/68ba0c67cac10c2545ea3b62d8b161e5b3594edd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 11:22:45 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 19 Apr 2021 15:22:45 +0000 Subject: [issue43837] Operator precedence documentation could be more clear In-Reply-To: <1618375085.85.0.211628673766.issue43837@roundup.psfhosted.org> Message-ID: <1618845765.16.0.664576219737.issue43837@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 10.0 -> 11.0 pull_requests: +24198 pull_request: https://github.com/python/cpython/pull/25472 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 11:28:28 2021 From: report at bugs.python.org (wyz23x2) Date: Mon, 19 Apr 2021 15:28:28 +0000 Subject: [issue41370] PEP 585 and ForwardRef In-Reply-To: <1595448974.26.0.905372860878.issue41370@roundup.psfhosted.org> Message-ID: <1618846108.11.0.285046121261.issue41370@roundup.psfhosted.org> Change by wyz23x2 : ---------- nosy: -wyz23x2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 11:33:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 19 Apr 2021 15:33:15 +0000 Subject: [issue43889] Pickle performance regression in 3.10 In-Reply-To: <1618845135.21.0.985662855004.issue43889@roundup.psfhosted.org> Message-ID: <1618846395.91.0.569215572408.issue43889@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: It definitely shouldn't be related to any of these, all are unrelated code paths. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 11:39:07 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 19 Apr 2021 15:39:07 +0000 Subject: [issue43889] Pickle performance regression in 3.10 In-Reply-To: <1618845135.21.0.985662855004.issue43889@roundup.psfhosted.org> Message-ID: <1618846747.97.0.285463900585.issue43889@roundup.psfhosted.org> Ken Jin added the comment: > It definitely shouldn't be related to any of these, all are unrelated code paths. Yeah I thought so too :(. After looking at the benchmark code in pyperformance, I can't find anything related in the commits that would cause such a big difference. Hmmm... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 11:44:08 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Apr 2021 15:44:08 +0000 Subject: [issue43889] Pickle performance regression in 3.10 In-Reply-To: <1618845135.21.0.985662855004.issue43889@roundup.psfhosted.org> Message-ID: <1618847048.49.0.152258499405.issue43889@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 11:56:45 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Apr 2021 15:56:45 +0000 Subject: [issue43837] Operator precedence documentation could be more clear In-Reply-To: <1618375085.85.0.211628673766.issue43837@roundup.psfhosted.org> Message-ID: <1618847805.4.0.536699881504.issue43837@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 072ec69af592611f36349f5048569ab7e72b8b61 by Miss Islington (bot) in branch '3.9': bpo-43837: Reverse order of precedence table to show tightly binding operators first (GH-25469) (GH-25472) https://github.com/python/cpython/commit/072ec69af592611f36349f5048569ab7e72b8b61 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 12:10:14 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Apr 2021 16:10:14 +0000 Subject: [issue43837] Operator precedence documentation could be more clear In-Reply-To: <1618375085.85.0.211628673766.issue43837@roundup.psfhosted.org> Message-ID: <1618848614.93.0.96028461963.issue43837@roundup.psfhosted.org> Raymond Hettinger added the comment: * Changed the table order to match norms. * Not adding and for variables because that is outside the norm (likely because variables aren't operators). * Keeping the existing terminology which is standard and historically hasn't been a problem. Also the tone and level matches that for the rest of the reference guide. Thank you all for your input. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 12:59:58 2021 From: report at bugs.python.org (Sunday) Date: Mon, 19 Apr 2021 16:59:58 +0000 Subject: [issue43710] Access violations in C extension modules on Python 3.9.3 In-Reply-To: <1617419380.7.0.273976800885.issue43710@roundup.psfhosted.org> Message-ID: <1618851598.33.0.29382577283.issue43710@roundup.psfhosted.org> Change by Sunday : Added file: https://bugs.python.org/file49966/logs.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 14:36:19 2021 From: report at bugs.python.org (Thomas Buhrmann) Date: Mon, 19 Apr 2021 18:36:19 +0000 Subject: [issue43890] Deadlock when mixing event loops and subprocesses Message-ID: <1618857379.44.0.428651349576.issue43890@roundup.psfhosted.org> New submission from Thomas Buhrmann : When mixing code that spawns subprocesses with code that creates event loops, Python appears to deadlock. In the attached example, when WORKERS = 16 and ASYNC_WORKERS = 8, Python will sometimes (50% of the time?) deadlock, never exiting, with no exceptions raised. Oddly, if ASYNC_WORKERS is set to 0 or 16 (i.e., only subprocesses or only event loops), it runs reliably. I tested this in an x86_64 Ubuntu 20.04.2 VM with Python 3.8.6. I was only able to reproduce it when the VM had more than one CPU, and I was unable to reproduce it on x86_64 MacOS. ---------- files: subprocess_asyncio_deadlock.py messages: 391386 nosy: thomas priority: normal severity: normal status: open title: Deadlock when mixing event loops and subprocesses type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file49967/subprocess_asyncio_deadlock.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 15:12:37 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 19 Apr 2021 19:12:37 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1618859557.1.0.973268020048.issue43492@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: SQLite 3.35.5 is out today. Let's wait until next weekend and see if fossil and forum is quiet. If they are, I'll open PRs for the installers. https://www.sqlite.org/releaselog/3_35_5.html ---------- title: Upgrade to SQLite 3.35.4 in macOS and Windows -> Upgrade to SQLite 3.35.5 in macOS and Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 15:31:47 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 19 Apr 2021 19:31:47 +0000 Subject: [issue38748] 32 bit ctypes stdcall callback fails to restore stack pointer In-Reply-To: <1573232254.38.0.286098798289.issue38748@roundup.psfhosted.org> Message-ID: <1618860707.87.0.115491794171.issue38748@roundup.psfhosted.org> Steve Dower added the comment: Even better, one that doesn't crash but safely returns a value that can be checked. (IIRC, we have a test that does this to ensure that structs smaller than 9 bytes are passed on the stack.) Half C/half Python is fine - the C bits would go into _ctypes_test.c Given how well you reported the issue in the first place, I'm confident the quick start in the devguide will get you up and building quickly: https://devguide.python.org/ Adding the test might be a bit more of an adventure (though not as much as fixing it...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 15:35:19 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 19:35:19 +0000 Subject: [issue43880] 3.10 SSL module deprecations In-Reply-To: <1618656955.76.0.569824483108.issue43880@roundup.psfhosted.org> Message-ID: <1618860919.54.0.479999063119.issue43880@roundup.psfhosted.org> Christian Heimes added the comment: I'm leaving the issue open as a reminder to improve whatsnew documentation. ---------- priority: high -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 15:36:02 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 19 Apr 2021 19:36:02 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1618860962.74.0.306800754081.issue43284@roundup.psfhosted.org> Eryk Sun added the comment: > But isn't calling CMD's VER command risky? A process can overwrite its > PEB OSMajorVersion, OSMinorVersion, and OSBuildNumber. As long as VER is executed without quotes, the shell will not search for an external command. CMD is not going to intentionally overwrite the OS version and build number in the PEB, so that would be due to some kind of weird, unlikely bug. (CMD's code base is stable. It hasn't seen a new feature since MKLINK was added 15 years ago.) If malware messes with this, for some strange reason, it's not Python's problem. For example, I'll attach a debugger and do just that: 0:000> ?? @$peb->OSMajorVersion = 11 unsigned long 0xb 0:000> ?? @$peb->OSMinorVersion = 0 unsigned long 0 0:000> ?? @$peb->OSBuildNumber = 0x8000 unsigned short 0x8000 C:\>ver Microsoft Windows [Version 11.0.32768.0] Hi from the future. :) > If the cmd has been set to compatibility mode "%SystemRoot%\System32\cmd.exe" is exempt from compatibility mode (e.g. the "__COMPAT_LAYER" environment variable). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 15:43:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 19 Apr 2021 19:43:33 +0000 Subject: [issue43885] ResourceWarning: unclosed test_pha_required_nocert In-Reply-To: <1618819666.42.0.85346092092.issue43885@roundup.psfhosted.org> Message-ID: <1618861413.73.0.766698890395.issue43885@roundup.psfhosted.org> STINNER Victor added the comment: Duplicate of bpo-37322 that I reported at 2019-06-17. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 15:45:51 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 19 Apr 2021 19:45:51 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1618861551.74.0.572638897753.issue43284@roundup.psfhosted.org> Shreyan Avigyan added the comment: Ok. So are you planning to implement this fix? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 15:46:02 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 19 Apr 2021 19:46:02 +0000 Subject: [issue43888] GitHub Actions CI/CD `Coverage` job is broken on master In-Reply-To: <1618833046.45.0.972351861197.issue43888@roundup.psfhosted.org> Message-ID: <1618861562.41.0.374894560544.issue43888@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +brett.cannon, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 15:49:22 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 19:49:22 +0000 Subject: [issue32813] SSL shared_ciphers implementation wrong - returns configured but not shared ciphers In-Reply-To: <1518246255.91.0.467229070634.issue32813@psf.upfronthosting.co.za> Message-ID: <1618861762.16.0.973374168855.issue32813@roundup.psfhosted.org> Christian Heimes added the comment: 3.10 now supports only OpenSSL versions that return the correct value. Older Python versions may return wrong value when they are linked with OpenSSL 1.1.0 or 1.0.2. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 15:53:59 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 19:53:59 +0000 Subject: [issue34670] Add set_post_handshake_auth for TLS 1.3 In-Reply-To: <1536884168.95.0.956365154283.issue34670@psf.upfronthosting.co.za> Message-ID: <1618862039.53.0.643924099392.issue34670@roundup.psfhosted.org> Christian Heimes added the comment: I don't think is anything left to do here. PHA has been supported for a while and I haven't seen any problems. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 15:55:42 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 19:55:42 +0000 Subject: [issue36137] SSL verification fails for some sites inside windows docker container In-Reply-To: <1551278097.55.0.344471071893.issue36137@roundup.psfhosted.org> Message-ID: <1618862142.0.0.428736959118.issue36137@roundup.psfhosted.org> Christian Heimes added the comment: I'm closing this issue as duplicate of #36137. There is no need to keep two issues open for the same problem. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> SSL verification fails for some sites inside windows docker container _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 15:56:08 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 19 Apr 2021 19:56:08 +0000 Subject: [issue43866] Installation files of the Python In-Reply-To: <1618582023.9.0.574924434196.issue43866@roundup.psfhosted.org> Message-ID: <1618862168.7.0.0613668612523.issue43866@roundup.psfhosted.org> Steve Dower added the comment: Yeah, it's a known limitation of the installer technology we're using. issue25166 is the same issue, so we'll track it there. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Windows AllUsers installation places uninstaller in user profile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 15:58:36 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 19 Apr 2021 19:58:36 +0000 Subject: [issue40432] Pegen regenerate project for Windows not working In-Reply-To: <1588127830.15.0.595745305392.issue40432@roundup.psfhosted.org> Message-ID: <1618862316.95.0.919604203336.issue40432@roundup.psfhosted.org> Steve Dower added the comment: That'll be a change to PCbuild/find_python.bat that needs to be backported then. It probably defaults to 3.7 in all branches right now, but since 3.9 is out we can update them all to that (it downloads on demand if necessary). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 15:59:09 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 19:59:09 +0000 Subject: [issue35422] misleading error message from ssl.get_server_certificate() when bad port In-Reply-To: <1544045072.3.0.788709270274.issue35422@psf.upfronthosting.co.za> Message-ID: <1618862349.68.0.811218339962.issue35422@roundup.psfhosted.org> Christian Heimes added the comment: There is no easy fix for that. The TLS handskae is performed by OpenSSL internally. You could open a feature request with OpenSSL and ask them to implement better error detection and reporting. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 15:59:46 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 19:59:46 +0000 Subject: [issue37120] Provide knobs to disable session ticket generation on TLS 1.3 In-Reply-To: <1559365529.23.0.311490427939.issue37120@roundup.psfhosted.org> Message-ID: <1618862386.19.0.569998448333.issue37120@roundup.psfhosted.org> Change by Christian Heimes : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 16:01:01 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 20:01:01 +0000 Subject: [issue37666] urllib.requests.urlopen: deprecate cafile=None, capath=None, cadefault=False In-Reply-To: <1563926058.03.0.180495297284.issue37666@roundup.psfhosted.org> Message-ID: <1618862461.41.0.547049638927.issue37666@roundup.psfhosted.org> Change by Christian Heimes : ---------- assignee: christian.heimes -> components: -SSL title: urllib.requests.urlopen doesn't support cadata= -> urllib.requests.urlopen: deprecate cafile=None, capath=None, cadefault=False versions: +Python 3.10 -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 16:02:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 19 Apr 2021 20:02:17 +0000 Subject: [issue25460] Misc/.gdbinit uses preprocessor macro In-Reply-To: <1445526835.22.0.109540938613.issue25460@psf.upfronthosting.co.za> Message-ID: <1618862537.9.0.123331430764.issue25460@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 2.0 -> 3.0 pull_requests: +24199 pull_request: https://github.com/python/cpython/pull/25473 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 16:02:45 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 20:02:45 +0000 Subject: [issue34028] Python 3.7.0 wont compile with SSL Support 1.1.0 > alledged missing X509_VERIFY_PARAM_set1_host() support In-Reply-To: <1530609211.5.0.56676864532.issue34028@psf.upfronthosting.co.za> Message-ID: <1618862565.16.0.839934718885.issue34028@roundup.psfhosted.org> Christian Heimes added the comment: Python 3.10 contains various improvements that make it easier to compile and link Python with a custom OpenSSL installation. You can find more information in ticket bpo-43466. ---------- resolution: -> fixed stage: -> resolved status: open -> closed superseder: -> ssl/hashlib: Add configure option to set or auto-detect rpath to OpenSSL libs versions: +Python 3.10 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 16:03:55 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 20:03:55 +0000 Subject: [issue41556] hostname verification fails if hostname starts with literal IPv4 In-Reply-To: <1597483503.9.0.826978747102.issue41556@roundup.psfhosted.org> Message-ID: <1618862635.75.0.663207490185.issue41556@roundup.psfhosted.org> Christian Heimes added the comment: There is no progress on the OpenSSL bug yet. ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 16:04:50 2021 From: report at bugs.python.org (Tianon) Date: Mon, 19 Apr 2021 20:04:50 +0000 Subject: [issue36011] ssl - tls verify on Windows fails In-Reply-To: <1550342172.09.0.390948819907.issue36011@roundup.psfhosted.org> Message-ID: <1618862690.47.0.763801256861.issue36011@roundup.psfhosted.org> Change by Tianon : ---------- nosy: +tianon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 16:06:54 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 20:06:54 +0000 Subject: [issue37355] SSLSocket.read does a GIL round-trip for every 16KB TLS record In-Reply-To: <1561056169.29.0.814417679233.issue37355@roundup.psfhosted.org> Message-ID: <1618862814.97.0.636367333221.issue37355@roundup.psfhosted.org> Christian Heimes added the comment: Josh, could you please rebase your branch and create a pull request? The PR process will verify that you have submitted a CLA. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 16:08:54 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 19 Apr 2021 20:08:54 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1618861551.74.0.572638897753.issue43284@roundup.psfhosted.org> Message-ID: <61ffe2fb-1c27-3d9d-7b5e-afc93a2162a3@python.org> Steve Dower added the comment: Python is a volunteer built project, so someone will need to volunteer to write the fix. Until there is a volunteer, there is no plan. (One of the core devs might volunteer, but there's no guarantee of that.) If we're going to launch cmd.exe, I'd prefer to only do that in the platform module and not the sys function. Nothing in sys should start a subprocess (if we can at all avoid it). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 16:09:21 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 20:09:21 +0000 Subject: [issue42166] corrupted size vs. prev_size In-Reply-To: <1603786975.91.0.349324369107.issue42166@roundup.psfhosted.org> Message-ID: <1618862961.73.0.416942330756.issue42166@roundup.psfhosted.org> Christian Heimes added the comment: Python 3.7 no longer receives regular updates. Please feel free to reopen the bug if you can reproduce the issue with a more recent Python and OpenSSL version. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 16:10:18 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 20:10:18 +0000 Subject: [issue43811] Run GHA CI with multiple OpenSSL versions In-Reply-To: <1618216687.81.0.190201617408.issue43811@roundup.psfhosted.org> Message-ID: <1618863018.78.0.332161062839.issue43811@roundup.psfhosted.org> Change by Christian Heimes : ---------- dependencies: -Run GHA CI with multiple OpenSSL versions resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 16:13:29 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 20:13:29 +0000 Subject: [issue34391] test_ftplib is failing with TLS 1.3 In-Reply-To: <1534153835.38.0.56676864532.issue34391@psf.upfronthosting.co.za> Message-ID: <1618863209.31.0.307411637506.issue34391@roundup.psfhosted.org> Christian Heimes added the comment: I don't think there is anything left to do. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 16:18:39 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 19 Apr 2021 20:18:39 +0000 Subject: [issue32951] Prohibit direct instantiation of SSLSocket and SSLObject In-Reply-To: <1519579084.45.0.467229070634.issue32951@psf.upfronthosting.co.za> Message-ID: <1618863519.31.0.391439136162.issue32951@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 16:24:35 2021 From: report at bugs.python.org (Mike Lissner) Date: Mon, 19 Apr 2021 20:24:35 +0000 Subject: [issue43883] Making urlparse WHATWG conformant In-Reply-To: <1618775017.08.0.625993552954.issue43883@roundup.psfhosted.org> Message-ID: <1618863875.71.0.120918567564.issue43883@roundup.psfhosted.org> Change by Mike Lissner : ---------- nosy: +Mike.Lissner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 16:24:54 2021 From: report at bugs.python.org (Mike Lissner) Date: Mon, 19 Apr 2021 20:24:54 +0000 Subject: [issue43882] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1618863894.01.0.0705641707035.issue43882@roundup.psfhosted.org> Change by Mike Lissner : ---------- nosy: +Mike.Lissner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 16:37:40 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 19 Apr 2021 20:37:40 +0000 Subject: [issue43878] ./configure fails on Apple Silicon In-Reply-To: <1618636518.04.0.898249551468.issue43878@roundup.psfhosted.org> Message-ID: <1618864660.71.0.405323209065.issue43878@roundup.psfhosted.org> Ned Deily added the comment: I'm unable to reproduce the failure you see using the current top of the master branch (or the 3.9 branch) when running ./configure on an M1 Mac with macOS 11.2.3 and Xcode 12.4. The results I see are: checking build system type... arm-apple-darwin20.3.0 checking host system type... arm-apple-darwin20.3.0 How are you producing the source that you are building from? ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 16:51:40 2021 From: report at bugs.python.org (Keith Smiley) Date: Mon, 19 Apr 2021 20:51:40 +0000 Subject: [issue43878] ./configure fails on Apple Silicon In-Reply-To: <1618636518.04.0.898249551468.issue43878@roundup.psfhosted.org> Message-ID: <1618865500.29.0.819108569858.issue43878@roundup.psfhosted.org> Keith Smiley added the comment: Thanks for checking, I was able to debug further and it turns out the actual issue is if you use `uname` from `coreutils`, you get different results: ``` % /opt/homebrew/opt/coreutils/libexec/gnubin/uname -p arm64 % /usr/bin/uname -p arm ``` I have this in my $PATH (not specifically for uname but for other coreutils binaries) which is what lead to this. This update fixes this because the newer config.sub version contains a case for `arm64` that didn't exist before https://github.com/python/cpython/pull/25450/files#diff-9c966208fd0a0c8e24a1526da6904887c378283b9b645b9740c19339884174d9R1107 So this isn't as big of an issue as I thought, but I still think it makes sense to update these files. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 17:01:07 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 19 Apr 2021 21:01:07 +0000 Subject: [issue43466] ssl/hashlib: Add configure option to set or auto-detect rpath to OpenSSL libs In-Reply-To: <1615418043.46.0.229114131093.issue43466@roundup.psfhosted.org> Message-ID: <1618866067.84.0.29592749482.issue43466@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24200 pull_request: https://github.com/python/cpython/pull/25475 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 17:02:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 19 Apr 2021 21:02:22 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1618866142.35.0.382012532312.issue38530@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24201 pull_request: https://github.com/python/cpython/pull/25473 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 17:04:27 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 19 Apr 2021 21:04:27 +0000 Subject: [issue43878] ./configure fails on Apple Silicon In-Reply-To: <1618636518.04.0.898249551468.issue43878@roundup.psfhosted.org> Message-ID: <1618866267.08.0.643988767693.issue43878@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the additional info and the PR. Yes, it probably does make sense to update them. But it also makes sense to avoid getting into problems building (Python and likely some other projects) with replacements for Apple-supplied utilities :) I note that MacPorts installs coreutils with a "g" prefix (e.g. "guname") for just this reason. ---------- type: compile error -> enhancement versions: -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 17:07:09 2021 From: report at bugs.python.org (Keith Smiley) Date: Mon, 19 Apr 2021 21:07:09 +0000 Subject: [issue43878] ./configure fails on Apple Silicon with coreutils uname In-Reply-To: <1618636518.04.0.898249551468.issue43878@roundup.psfhosted.org> Message-ID: <1618866429.7.0.229677713938.issue43878@roundup.psfhosted.org> Keith Smiley added the comment: Yep for sure, this is the first time I've hit a difference with uname specifically ---------- title: ./configure fails on Apple Silicon -> ./configure fails on Apple Silicon with coreutils uname _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 18:01:07 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 19 Apr 2021 22:01:07 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1618869667.79.0.254640241615.issue43284@roundup.psfhosted.org> Eryk Sun added the comment: > If we're going to launch cmd.exe, I'd prefer to only do that in the > platform module and not the sys function. Nothing in sys should > start a subprocess (if we can at all avoid it). In that case, would you want to deprecate sys.getwindowsversion().platform_version? platform._syscmd_ver() is already implemented to parse the output of CMD's VER command. The result has to be post-processed because the regex isn't as exact as it could be. It supports versions back to Windows 2000, which returned "Microsoft Windows 2000 [Version maj.min.build]". Starting with Windows Vista up to early versions of Windows 10, the format is "Microsoft Windows [Version maj.min.build]". In more recent versions of Windows 10, it includes the update build revision number -- "Microsoft Windows [Version maj.min.build.ubr]". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 18:14:33 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 19 Apr 2021 22:14:33 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1618869667.79.0.254640241615.issue43284@roundup.psfhosted.org> Message-ID: <52772a50-3de8-18a3-f7a4-198a07745eb3@python.org> Steve Dower added the comment: > In that case, would you want to deprecate sys.getwindowsversion().platform_version? Yeah, but I'm not so concerned about raising a warning on use. Just in the docs will be fine. We should also add a mention that it is extracting the value from efficient but unstable system locations that may change in future releases. (That is not my suggested wording btw, just the gist of what we should mention.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 18:15:40 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 19 Apr 2021 22:15:40 +0000 Subject: [issue31213] __context__ reset to None in nested exception In-Reply-To: <1502819039.28.0.810222147268.issue31213@psf.upfronthosting.co.za> Message-ID: <1618870540.54.0.288246360648.issue31213@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 18:36:05 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 19 Apr 2021 22:36:05 +0000 Subject: [issue25460] Misc/.gdbinit uses preprocessor macro In-Reply-To: <1445526835.22.0.109540938613.issue25460@psf.upfronthosting.co.za> Message-ID: <1618871765.42.0.799582220993.issue25460@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 7a041162468b83f6cad667b78ed5c786286aed2b by Pablo Galindo in branch 'master': bpo-25460: Surround suggestions by quotes (GH-25473) https://github.com/python/cpython/commit/7a041162468b83f6cad667b78ed5c786286aed2b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 18:44:11 2021 From: report at bugs.python.org (Brett Cannon) Date: Mon, 19 Apr 2021 22:44:11 +0000 Subject: [issue43888] GitHub Actions CI/CD `Coverage` job is broken on master In-Reply-To: <1618833046.45.0.972351861197.issue43888@roundup.psfhosted.org> Message-ID: <1618872251.51.0.629724195415.issue43888@roundup.psfhosted.org> Brett Cannon added the comment: It might be time to just kill the coverage report since people are obviously not looking at the results. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 19:00:10 2021 From: report at bugs.python.org (Larry Hastings) Date: Mon, 19 Apr 2021 23:00:10 +0000 Subject: [issue43891] co_annotations branch caused a crash in stackeffect() in compile.c Message-ID: <1618873210.06.0.38844739847.issue43891@roundup.psfhosted.org> New submission from Larry Hastings : I'm working on a branch to implement PEP 649: https://github.com/larryhastings/co_annotations/ Inada Naoki discovered a crash in that branch, discussed here, including steps to reproduce: https://github.com/larryhastings/co_annotations/issues/10 valgrind showed me what the problem was. stackeffect() allocates a "stack" variable, used to store pushed/popped context while iterating over the basic blocks of the function being assembled. Most of the time, the stack is way bigger than it needs to be--we allocate 4 or 5 entries and it only uses 1 or 2. But, somehow, in the co_annotations branch, the "stack" was occasionally *way too small*. As in, it allocated 66 entries (!) but used 150 (!!). I don't understand exactly how stackeffect works, so I don't know under what circumstances it would go so deep, much less what would cause it to so severely underestimate how many entries it needed. I *did* make modifications to code generation in compile.c, so it *could* be my bug--but my changes were all much earlier in the process, and AFAIK I never touched any of the code under assemble(). Well, not until I worked around this problem, anyway. My fix: if "stack" is too small, double the size and realloc(). Certainly it makes the problem go away. That's checked in to my branch here: https://github.com/larryhastings/co_annotations/commit/63b415c3607af8ba9263b179fb05bb89ccd2e036 But it doesn't address the underlying bug, whatever it is. If anybody who understands stackeffect() could take a look and figure it out? That would be neat-o keen. ---------- components: Interpreter Core messages: 391413 nosy: larry priority: normal severity: normal stage: patch review status: open title: co_annotations branch caused a crash in stackeffect() in compile.c type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 19:00:38 2021 From: report at bugs.python.org (Larry Hastings) Date: Mon, 19 Apr 2021 23:00:38 +0000 Subject: [issue43891] co_annotations branch caused a crash in stackeffect() in compile.c In-Reply-To: <1618873210.06.0.38844739847.issue43891@roundup.psfhosted.org> Message-ID: <1618873238.26.0.396840296178.issue43891@roundup.psfhosted.org> Larry Hastings added the comment: (Sorry, the name of the function is stackdepth(), not stackeffect().) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 19:25:56 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Apr 2021 23:25:56 +0000 Subject: [issue43834] Use context manager in StringIO example In-Reply-To: <1618344155.0.0.639710984937.issue43834@roundup.psfhosted.org> Message-ID: <1618874756.12.0.297470969409.issue43834@roundup.psfhosted.org> Raymond Hettinger added the comment: Let's leave the example as-is. The principal use case for these objects is to pass them into other APIs that require file-like objects. Those can't always be put in a context manager. For this example, we mainly want to communicate that getvalue() must be called before the object is closed. The current form communicates that clearly. Thanks for the suggestion. ---------- nosy: +rhettinger resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 19:27:32 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Apr 2021 23:27:32 +0000 Subject: [issue43834] Use context manager in StringIO example In-Reply-To: <1618344155.0.0.639710984937.issue43834@roundup.psfhosted.org> Message-ID: <1618874852.19.0.937492454741.issue43834@roundup.psfhosted.org> Raymond Hettinger added the comment: Except for that, the PR looks fine. Leaving this open to see what Benjamin thinks. ---------- resolution: rejected -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 20:32:20 2021 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 20 Apr 2021 00:32:20 +0000 Subject: [issue43834] Use context manager in StringIO example In-Reply-To: <1618344155.0.0.639710984937.issue43834@roundup.psfhosted.org> Message-ID: <1618878740.6.0.626230588993.issue43834@roundup.psfhosted.org> Benjamin Peterson added the comment: I agree that closing or using a context manager with StringIO (or BytesIO) is not something one normally has to do, so it doesn't need to be in the example. ---------- resolution: -> rejected status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 20:48:16 2021 From: report at bugs.python.org (Jack O'Connor) Date: Tue, 20 Apr 2021 00:48:16 +0000 Subject: [issue39298] add BLAKE3 to hashlib In-Reply-To: <1578716860.16.0.194711020268.issue39298@roundup.psfhosted.org> Message-ID: <1618879696.53.0.706338556346.issue39298@roundup.psfhosted.org> Jack O'Connor added the comment: Hey Christian, yes these are new bindings, and also incomplete. See comments in https://github.com/oconnor663/cpython/commit/dc6f6163ad9754c9ad53e9e3f3613ca3891a77ba, but in short only x86-64 Unix is in working order. If 3.10 doesn't seem realistic, I'm happy to go the PyPI route. That said, this is my first time using the Python C API. (My code in that branch is going to make that pretty obvious.) Could you recommend any existing packages that I might be able to use as a model? For OpenSSL, I'm very interested in the abstract but less familiar with their project and their schedules. Who might be a good person to get in touch with? > I assume there's a completely generic platform-agnostic C implementation, for build environments where the assembly won't work, yes? Yes, that's the vendored file blake3_portable.c. One TODO for my branch here is convincing the Python build system not to try to compile the x86-64-specific stuff on other platforms. The vendored file blake3_dispatch.c abstracts over all the different implementations and takes care of #ifdef'ing platform-specific function calls. (It also does runtime CPU feature detection on x86.) > written using the Rust implementation, which I understand is even more performant A few details here: The upstream Rust and C implementations have been matched in single threaded performance for a while now. They share the same assembly files, and the rest is a direct port. The big difference is that Rust also includes multithreading support, using the Rayon work-stealing runtime. The blake3-py module based on the Rust crate exposes this with a simple boolean flag, though we've been thinking about ways to give the caller more control over the number of threads used. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 21:01:59 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 20 Apr 2021 01:01:59 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1618880519.23.0.499595929894.issue42854@roundup.psfhosted.org> Ethan Furman added the comment: I'm getting this error: test test_ssl failed -- Traceback (most recent call last): File "/source/python/cpython/Lib/test/test_ssl.py", line 1061, in test_read_write_zero self.assertEqual(s.send(b""), 0) File "/source/python/cpython/Lib/ssl.py", line 1198, in send return self._sslobj.write(data) ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2484) Let me know if there's any other info I can provide (and how to get it). ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 21:05:06 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 20 Apr 2021 01:05:06 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1618880706.26.0.183650186886.issue38659@roundup.psfhosted.org> Ethan Furman added the comment: New changeset dbac8f40e81eb0a29dc833e6409a1abf47467da6 by Ethan Furman in branch 'master': bpo-38659: [Enum] add _simple_enum decorator (GH-25285) https://github.com/python/cpython/commit/dbac8f40e81eb0a29dc833e6409a1abf47467da6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 21:07:38 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 20 Apr 2021 01:07:38 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1618880858.42.0.627938401288.issue38659@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +24202 pull_request: https://github.com/python/cpython/pull/25476 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 19 22:12:33 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 20 Apr 2021 02:12:33 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1618884753.37.0.828461549208.issue38659@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 503cdc7c124cebbd777008bdf7bd9aa666b25f07 by Ethan Furman in branch 'master': Revert "bpo-38659: [Enum] add _simple_enum decorator (GH-25285)" (GH-25476) https://github.com/python/cpython/commit/503cdc7c124cebbd777008bdf7bd9aa666b25f07 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 00:31:39 2021 From: report at bugs.python.org (Josh Snyder) Date: Tue, 20 Apr 2021 04:31:39 +0000 Subject: [issue37355] SSLSocket.read does a GIL round-trip for every 16KB TLS record In-Reply-To: <1561056169.29.0.814417679233.issue37355@roundup.psfhosted.org> Message-ID: <1618893099.81.0.0546312021102.issue37355@roundup.psfhosted.org> Change by Josh Snyder : ---------- keywords: +patch pull_requests: +24203 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25478 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 00:45:23 2021 From: report at bugs.python.org (Larry Hastings) Date: Tue, 20 Apr 2021 04:45:23 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1618893923.48.0.283344495437.issue43817@roundup.psfhosted.org> Change by Larry Hastings : ---------- title: Add typing.get_annotations() -> Add inspect.get_annotations() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 02:30:22 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 20 Apr 2021 06:30:22 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1618900222.15.0.444063913332.issue42854@roundup.psfhosted.org> Christian Heimes added the comment: Ethan, what's your platform and OpenSSL version? ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 02:52:37 2021 From: report at bugs.python.org (=?utf-8?q?C=C3=A9dric_Krier?=) Date: Tue, 20 Apr 2021 06:52:37 +0000 Subject: [issue17659] no way to determine First weekday (based on locale) In-Reply-To: <1365410883.64.0.172005963141.issue17659@psf.upfronthosting.co.za> Message-ID: <1618901557.17.0.705305663429.issue17659@roundup.psfhosted.org> C?dric Krier added the comment: ping ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 02:58:11 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 20 Apr 2021 06:58:11 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1618901891.17.0.726901831897.issue43284@roundup.psfhosted.org> Shreyan Avigyan added the comment: I would like to help to write the fix for this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 04:52:00 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 20 Apr 2021 08:52:00 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1618908720.56.0.17710618776.issue43284@roundup.psfhosted.org> Shreyan Avigyan added the comment: For Windows 10.0.17134 (1803) or above why don't we use the format "maj.min.build.ubr" in platform._norm_version (the function that post-processes the version string and then returns the version string in the format "maj.min.build")? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 05:20:34 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Apr 2021 09:20:34 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1618910434.44.0.733587895137.issue43882@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: urllib.parse should sanitize urls containing ASCII newline and tabs. -> [security] urllib.parse should sanitize urls containing ASCII newline and tabs. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 05:20:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Apr 2021 09:20:43 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1618910443.53.0.0482644082278.issue43882@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 05:24:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Apr 2021 09:24:11 +0000 Subject: [issue39432] Distutils generates the wrong export symbol for unicode module names In-Reply-To: <1579787295.61.0.899007188072.issue39432@roundup.psfhosted.org> Message-ID: <1618910651.56.0.536867793497.issue39432@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 06:41:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Apr 2021 10:41:07 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1618915267.39.0.906675469443.issue43882@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-43883. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 06:41:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Apr 2021 10:41:16 +0000 Subject: [issue43883] Making urlparse WHATWG conformant In-Reply-To: <1618775017.08.0.625993552954.issue43883@roundup.psfhosted.org> Message-ID: <1618915276.53.0.279354903142.issue43883@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-43882. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 06:58:06 2021 From: report at bugs.python.org (ZhaoJie Hu) Date: Tue, 20 Apr 2021 10:58:06 +0000 Subject: [issue43318] pdb can't output the prompt message when successfully clear breakpoints by "filename:lineno" In-Reply-To: <1614240670.83.0.613464478845.issue43318@roundup.psfhosted.org> Message-ID: <1618916286.49.0.586498613331.issue43318@roundup.psfhosted.org> ZhaoJie Hu added the comment: I found a typo in the reproduce step. I'm going to fix it here. The unit test is updated in PR. Now it has some conflicts with the master branch, and I will resolve them soon. The steps to reproduce the bug: Assume the file to be debugged is foo.py(You can use any file you want). 1. start pdb: python -m pdb foo.py 2. set a breakpoint on any line of the file: (Pdb) b 2 Breakpoint 1 at foo.py:2 (Pdb) b Num Type Disp Enb Where 1 breakpoint keep yes at foo.py:2 3. when clear the breakpoint using breakpoint number, it will get a output("Deleted breakpoint 1 at ..."): (Pdb) cl 1 Deleted breakpoint 1 at foo.py:2 4. set another breakpoint: (Pdb) b 3 Breakpoint 2 at foo.py:3 5. if breakpoint is cleared using (filename:lineno), it gets nothing: (Pdb)cl foo.py:3 (Pdb) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 07:07:38 2021 From: report at bugs.python.org (Dustin Rodrigues) Date: Tue, 20 Apr 2021 11:07:38 +0000 Subject: [issue43878] ./configure fails on Apple Silicon with coreutils uname In-Reply-To: <1618636518.04.0.898249551468.issue43878@roundup.psfhosted.org> Message-ID: <1618916858.48.0.562863899402.issue43878@roundup.psfhosted.org> Dustin Rodrigues added the comment: In case it changes the calculus on how to proceed, HomeBrew does install coreutils with a "g" prefix -- a user needs to explicitly add the gnubin directory to their path in order for the unprefixed version to take precedence over the Apple-supplied one. https://github.com/Homebrew/homebrew-core/blob/4d04d78d5c27bde0da4e21b0669156b57c2d0839/Formula/coreutils.rb#L88-L91 https://github.com/Homebrew/homebrew-core/issues/71782 ---------- nosy: +dtrodrigues _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 07:28:04 2021 From: report at bugs.python.org (David Goncalves) Date: Tue, 20 Apr 2021 11:28:04 +0000 Subject: [issue33178] Add support for BigEndianUnion and LittleEndianUnion in ctypes In-Reply-To: <1522331303.68.0.467229070634.issue33178@psf.upfronthosting.co.za> Message-ID: <1618918084.11.0.945601120305.issue33178@roundup.psfhosted.org> Change by David Goncalves : ---------- keywords: +patch nosy: +dpg nosy_count: 6.0 -> 7.0 pull_requests: +24204 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25480 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 07:28:05 2021 From: report at bugs.python.org (David Goncalves) Date: Tue, 20 Apr 2021 11:28:05 +0000 Subject: [issue19023] ctypes docs: Unimplemented and undocumented features In-Reply-To: <1379246270.23.0.998338553474.issue19023@psf.upfronthosting.co.za> Message-ID: <1618918085.14.0.894079904459.issue19023@roundup.psfhosted.org> Change by David Goncalves : ---------- nosy: +dpg nosy_count: 11.0 -> 12.0 pull_requests: +24205 pull_request: https://github.com/python/cpython/pull/25480 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 07:59:54 2021 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 20 Apr 2021 11:59:54 +0000 Subject: [issue43892] Make match patterns explicit in the AST Message-ID: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> New submission from Nick Coghlan : In the SC submission ticket for PEP 642 (https://github.com/python/steering-council/issues/43 ), Guido indicated he was in favour of the more explicit pattern matching AST changes suggested in that PEP. This ticket covers adapting the pattern matching implementation to explicitly separate pattern nodes from expr nodes in the AST, so the code generator doesn't need to be context dependent. ---------- assignee: ncoghlan messages: 391430 nosy: brandtbucher, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Make match patterns explicit in the AST type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 08:03:20 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 20 Apr 2021 12:03:20 +0000 Subject: [issue30898] SSL cert failure running make test during Python 3.6 install In-Reply-To: <1499752922.62.0.288067889565.issue30898@psf.upfronthosting.co.za> Message-ID: <1618920200.66.0.387621905703.issue30898@roundup.psfhosted.org> Christian Heimes added the comment: I'm closing the ticket as out of date. Please feel free to reopen the ticket if you can reproduce the problem with a more recent version of Python. ---------- nosy: +christian.heimes stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 08:07:25 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 20 Apr 2021 12:07:25 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1618920445.76.0.670499587338.issue43795@roundup.psfhosted.org> Petr Viktorin added the comment: Thanks for linking to the issues/documentation! I see that Py_GetArgcArgv it was exported in python3.def (i.e. stable ABI) in bpo-40910, which got backported to 3.9. And the removal of PyThreadState_DeleteCurrent was reverted: bpo-38266 While we would like to deprecate/remove them in the future, they are now part of the stable ABI. They are now in internal headers, so I will exclude them from the limited API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 08:14:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 20 Apr 2021 12:14:20 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1618920860.29.0.145200114409.issue43892@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Given that the AST is a public interface, I would advise to implement this before beta freeze of 3.10 to avoid making this a breaking change in the future for linters and the like ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 08:32:56 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 20 Apr 2021 12:32:56 +0000 Subject: [issue43799] OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1 In-Reply-To: <1618047260.96.0.943530034595.issue43799@roundup.psfhosted.org> Message-ID: <1618921976.58.0.246890091615.issue43799@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24206 pull_request: https://github.com/python/cpython/pull/25481 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 09:03:19 2021 From: report at bugs.python.org (Jarry Shaw) Date: Tue, 20 Apr 2021 13:03:19 +0000 Subject: [issue43893] typing.get_type_hints does not accept type annotations with leading whitespaces Message-ID: <1618923799.18.0.0357006810909.issue43893@roundup.psfhosted.org> New submission from Jarry Shaw : `typing.get_type_hints` does not accept type annotations (in string capsulated form) with leading whitespaces. ``` >>> def foo(arg) -> ' str': ... >>> typing.get_type_hints(foo) Traceback (most recent call last): File "/usr/local/lib/python3.9/typing.py", line 519, in __init__ code = compile(arg, '', 'eval') File "", line 1 str IndentationError: unexpected indent During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.9/typing.py", line 1448, in get_type_hints value = ForwardRef(value) File "/usr/local/lib/python3.9/typing.py", line 521, in __init__ raise SyntaxError(f"Forward reference must be an expression -- got {arg!r}") SyntaxError: Forward reference must be an expression -- got ' str' ``` When elaborating on this issue, an inconsistency of hevaiour between ``eval`` function call and ``compile`` in ``'eval'`` mode was also noticed, where the former accepts leading whitespaces and the latter does not. However, as discussed in https://bugs.python.org/issue41887 , I would then propose manually ``lstrip`` whitespaces from the type annotations: ``` 519c519 < code = compile(arg.lstrip(' \t'), '', 'eval') --- > code = compile(arg, '', 'eval') ``` ---------- components: Library (Lib) messages: 391434 nosy: jarryshaw priority: normal severity: normal status: open title: typing.get_type_hints does not accept type annotations with leading whitespaces type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 09:21:39 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 20 Apr 2021 13:21:39 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1618924899.92.0.495496220483.issue43795@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +24207 pull_request: https://github.com/python/cpython/pull/25482 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 09:49:30 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 20 Apr 2021 13:49:30 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1618926570.21.0.981054616994.issue43795@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Should we mention PEP 652 in Include/README.rst, now that the PEP is accepted? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 09:52:18 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 20 Apr 2021 13:52:18 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1618926738.07.0.729496844392.issue43795@roundup.psfhosted.org> Petr Viktorin added the comment: > Should we mention PEP 652 in Include/README.rst, now that the PEP is accepted? No, we should link to the documentation (when it's written). The PEP is a design document; it'll become outdated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 09:53:34 2021 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 20 Apr 2021 13:53:34 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1618926814.9.0.0218055563267.issue43892@roundup.psfhosted.org> Nick Coghlan added the comment: Agreed. I had wanted the AST to be part of the PEPs specifically *because* it's a public API, but didn't check until today whether or not the original PEP 634 implementation had been merged as-is, or with a cleaned up AST definition. https://github.com/ncoghlan/cpython/pull/8/files is the initial implementation with the AST and Grammar file updated. I'll only create the CPython PR once the tests are passing, but I'll try to give Brandt at least a week to review it (I'll also ping him directly via email). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 10:01:31 2021 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 20 Apr 2021 14:01:31 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1618927291.7.0.364722303685.issue43892@roundup.psfhosted.org> Nick Coghlan added the comment: It's specifically the definition of "match_case" in the AST that is affected: match_case = (pattern pattern, expr? guard, stmt* body) pattern = MatchAlways | MatchValue(expr value) | MatchConstant(constant value) | MatchSequence(pattern* patterns) | MatchMapping(expr* keys, pattern* patterns) | MatchClass(expr cls, pattern* patterns, identifier* extra_attrs, pattern* extra_patterns) | MatchRestOfSequence(identifier? target) -- A NULL entry in the MatchMapping key list handles capturing extra mapping keys | MatchAs(pattern? pattern, identifier target) | MatchOr(pattern* patterns) attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset) Relative to the PEP 642 AST, the notion of a "matchop" is gone - MatchValue always compares by equality, and there's a MatchConstant node for the identity comparisons against None, True, and False. The grammar, code generator, AST validator, and unparser are then updated to produce or consume the new AST nodes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 10:16:27 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 20 Apr 2021 14:16:27 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1618928187.59.0.755349948271.issue43892@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 10:20:31 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 20 Apr 2021 14:20:31 +0000 Subject: [issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders In-Reply-To: <1520492267.34.0.467229070634.issue33025@psf.upfronthosting.co.za> Message-ID: <1618928431.86.0.784030478663.issue33025@roundup.psfhosted.org> Ethan Furman added the comment: IIUC, the issue is that urlencode( {'cert_reqs': ssl.CERT_NONE} ) no longer produces 'cert_reqs=0' ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 10:21:53 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 20 Apr 2021 14:21:53 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1618928513.09.0.752778201146.issue43892@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 10:23:41 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 20 Apr 2021 14:23:41 +0000 Subject: [issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders In-Reply-To: <1520492267.34.0.467229070634.issue33025@psf.upfronthosting.co.za> Message-ID: <1618928621.35.0.488246780391.issue33025@roundup.psfhosted.org> Christian Heimes added the comment: I guess so. We turned CERT_NONE into an IntFlag enum many years ago. urlencode() uses repr to convert integer enums. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 10:30:44 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 20 Apr 2021 14:30:44 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1618929044.62.0.143253777725.issue43795@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +24208 pull_request: https://github.com/python/cpython/pull/25483 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 10:44:22 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 20 Apr 2021 14:44:22 +0000 Subject: [issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders In-Reply-To: <1520492267.34.0.467229070634.issue33025@psf.upfronthosting.co.za> Message-ID: <1618929862.19.0.786262508403.issue33025@roundup.psfhosted.org> Ethan Furman added the comment: Actually, I think it uses str(). An easy fix would be to use format() for all non-bytes objects instead -- the question then becomes how many objects (besides Enums with mixed-in data types) have a different str() vs format() display? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 10:46:38 2021 From: report at bugs.python.org (Jarry Shaw) Date: Tue, 20 Apr 2021 14:46:38 +0000 Subject: [issue43893] typing.get_type_hints does not accept type annotations with leading whitespaces In-Reply-To: <1618923799.18.0.0357006810909.issue43893@roundup.psfhosted.org> Message-ID: <1618929998.48.0.669667681248.issue43893@roundup.psfhosted.org> Change by Jarry Shaw : ---------- keywords: +patch pull_requests: +24209 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25484 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 10:54:28 2021 From: report at bugs.python.org (Sofian Brabez) Date: Tue, 20 Apr 2021 14:54:28 +0000 Subject: [issue42422] types.CodeType() has no bytecode verifier In-Reply-To: <1605943207.33.0.904447657295.issue42422@roundup.psfhosted.org> Message-ID: <1618930468.05.0.77380973264.issue42422@roundup.psfhosted.org> Sofian Brabez added the comment: It's been a while and I still have no clear guidance from there of what developers want to do. Follow-up on this again to see if requires updates or just close it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 11:11:46 2021 From: report at bugs.python.org (Keith Smiley) Date: Tue, 20 Apr 2021 15:11:46 +0000 Subject: [issue43878] ./configure fails on Apple Silicon with coreutils uname In-Reply-To: <1618636518.04.0.898249551468.issue43878@roundup.psfhosted.org> Message-ID: <1618931506.85.0.198561463254.issue43878@roundup.psfhosted.org> Keith Smiley added the comment: I think given that this file seems to be updated occasionally anyways we should still land this. I agree with the sentiment that if this was a super specific fix just for this edge case maybe it wouldn't be worth it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 11:17:07 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 20 Apr 2021 15:17:07 +0000 Subject: [issue43893] typing.get_type_hints does not accept type annotations with leading whitespaces In-Reply-To: <1618923799.18.0.0357006810909.issue43893@roundup.psfhosted.org> Message-ID: <1618931827.08.0.406678884454.issue43893@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +gvanrossum, kj, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 11:23:59 2021 From: report at bugs.python.org (Jarry Shaw) Date: Tue, 20 Apr 2021 15:23:59 +0000 Subject: [issue43893] typing.get_type_hints does not accept type annotations with leading whitespaces In-Reply-To: <1618923799.18.0.0357006810909.issue43893@roundup.psfhosted.org> Message-ID: <1618932239.82.0.0202587381587.issue43893@roundup.psfhosted.org> Jarry Shaw added the comment: > as discussed in https://bugs.python.org/issue41887 After some additional thoughts, I am thinking that changing the behaviour of ``compile`` in ``'eval'`` mode directly might be a better idea, for consistency all over the builtin functions. Especially that it is a bit complex to decide if ``compile`` is called in ``'eval'`` mode all over the code base which may need to patch with ``lstrip`` sanitisation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 11:49:40 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 20 Apr 2021 15:49:40 +0000 Subject: [issue43893] typing.get_type_hints does not accept type annotations with leading whitespaces In-Reply-To: <1618923799.18.0.0357006810909.issue43893@roundup.psfhosted.org> Message-ID: <1618933780.29.0.0772212605951.issue43893@roundup.psfhosted.org> Guido van Rossum added the comment: So the question is, whether anyone actually writes `x: ' str'`. Does the fix satisfy a real need? If it does, why don't we change compile(x, ..., 'eval') as you suggested in your second comment? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 11:55:17 2021 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 20 Apr 2021 15:55:17 +0000 Subject: [issue22079] Ensure in PyType_Ready() that base class of static type is static In-Reply-To: <1406378199.04.0.952325428414.issue22079@psf.upfronthosting.co.za> Message-ID: <1618934117.77.0.594575779931.issue22079@roundup.psfhosted.org> Stefan Behnel added the comment: Coming back to this after a while. I would like to get rid of the work-around (read: huge hack) that we have in Cython for this check and thus would ask for the check to be removed in Py3.10. According to the discussion, no-one seemed to remember why it was added in the first place, just that "bad things happened", but not what or how. With the fix for issue 35810 in place since Py3.8, my guess is that the situation that this check is preventing has actually become safe now. Unless someone can motivate that the risks were other than a premature deallocation of the base type. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 12:10:25 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 20 Apr 2021 16:10:25 +0000 Subject: [issue43799] OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1 In-Reply-To: <1618047260.96.0.943530034595.issue43799@roundup.psfhosted.org> Message-ID: <1618935025.83.0.418941820159.issue43799@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 3309113d6131e4bbac570c4f54175ecca02d025a by Christian Heimes in branch 'master': bpo-43799: Also define SSLv3_method() (GH-25481) https://github.com/python/cpython/commit/3309113d6131e4bbac570c4f54175ecca02d025a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 12:12:23 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 20 Apr 2021 16:12:23 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1618935143.49.0.104669281974.issue43892@roundup.psfhosted.org> Brandt Bucher added the comment: Hm, for some reason I was thinking that this was safe to do after the feature freeze. Let's get to it then! Batuhan, perhaps we should change the linked issue for your AST validator PR to this one. That way we can close the old catch-all PEP 634 implementation issue and keep the discussion focused here. Nick, you might find the discussion on this mypy PR (https://github.com/python/mypy/pull/10191) helpful. In particular, Adrian raises some points about ways we could make type inference in the AST a bit neater. For example: not all patterns can be used for mapping keys. Perhaps there is a way to organize parts of the AST hierarchy that makes this a bit more concrete (though we should be careful to not limit reasonable syntax extensions in the future by doing so). A few notes, just from skimming the outline here: > MatchValue(expr value) MatchValue technically contains an expression node, although the actual expressions it can contain are quite limited (dotted names and negative/complex numbers, if I understand correctly). Can we gain anything by splitting this up into nodes for each of these (MatchValue(identifier* parts), etc...) instead? > MatchClass(expr cls, pattern* patterns, identifier* extra_attrs, pattern* extra_patterns) If I remember correctly (this part was implemented a while ago), collecting the different positional and keyword arguments in the parser is sort of simple since we can pass around sequences of keyword nodes easily. I *think* that the new proposed design would require hacks like creating dummy MatchClass nodes with *only* the keyword parts and later combining them with the positional arguments and a class name, since it keeps the keyword names separate from their arguments. Maybe some of the parser folks on this thread can chime in on that. Also, continuing the theme above, I think we can be more specific with "expr cls" here (maybe "identifier* cls"). > MatchRestOfSequence(identifier? target) In the interest of brevity, maybe "MatchStar" or something? > A NULL entry in the MatchMapping key list handles capturing extra mapping keys I think we could just give MatchMapping a "identifier? rest" member, right? That way it becomes a bit easier to use, and we don't need to worry if it's last or not. It also keeps us from having to handle empty entries in the keys. Oh, also, the ast unparser will need to be updated as well. ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 12:15:23 2021 From: report at bugs.python.org (E. Paine) Date: Tue, 20 Apr 2021 16:15:23 +0000 Subject: [issue43894] IDLE editor file minor refactoring Message-ID: <1618935323.45.0.384862638375.issue43894@roundup.psfhosted.org> New submission from E. Paine : Despite being large, the PR is mostly trivial changes (e.g. changing indentation). The main changes worth noting (and hence the reason for this issue) are: 1) the renaming of `ResetColorizer` to `reset_colors`, `ResetFont` to `reset_font`, `RemoveKeybindings` to `remove_keybindings` and `ApplyKeybindings` to `apply_keybindings`. 2) removal of some potentially unneeded imports 3) renaming of the `tokeneater` args to be lowercase I chose `reset_colors` (as proposed in PR-22682) rather than `reset_colorizer` because we are reconfiguring the Text, code context and line numbers, rather than only dealing with the colouriser. ---------- assignee: terry.reedy components: IDLE messages: 391449 nosy: epaine, terry.reedy priority: normal severity: normal status: open title: IDLE editor file minor refactoring versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 12:16:03 2021 From: report at bugs.python.org (E. Paine) Date: Tue, 20 Apr 2021 16:16:03 +0000 Subject: [issue43894] IDLE editor file minor refactoring In-Reply-To: <1618935323.45.0.384862638375.issue43894@roundup.psfhosted.org> Message-ID: <1618935363.01.0.913257510909.issue43894@roundup.psfhosted.org> Change by E. Paine : ---------- keywords: +patch pull_requests: +24211 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25485 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 12:20:57 2021 From: report at bugs.python.org (Jarry Shaw) Date: Tue, 20 Apr 2021 16:20:57 +0000 Subject: [issue43893] typing.get_type_hints does not accept type annotations with leading whitespaces In-Reply-To: <1618923799.18.0.0357006810909.issue43893@roundup.psfhosted.org> Message-ID: <1618935657.3.0.819917331081.issue43893@roundup.psfhosted.org> Jarry Shaw added the comment: To me, I discovered this issue because of a typo in my code. And apparently, I do not suggest people will write their type annotations with leading whitespaces purposely. Here?s another thing though: aligning the behaviour of the two builtin functions is good for us users, since logically, ``compile`` is just one *execution* step away from ``eval`` to my understanding. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 12:23:10 2021 From: report at bugs.python.org (Saiyang Gou) Date: Tue, 20 Apr 2021 16:23:10 +0000 Subject: [issue43893] typing.get_type_hints does not accept type annotations with leading whitespaces In-Reply-To: <1618923799.18.0.0357006810909.issue43893@roundup.psfhosted.org> Message-ID: <1618935790.97.0.184017704673.issue43893@roundup.psfhosted.org> Saiyang Gou added the comment: I think it might be a good idea to just strip leading spaces and tabs for `compile(x, ..., 'eval')` if we want consistent behavior. `compile` might be used in more locations in the whole Python source tree apart from `typing.get_type_hints`. Technically the only behavior difference between `eval(x)` and `compile(x, ..., 'eval')` (when `x` is a string) should be that the latter one does not execute the generated byte code. ---------- nosy: +gousaiyang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 12:48:08 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 20 Apr 2021 16:48:08 +0000 Subject: [issue30800] zlib.compressobj took too much memory on window In-Reply-To: <1498715799.11.0.0910878994528.issue30800@psf.upfronthosting.co.za> Message-ID: <1618937288.73.0.337758000961.issue30800@roundup.psfhosted.org> Irit Katriel added the comment: It looks like you're not using this API correctly, it doesn't make sense to create 10000 compressobj()s. You should create one and then call compress() on it as many times as you need. ---------- nosy: +iritkatriel resolution: -> not a bug status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 13:00:51 2021 From: report at bugs.python.org (Ian H) Date: Tue, 20 Apr 2021 17:00:51 +0000 Subject: [issue43895] Unnecessary Cache of Shared Object Handles Message-ID: <1618938051.55.0.304648722652.issue43895@roundup.psfhosted.org> New submission from Ian H : While working on another project I noticed that there's a cache of shared object handles kept inside _PyImport_FindSharedFuncptr. See https://github.com/python/cpython/blob/b2b6cd00c6329426fc3b34700f2e22155b44168c/Python/dynload_shlib.c#L51-L55. It appears to be an optimization to work around poor caching of shared object handles in old libc implementations. After some testing, I have been unable to find any meaningful performance difference from this cache, so I propose we remove it to save the space. My initial tests were on Linux (Ubuntu 18.04). I saw no discernible difference in the time for running the Python test suite with a single thread. Running the test suite using a single thread shows a lot of variance, but after running with and without the cache 40 times the mean times with/without the cache was nearly the same. Interpreter startup time also appears to be unaffected. This was all with a debug build, so I'm in the process of collecting data with a release build to see if that changes anything. ---------- messages: 391453 nosy: Ian.H priority: normal severity: normal status: open title: Unnecessary Cache of Shared Object Handles versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 13:03:22 2021 From: report at bugs.python.org (Ian H) Date: Tue, 20 Apr 2021 17:03:22 +0000 Subject: [issue43895] Unnecessary Cache of Shared Object Handles In-Reply-To: <1618938051.55.0.304648722652.issue43895@roundup.psfhosted.org> Message-ID: <1618938202.65.0.589118131615.issue43895@roundup.psfhosted.org> Ian H added the comment: Proposed patch is in https://github.com/python/cpython/pull/25487. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 13:22:30 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Apr 2021 17:22:30 +0000 Subject: [issue43888] GitHub Actions CI/CD `Coverage` job is broken on master In-Reply-To: <1618833046.45.0.972351861197.issue43888@roundup.psfhosted.org> Message-ID: <1618939350.04.0.606084643672.issue43888@roundup.psfhosted.org> miss-islington added the comment: New changeset 077a2e76649c2fc49ebb8982b6855bab09a85e8f by Sviatoslav Sydorenko in branch 'master': bpo-43888: Reduce coverage collection timeout to 1h40m in GHA (GH-25471) https://github.com/python/cpython/commit/077a2e76649c2fc49ebb8982b6855bab09a85e8f ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 13:23:40 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 20 Apr 2021 17:23:40 +0000 Subject: [issue7247] test_fcntl_64_bit from test_fcntl.py fails in Python 2.6.4 In-Reply-To: <1257103206.04.0.134413608226.issue7247@psf.upfronthosting.co.za> Message-ID: <1618939420.65.0.802659327514.issue7247@roundup.psfhosted.org> Irit Katriel added the comment: The test was disabled for ARM Linux here: https://github.com/python/cpython/commit/e5aefa452b2e3a5a834610cefa1656f36673f686 Does that resolve this issue? ---------- nosy: +gregory.p.smith, iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 13:45:52 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 20 Apr 2021 17:45:52 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1618940752.28.0.102296077505.issue43892@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Also, I would like some more extensive argument or why not having context dependent nodes justifies the extra maintainance cost (I'm not against that of course, and I am sympathetic, but I think this needs some more extensive coverage or why we are doing this). Notice that we already have context dependent nodes and attributes, as well as implicit meaning of some values like None. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 13:48:52 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Tue, 20 Apr 2021 17:48:52 +0000 Subject: [issue43896] Update the Sphinx directive for super from function to class Message-ID: <1618940932.03.0.571461842576.issue43896@roundup.psfhosted.org> New submission from G?ry : This PR updates the page [*Built-in Functions*](https://docs.python.org/3.9/library/functions.html#super) of the Python library documentation: `super` is not a `function` (`isinstance(super, type(lambda: None))` is `False`), it is a `type` (`isinstance(super, type)` is `True`), like `int`, `tuple`, `set`, etc. So it should get the same ?class? prefix, i.e. > **super**([*type*[, *object-or-type*]]) should become > *class* **super**([*type*[, *object-or-type*]]) ---------- assignee: docs at python components: Documentation messages: 391458 nosy: docs at python, maggyero priority: normal severity: normal status: open title: Update the Sphinx directive for super from function to class type: enhancement versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 13:49:16 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Tue, 20 Apr 2021 17:49:16 +0000 Subject: [issue43896] Update the Sphinx directive for super from function to class In-Reply-To: <1618940932.03.0.571461842576.issue43896@roundup.psfhosted.org> Message-ID: <1618940956.96.0.0794661685475.issue43896@roundup.psfhosted.org> Change by G?ry : ---------- keywords: +patch pull_requests: +24212 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25489 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 13:52:56 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 20 Apr 2021 17:52:56 +0000 Subject: [issue43896] Update the Sphinx directive for super from function to class In-Reply-To: <1618940932.03.0.571461842576.issue43896@roundup.psfhosted.org> Message-ID: <1618941176.2.0.0209505095372.issue43896@roundup.psfhosted.org> Raymond Hettinger added the comment: In general, we've decided not to do this. We use function mark-up in the section on builtin functions even though many of these are actually types. We use class markup in other sections because that markup is well suited to listing all the associated methods and attributes. ---------- nosy: +rhettinger resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 14:04:41 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 20 Apr 2021 18:04:41 +0000 Subject: [issue43804] Add more info about building C/C++ Extensions on Windows using MSVC In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1618941881.35.0.941788935852.issue43804@roundup.psfhosted.org> Shreyan Avigyan added the comment: Kindly have a review of my patch ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 14:08:44 2021 From: report at bugs.python.org (Adrian Freund) Date: Tue, 20 Apr 2021 18:08:44 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1618942124.27.0.477458500843.issue43892@roundup.psfhosted.org> Change by Adrian Freund : ---------- nosy: +freundTech _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 14:19:50 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 20 Apr 2021 18:19:50 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1618942790.42.0.687672822595.issue43284@roundup.psfhosted.org> Shreyan Avigyan added the comment: I have a patch for this issue. Should I attach it or should I directly open a PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 14:22:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Apr 2021 18:22:30 +0000 Subject: [issue42422] types.CodeType() has no bytecode verifier In-Reply-To: <1605943207.33.0.904447657295.issue42422@roundup.psfhosted.org> Message-ID: <1618942950.99.0.279976340711.issue42422@roundup.psfhosted.org> STINNER Victor added the comment: In terms of security model, usually, if an attacker can execute arbitrary Python code, the game is over. Executing bytecode is the same. Python doesn't provide any tooling to validate bytecode in its stdlib. https://python-security.readthedocs.io/security.html#python-security-model If you consider that it's an important use case, you can create a project on PyPI to validate bytecode. I don't think that it belongs to the stdlib. Python/ceval.c doesn't validate bytecode at runtime for performance reasons. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 14:31:36 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 20 Apr 2021 18:31:36 +0000 Subject: [issue43896] Update the Sphinx directive for super from function to class In-Reply-To: <1618940932.03.0.571461842576.issue43896@roundup.psfhosted.org> Message-ID: <1618943496.51.0.695724443963.issue43896@roundup.psfhosted.org> Raymond Hettinger added the comment: Looking again, it seems to someone has already started applying class markup despite previous decisions not to do so. ---------- resolution: rejected -> status: closed -> open versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 14:37:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Apr 2021 18:37:15 +0000 Subject: [issue22079] Ensure in PyType_Ready() that base class of static type is static In-Reply-To: <1406378199.04.0.952325428414.issue22079@psf.upfronthosting.co.za> Message-ID: <1618943835.98.0.953613853457.issue22079@roundup.psfhosted.org> STINNER Victor added the comment: I recently reworked type_new() and PyType_New() in bpo-43770. I wrote documentation for the type_ready_inherit_as_structs() helper function of PyType_Ready(): // For static types, inherit tp_as_xxx structures from the base class // if it's NULL. // // For heap types, tp_as_xxx structures are not NULL: they are set to the // PyHeapTypeObject.as_xxx fields by type_new_alloc(). static void type_ready_inherit_as_structs(PyTypeObject *type, PyTypeObject *base) I hesitated to add assertions to ensure that fields are set if the type is a heap type. One issue with static type is that it doesn't have the following fields of PyHeapTypeObject: PyAsyncMethods as_async; PyNumberMethods as_number; PyMappingMethods as_mapping; PySequenceMethods as_sequence; /* as_sequence comes after as_mapping, so that the mapping wins when both the mapping and the sequence define a given operator (e.g. __getitem__). see add_operators() in typeobject.c . */ PyBufferProcs as_buffer; Is there a reason to not add these fields to PyTypeObject? PyTypeObject is not part of the stable ABI. Type inheritance without these fields make PyType_Ready() weird and more complex. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 14:39:23 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 20 Apr 2021 18:39:23 +0000 Subject: [issue43896] Update the Sphinx directive for super from function to class In-Reply-To: <1618940932.03.0.571461842576.issue43896@roundup.psfhosted.org> Message-ID: <1618943963.77.0.431217568012.issue43896@roundup.psfhosted.org> Raymond Hettinger added the comment: -0 on doing this. While class markup has crept into the Built-in Functions section, super() isn't really used this way (people don't subclass it or run isinstance on it). Elsewhere in the docs, all the links to this entry use the markup, :func:`super` which looks nicer in the docs than the class reference. In terms of markup, "function" is a role rather than an actual type, it is used for most callables whether or not ``isinstance(obj, type(lambda: None))`` returns true. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 14:39:49 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Tue, 20 Apr 2021 18:39:49 +0000 Subject: [issue43896] Update the Sphinx directive for super from function to class In-Reply-To: <1618940932.03.0.571461842576.issue43896@roundup.psfhosted.org> Message-ID: <1618943989.74.0.977575654412.issue43896@roundup.psfhosted.org> G?ry added the comment: > Looking again, it seems to someone has already started applying class markup despite previous decisions not to do so. Yes, and he forgot super: class bool([x]) class bytearray([source[, encoding[, errors]]]) class bytes([source[, encoding[, errors]]]) class complex([real[, imag]]) class dict(**kwarg) class dict(mapping, **kwarg) class dict(iterable, **kwarg) class float([x]) class frozenset([iterable]) class int([x]) class int(x, base=10) class list([iterable]) class memoryview(obj) class object class property(fget=None, fset=None, fdel=None, doc=None) class range(stop) class range(start, stop[, step]) class set([iterable]) class slice(stop) class slice(start, stop[, step]) class str(object='') class str(object=b'', encoding='utf-8', errors='strict?) class tuple([iterable]) class type(object) class type(name, bases, dict, **kwds) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 14:41:38 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 20 Apr 2021 18:41:38 +0000 Subject: [issue43896] Update the Sphinx directive for super from function to class In-Reply-To: <1618940932.03.0.571461842576.issue43896@roundup.psfhosted.org> Message-ID: <1618944098.02.0.257977232535.issue43896@roundup.psfhosted.org> Raymond Hettinger added the comment: Also, the related text uses callable terminology, "it returns object that ...". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 14:51:17 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Tue, 20 Apr 2021 18:51:17 +0000 Subject: [issue43896] Update the Sphinx directive for super from function to class In-Reply-To: <1618940932.03.0.571461842576.issue43896@roundup.psfhosted.org> Message-ID: <1618944677.57.0.608714708234.issue43896@roundup.psfhosted.org> G?ry added the comment: > Elsewhere in the docs, all the links to this entry use the markup, :func:`super` which looks nicer in the docs than the class reference. I was suggesting only to update the block Sphinx directive ?.. function::? to ?.. class::? for defining the signature (so that the ?class? prefix appears before the signature, like for the other built-in types), not the inline Sphinx roles ?:func:? to ?:class:? (since for instance `int` use both in the page: :class:`int` and :func:`int`). Also the ?class? prefix already appears in the interactive help when typing `help(super)`: Help on class super in module builtins: class super(object) | super() -> same as super(__class__, ) | super(type) -> unbound super object | super(type, obj) -> bound super object; requires isinstance(obj, type) | super(type, type2) -> bound super object; requires issubclass(type2, type) | Typical use to call a cooperative superclass method: | class C(B): | def meth(self, arg): | super().meth(arg) | This works for class methods too: | class C(B): | @classmethod | def cmeth(cls, arg): | super().cmeth(arg) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 15:35:34 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 20 Apr 2021 19:35:34 +0000 Subject: [issue7247] test_fcntl_64_bit from test_fcntl.py fails in Python 2.6.4 In-Reply-To: <1257103206.04.0.134413608226.issue7247@psf.upfronthosting.co.za> Message-ID: <1618947334.04.0.522094155607.issue7247@roundup.psfhosted.org> Gregory P. Smith added the comment: given how old this is and how i added that test skip presumably when i setup my first arm buildbot... closing. ---------- assignee: -> gregory.p.smith resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 15:35:33 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 20 Apr 2021 19:35:33 +0000 Subject: [issue43897] Implement support for validation of pattern matching ASTs Message-ID: <1618947333.54.0.307745509696.issue43897@roundup.psfhosted.org> New submission from Batuhan Taskaya : ASTs of case clauses for PEP 636 are not validated through PyAST_Validate right now, which might crash the Python interpreter when compiling some trees that doesn't hold the assumptions of the compiler. ---------- assignee: BTaskaya messages: 391469 nosy: BTaskaya priority: normal severity: normal status: open title: Implement support for validation of pattern matching ASTs versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 15:35:46 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 20 Apr 2021 19:35:46 +0000 Subject: [issue43897] Implement support for validation of pattern matching ASTs In-Reply-To: <1618947333.54.0.307745509696.issue43897@roundup.psfhosted.org> Message-ID: <1618947346.29.0.282295600376.issue43897@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- dependencies: +Make match patterns explicit in the AST _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 15:36:10 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 20 Apr 2021 19:36:10 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1618947370.98.0.151306969889.issue43892@roundup.psfhosted.org> Batuhan Taskaya added the comment: > Batuhan, perhaps we should change the linked issue for your AST validator PR to this one. That way we can close the old catch-all PEP 634 implementation issue and keep the discussion focused here. I think it might be better as a separate issue that has a dependency on this one. I've created issue 43897 for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 15:36:23 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 20 Apr 2021 19:36:23 +0000 Subject: [issue43897] Implement support for validation of pattern matching ASTs In-Reply-To: <1618947333.54.0.307745509696.issue43897@roundup.psfhosted.org> Message-ID: <1618947383.77.0.866417104549.issue43897@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +24213 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24771 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 15:36:49 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 20 Apr 2021 19:36:49 +0000 Subject: [issue42128] Structural Pattern Matching (PEP 634) In-Reply-To: <1603466540.96.0.7677855399.issue42128@roundup.psfhosted.org> Message-ID: <1618947409.88.0.659754083782.issue42128@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: -23539 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 15:37:17 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 20 Apr 2021 19:37:17 +0000 Subject: [issue42128] Structural Pattern Matching (PEP 634) In-Reply-To: <1603466540.96.0.7677855399.issue42128@roundup.psfhosted.org> Message-ID: <1618947437.04.0.0283289119052.issue42128@roundup.psfhosted.org> Batuhan Taskaya added the comment: > Actually, I didn't see that there are still 2 open linked PRs. I'll wait until those are merged. I've moved the AST validator to its own separate issue so feel free to close this Brandt! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 15:37:28 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 20 Apr 2021 19:37:28 +0000 Subject: [issue43897] Implement support for validation of pattern matching ASTs In-Reply-To: <1618947333.54.0.307745509696.issue43897@roundup.psfhosted.org> Message-ID: <1618947448.55.0.0628787697018.issue43897@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 15:59:28 2021 From: report at bugs.python.org (Ellis trisk-grove) Date: Tue, 20 Apr 2021 19:59:28 +0000 Subject: [issue43898] Python fails to import .dylib but works when extension is changed to .so Message-ID: <1618948768.32.0.880323883479.issue43898@roundup.psfhosted.org> New submission from Ellis trisk-grove : This issue is pretty much summed up by the title. Python does manage to import the library and use it however only when the extension is .so otherwise python cannot find it and fails to import. ---------- components: macOS messages: 391473 nosy: etriskgrove, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Python fails to import .dylib but works when extension is changed to .so versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 16:20:30 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 20 Apr 2021 20:20:30 +0000 Subject: [issue40306] Enhancement request for SSLContext - flag to handle trailing dot in hostname In-Reply-To: <1587061615.86.0.473018087621.issue40306@roundup.psfhosted.org> Message-ID: <1618950030.74.0.260859480742.issue40306@roundup.psfhosted.org> Christian Heimes added the comment: OpenSSL feature request: https://github.com/openssl/openssl/issues/11560 ---------- versions: +Python 3.10 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 16:29:16 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 20 Apr 2021 20:29:16 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1618942790.42.0.687672822595.issue43284@roundup.psfhosted.org> Message-ID: Steve Dower added the comment: Opening a PR against the master branch would be ideal. (Make sure you forked from that branch too, or you may see lots of irrelevant changes, which will make it impossible to review.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 16:29:13 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 20 Apr 2021 20:29:13 +0000 Subject: [issue31727] FTP_TLS errors when use certain subcommands In-Reply-To: <1507482521.5.0.213398074469.issue31727@psf.upfronthosting.co.za> Message-ID: <1618950553.18.0.108556633092.issue31727@roundup.psfhosted.org> Christian Heimes added the comment: I'm removing the SSL component. The issue here seems to be caused by the way how ftplib use the ssl module, not by a problem in the ssl module itself. ---------- components: +Library (Lib) -SSL, Windows versions: +Python 3.10, Python 3.9 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 17:05:23 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 20 Apr 2021 21:05:23 +0000 Subject: [issue43896] Update the Sphinx directive for super from function to class In-Reply-To: <1618940932.03.0.571461842576.issue43896@roundup.psfhosted.org> Message-ID: <1618952723.62.0.511296501444.issue43896@roundup.psfhosted.org> Raymond Hettinger added the comment: I've applied this PR but still am not sure that it makes readers better-off. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 17:08:09 2021 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Tue, 20 Apr 2021 21:08:09 +0000 Subject: [issue7247] test_fcntl_64_bit from test_fcntl.py fails in Python 2.6.4 In-Reply-To: <1257103206.04.0.134413608226.issue7247@psf.upfronthosting.co.za> Message-ID: <1618952889.89.0.521707296981.issue7247@roundup.psfhosted.org> Arfrever Frehtes Taifersar Arahesis added the comment: ARM != AMD64 (alternative name of x86_64) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 17:18:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 20 Apr 2021 21:18:26 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1618953506.94.0.354522251889.issue38605@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 13.0 -> 14.0 pull_requests: +24214 pull_request: https://github.com/python/cpython/pull/25490 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 17:22:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 20 Apr 2021 21:22:15 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1618953735.11.0.846899903169.issue38605@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: fixed -> postponed status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 17:47:05 2021 From: report at bugs.python.org (David Alvarez Lombardi) Date: Tue, 20 Apr 2021 21:47:05 +0000 Subject: [issue43899] separate builtin function Message-ID: <1618955225.8.0.321357369426.issue43899@roundup.psfhosted.org> New submission from David Alvarez Lombardi : I frequently find myself doing the following for lists, sets, and dicts. ```` passes = [x for x in seq if cond(x)] fails = [x for x in seq if not cond(x)] ```` The proposed function would behave similarly to `filter`, but it would return a tuple of the passes iterable and fails iterable rather than just the passes. ```` my_list = [-3, -2, -1, 0, 1, 2, 3] def is_positive(n): return n > 0 positives, negatives = separate(function=is_positive, iterable=my_list) ```` ---------- messages: 391479 nosy: alvarezdqal priority: normal severity: normal status: open title: separate builtin function type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 17:55:08 2021 From: report at bugs.python.org (David Alvarez Lombardi) Date: Tue, 20 Apr 2021 21:55:08 +0000 Subject: [issue43900] string comprehension Message-ID: <1618955708.38.0.581362261608.issue43900@roundup.psfhosted.org> New submission from David Alvarez Lombardi : As of now the best way to filter a str is to convert to list, filter, then join back to a str. I think a a string comprehension would be very useful for this. So to get only ascii_lower case chars given this string, ```` s = "a1b2c3d4" ```` I could do this ```` filtered_s = c"ch for ch in s if ch in string.ascii_lowercase" ```` instead of this. ```` s_list = [] for i in range(len(s)): if s[i] in string.ascii_lowercase: s_list.append(s[i]) filtered_s = "".join(s_list) ```` ---------- messages: 391480 nosy: alvarezdqal priority: normal severity: normal status: open title: string comprehension type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 18:07:52 2021 From: report at bugs.python.org (Zachary Ware) Date: Tue, 20 Apr 2021 22:07:52 +0000 Subject: [issue43900] string comprehension In-Reply-To: <1618955708.38.0.581362261608.issue43900@roundup.psfhosted.org> Message-ID: <1618956472.92.0.242456534979.issue43900@roundup.psfhosted.org> Zachary Ware added the comment: filtered_s = ''.join(c for c in s if c in string.ascii_lowercase) ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 18:34:59 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 20 Apr 2021 22:34:59 +0000 Subject: [issue43900] string comprehension In-Reply-To: <1618955708.38.0.581362261608.issue43900@roundup.psfhosted.org> Message-ID: <1618958099.18.0.275574935748.issue43900@roundup.psfhosted.org> Raymond Hettinger added the comment: Please take this to the python-ideas mailing list: https://mail.python.org/mailman3/lists/python-ideas.python.org/ If the idea gains traction, it would likely require a PEP and then this issue can be reopened. ---------- nosy: +rhettinger resolution: -> later stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 18:49:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 20 Apr 2021 22:49:49 +0000 Subject: [issue41701] Buildbot web page: connection lost after 1 minute, then display "Connection restored" popup In-Reply-To: <1599128479.83.0.639934661132.issue41701@roundup.psfhosted.org> Message-ID: <1618958989.67.0.177443144946.issue41701@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ee, apparently this issue in the buildbot repo may be related: https://github.com/buildbot/buildbot/issues/4078 Could you investigate if we can use this on our PSF server? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 18:57:43 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 20 Apr 2021 22:57:43 +0000 Subject: [issue43899] separate builtin function In-Reply-To: <1618955225.8.0.321357369426.issue43899@roundup.psfhosted.org> Message-ID: <1618959463.73.0.107808336836.issue43899@roundup.psfhosted.org> Raymond Hettinger added the comment: FWIW, here's a recipe from the itertools docs: def partition(pred, iterable): "Use a predicate to partition entries into false entries and true entries" # partition(is_odd, range(10)) --> 0 2 4 6 8 and 1 3 5 7 9 t1, t2 = tee(iterable) return filterfalse(pred, t1), filter(pred, t2) Also, here's a more general solution that can handle multiple categories: >>> from collections import defaultdict >>> def categorize(func, iterable): d = defaultdict(list) for x in iterable: d[func(x)].append(x) return dict(d) >>> categorize(is_positive, [-3, -2, -1, 0, 1, 2, 3]) {False: [-3, -2, -1, 0], True: [1, 2, 3]} >>> categorize(lambda x: x%3, [-3, -2, -1, 0, 1, 2, 3]) {0: [-3, 0, 3], 1: [-2, 1], 2: [-1, 2]} At one point, Peter Norvig suggested adding a groupby classmethod to dictionaries. I would support that idea. Something like: dict.groupby(attrgetter('country'), conferences) ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 19:48:56 2021 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 20 Apr 2021 23:48:56 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1618962536.54.0.193979873088.issue43892@roundup.psfhosted.org> Nick Coghlan added the comment: https://www.python.org/dev/peps/pep-0642/#representing-patterns-explicitly-in-the-abstract-syntax-tree covers the rationale for why it is potentially problematic to reuse expression nodes for match patterns: it doesn't semantically align with the fact that patterns are *not* expressions, so the AST ends up being closer to a concrete syntax tree than we would like. For the specifics of the AST nodes: * restricting sub expressions directly in the AST itself is tricky without side effects on the AST for non-pattern-matching code, so I'm intending to add any such restrictions that we want to enforce to the validator (other statements and expressions like yield, await, return, break, and continue already have separately enforced restrictions like that) * cls needs to be an expression node to allow for attribute lookups * the linked draft PR already updates the grammar to emit the new AST. MatchClass is able to collect the keyword args and their corresponding patterns in roughly the same way that MatchMapping collects its key:pattern pairs ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 20:33:25 2021 From: report at bugs.python.org (Gene Ratzlaff) Date: Wed, 21 Apr 2021 00:33:25 +0000 Subject: [issue43877] Logging Cookbook ambiguity In-Reply-To: <1618622288.58.0.221543721652.issue43877@roundup.psfhosted.org> Message-ID: <1618965205.24.0.895378528925.issue43877@roundup.psfhosted.org> Gene Ratzlaff added the comment: Agreed, but only to the limits of the buffer - that's what I was getting at when I suggested that limitations should be explained. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 20:44:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 21 Apr 2021 00:44:38 +0000 Subject: [issue41701] Buildbot web page: connection lost after 1 minute, then display "Connection restored" popup In-Reply-To: <1599128479.83.0.639934661132.issue41701@roundup.psfhosted.org> Message-ID: <1618965878.01.0.634918783298.issue41701@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I'm going to try it our on the server but apparently there are some problems: https://github.com/buildbot/buildbot/issues/5991 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 21:44:12 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Apr 2021 01:44:12 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1618969452.75.0.923692881232.issue40137@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +24215 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/25492 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 23:09:07 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 21 Apr 2021 03:09:07 +0000 Subject: [issue43898] Python fails to import .dylib but works when extension is changed to .so In-Reply-To: <1618948768.32.0.880323883479.issue43898@roundup.psfhosted.org> Message-ID: <1618974547.27.0.871164687992.issue43898@roundup.psfhosted.org> Ned Deily added the comment: Can you please give a code snippet of the behavior you believe is incorrect? It is not clear to me what you mean by importing a library. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 23:13:43 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Apr 2021 03:13:43 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1618974823.16.0.033125912389.issue43475@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +24216 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25493 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 20 23:24:32 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 21 Apr 2021 03:24:32 +0000 Subject: [issue42128] Structural Pattern Matching (PEP 634) In-Reply-To: <1603466540.96.0.7677855399.issue42128@roundup.psfhosted.org> Message-ID: <1618975472.25.0.450406194272.issue42128@roundup.psfhosted.org> Change by Brandt Bucher : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 00:02:50 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 21 Apr 2021 04:02:50 +0000 Subject: [issue43856] Docs for importlib.metadata should mention Python version In-Reply-To: <1618502050.6.0.847154133714.issue43856@roundup.psfhosted.org> Message-ID: <1618977770.82.0.229321231711.issue43856@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +24217 pull_request: https://github.com/python/cpython/pull/25494 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 00:04:00 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 21 Apr 2021 04:04:00 +0000 Subject: [issue43856] Docs for importlib.metadata should mention Python version In-Reply-To: <1618502050.6.0.847154133714.issue43856@roundup.psfhosted.org> Message-ID: <1618977840.62.0.719043628355.issue43856@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +24218 pull_request: https://github.com/python/cpython/pull/25495 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 02:36:33 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 21 Apr 2021 06:36:33 +0000 Subject: [issue39194] asyncio.open_connection returns a closed client when server fails to authenticate client certificate In-Reply-To: <1577977752.03.0.200427966409.issue39194@roundup.psfhosted.org> Message-ID: <1618986993.65.0.799386283403.issue39194@roundup.psfhosted.org> Christian Heimes added the comment: I'm unassigning myself. This seems to be an asyncio-specific behavior. ---------- assignee: christian.heimes -> components: -SSL versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 02:44:01 2021 From: report at bugs.python.org (Larry Hastings) Date: Wed, 21 Apr 2021 06:44:01 +0000 Subject: [issue43901] Add an empty annotations dict to all classes and modules Message-ID: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> New submission from Larry Hastings : The behavior of the __annotations__ member is wildly different between the three objects (function, class, module) that support it. Many of these differences are minor, but one in particular has been an awful wart for years: classes can inherit __annotations__ from their base classes. This is incontestably a misfire of the original design--it is never useful, it is only confusing, and libraries who examine annotations have had to work around it for years. I started a thread in January 2021 in which I brought up this and other inconsistencies with respect to __annotations_: https://mail.python.org/archives/list/python-dev at python.org/thread/AWKVI3NRCHKPIDPCJYGVLW4HBYTEOQYL/ The reaction was positive: yes, that's a genuine problem, and there's an easy, highly compatible fix that everybody liked: classes should always have an __annotations__ dict set. So that the behavior is consistent, modules should always have one set too. This won't be a large change. However, there are a lot of changes flying around with respect to __annotations__ right now. My plan is to get the work ready, then when the dust is mostly-settled I'll get it updated, reviewed, and merged. Definitely before Python 3.10b1. Long term, I'd like to get the other changes to annotations I proposed in that thread: * del o.__annotations__ always raises an exception. * o.__annotations__ is permitted to be None. * You can only set o.__annotations__ to either a dict or None. But it's probably best to not change everything all at once. ---------- components: Interpreter Core messages: 391490 nosy: larry priority: normal severity: normal stage: needs patch status: open title: Add an empty annotations dict to all classes and modules type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 02:45:21 2021 From: report at bugs.python.org (Larry Hastings) Date: Wed, 21 Apr 2021 06:45:21 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1618987521.86.0.235219834877.issue43901@roundup.psfhosted.org> Change by Larry Hastings : ---------- title: Add an empty annotations dict to all classes and modules -> Add an empty annotations dict to all unannotated classes and modules _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 02:53:37 2021 From: report at bugs.python.org (Larry Hastings) Date: Wed, 21 Apr 2021 06:53:37 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1618988017.88.0.120470341597.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: Huh. The sample code in my thread got goofed up somewhere along the way--maybe it's my fault, maybe it was done to me by some automated process. Anyway, the example demonstrating classes inheriting annotations was meant to be formatted like this: class A: ax:int=3 class B(A): pass print(getattr(B, '__annotations__', {})) Maybe some over-smart doodad decided that no paragraph would ever start with spaces, so they helpfully removed them? Hmm. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 03:00:23 2021 From: report at bugs.python.org (Suhail S.) Date: Wed, 21 Apr 2021 07:00:23 +0000 Subject: [issue43430] Exception raised when attempting to create Enum via functional API In-Reply-To: <1615165107.75.0.80264384575.issue43430@roundup.psfhosted.org> Message-ID: <1618988423.84.0.937619791566.issue43430@roundup.psfhosted.org> Suhail S. added the comment: In my usecase, I wanted to override the behaviour of __getitem__. I was able to accomplish this by subclassing EnumMeta. Having done so, I was able to work around this bug as follows. Instead of trying to access the functional API via Enum (using an enum as the type parameter) and failing, I was able to succeed by accessing the functional API via subclass of Enum. Something like: MyEnum2 = MyEnumBase1(...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 03:02:32 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Apr 2021 07:02:32 +0000 Subject: [issue43899] separate builtin function In-Reply-To: <1618955225.8.0.321357369426.issue43899@roundup.psfhosted.org> Message-ID: <1618988552.79.0.81373854185.issue43899@roundup.psfhosted.org> Serhiy Storchaka added the comment: The drawback of that recipe of partition() is that it calls predicate twice on every element. The following implementation calls it only once for every element: def partition(pred, iterable): t1, t2 = tee((bool(pred(x)), x) for x in iterable) return (x for p, x in t1 if not p), (x for p, x in t1 if p) but it may be less efficient for fast predicates. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 03:01:58 2021 From: report at bugs.python.org (Ellis trisk-grove) Date: Wed, 21 Apr 2021 07:01:58 +0000 Subject: [issue43898] Python fails to import .dylib but works when extension is changed to .so In-Reply-To: <1618948768.32.0.880323883479.issue43898@roundup.psfhosted.org> Message-ID: <1618988518.17.0.943974087861.issue43898@roundup.psfhosted.org> Ellis trisk-grove added the comment: This is with regards to an python extension written in zig (I believe the same behaviour would occur from C as I am just using Python.h). What happens is when I compile the library on my mac it generates myLibrary.dylib file, when testing with python the following occurs: >>> import myLibrary Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'myLibrary' However when changing the name of myLibrary.dylib to myLibrary.so python manages to import and use it as it should. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 03:26:22 2021 From: report at bugs.python.org (Larry Hastings) Date: Wed, 21 Apr 2021 07:26:22 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1618989982.95.0.469830207151.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: Preliminary patch is 17 lines. Ah well. I must be terrible at this! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 03:28:50 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 21 Apr 2021 07:28:50 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1618990130.39.0.703086839788.issue43901@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 03:49:14 2021 From: report at bugs.python.org (Larry Hastings) Date: Wed, 21 Apr 2021 07:49:14 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1618991354.15.0.640032557008.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: Just over twelve hours ago, the Python Steering Committee announced that stringized annotations would no longer be default behavior in Python 3.10. They will go back to being gated with "from __future__ import annotations". I think we still need this function, but naturally the implementation will now be a bit different. It's going to take time to change the default semantics of annotations back to the way they were in Python 3.9. In the meantime, I've coded up a first draft of inspect.get_annotations(), written assuming stringized annotations are optional. It's attached below. I'll also paste in the definition and the docstring into the text box here for your reading convenience. I assert that get_annotations() should definitely try to un-stringize stringized annotations by default. The default behavior of eval_str is sliightly magical, but I'm not sure I can do anything any smarter (apart from "resist the temptation to guess"). Unsophisticated users will want to see real values, and it may be important to give sophisticated users control over whether or not eval() is called. By the same token: if eval_str stays as part of the interface, I propose exposing it from the library functions that will call get_annotations(): * inspect.signature() * functools.singledispatch() That way, a project using stringized annotations due to gnarly circular imports/definitions problems could still use inspect.signature(), without having to worry about worrying about whether or not all the symbols were defined at runtime. I'll interpret a lack of feedback as a sort of mumbled encouraging consensus. ----- def get_annotations(obj, globals=None, locals=None, *, eval_str=ONLY_IF_ALL_STR): Compute the annotations dict for an object. obj may be a callable, class, or module. Passing in any other type of object raises TypeError. This function handles several details for you: * Values of type str may be un-stringized using eval(), depending on the value of eval_str. This is intended for use with stringized annotations (from __future__ import annotations). * If obj doesn't have an annotations dict, returns an empty dict. (Functions and methods always have an annotations dict; classes, modules, and other types of callables may not.) * Ignores inherited annotations on classes. If a class doesn't have its own annotations dict, returns an empty dict. * Always, always, always returns a dict. eval_str controls whether or not values of type str are replaced with the result of calling eval() on those values: * If eval_str is true, eval() is called on values of type str. * If eval_str is false, values of type str are unchanged. * If eval_str is the special value inspect.ONLY_IF_ALL_STR, which is the default, eval() is called on values of type str only if *every* value in the dict is of type str. This is a heuristic; the goal is to only eval() stringized annotations. (If, in a future version of Python, get_annotations() is able to determine authoritatively whether or not an annotations dict contains stringized annotations, inspect.ONLY_IF_ALL_STR will use that authoritative source instead of the heuristic.) globals and locals are passed in to eval(); see the documentation for eval() for more information. If globals is None, get_annotations() uses a context-specific default value, contingent on type(obj): * If obj is a module, globals defaults to obj.__dict__. * If obj is a class, globals defaults to sys.modules[obj.__module__].__dict__. * If obj is a callable, globals defaults to obj.__globals__, although if obj is a wrapped function (using functools.update_wrapper()) it is first unwrapped. ---------- Added file: https://bugs.python.org/file49968/get_annotations.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 03:52:47 2021 From: report at bugs.python.org (Larry Hastings) Date: Wed, 21 Apr 2021 07:52:47 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1618991567.14.0.619473904002.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: Hmm. If o.__annotations__ is None, should this function set the empty dict on the object? That seems slightly too opinionated to me. On the other hand, the user would probably expect that they could change the dict they got back. (If Python shipped with a builtin "frozen dict", I suppose I could safely return one of those.) Note that the danger of this happening should drop to about zero, assuming I push through my other small patch: https://bugs.python.org/issue43901 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 03:59:53 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 21 Apr 2021 07:59:53 +0000 Subject: [issue43902] ssl module: add getter for SSL_CTX* and SSL* Message-ID: <1618991993.39.0.313806581209.issue43902@roundup.psfhosted.org> New submission from Christian Heimes : Python's ssl module exposes a limited and opinionated set of knobs to tune OpenSSL's behavior. Each new setter, getter, or function must be carefully design, tested, and documented. For each feature OpenSSL's C API must be converted into a Pythonic, self-explanatory interface. I would like to give experts and power users an interface to set advanced options. libffi-based solutions like ctypes and cffi are obvious choices. For libffi to work, users need to be able to get the address of ssl.SSLContext()'s SSL_CTX pointer and the SSL* pointer of the internal _SSLSocket object. While it's possible to use pointer arithmetic with id(ctx) + offset, I would like to add a more convenient way. Pointer arithmetic with ctypes is non-trivial. Users would have to rely on internal, private layout of PySSLContext and PySSLSocket struct. I'm considering two new methods ctx._ssl_ctx_addr and ssl._ssl_addr (names are tentative). >>> import ssl, ctypes >>> ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) >>> libssl = ctypes.CDLL("libssl.so.1.1") # ssl._ssl.__file__ works, too >>> libssl.SSL_CTX_set_ciphersuites(ctx._ssl_ctx_addr(), b"TLS_CHACHA20_POLY1305_SHA256") 1 Steve, Nathaniel, how do you like the idea in general? Do you have better ideas for function names? ---------- assignee: christian.heimes components: SSL messages: 391498 nosy: christian.heimes, njs, steve.dower priority: normal severity: normal stage: patch review status: open title: ssl module: add getter for SSL_CTX* and SSL* type: enhancement versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 04:15:02 2021 From: report at bugs.python.org (Olli) Date: Wed, 21 Apr 2021 08:15:02 +0000 Subject: [issue43903] round() produces incorrect results with certain values Message-ID: <1618992902.95.0.267811041395.issue43903@roundup.psfhosted.org> New submission from Olli : When rounding numbers with round(), middle values at with even base number are rounded in wrong direction. Python 3.9.1 (default, Feb 3 2021, 07:38:02) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports) macOS 11.2.3 (20D91), Darwin 20.3.0 to reproduce (wrong results marked with "*"): floats: >>> for i in range(0, 10): ... i /= 2 ... print(i, '->', round(i)) ... 0.0 -> 0 0.5 -> 0 * 1.0 -> 1 1.5 -> 2 2.0 -> 2 2.5 -> 2 * 3.0 -> 3 3.5 -> 4 4.0 -> 4 4.5 -> 4 * and for ints: >>> for i in range(50, 1000, 50): ... print(i, '->', round(int(i), -2)) ... 50 -> 0 * 100 -> 100 150 -> 200 200 -> 200 250 -> 200 * 300 -> 300 350 -> 400 400 -> 400 450 -> 400 * 500 -> 500 550 -> 600 600 -> 600 650 -> 600 * 700 -> 700 750 -> 800 800 -> 800 850 -> 800 * 900 -> 900 950 -> 1000 ---------- components: Library (Lib) messages: 391499 nosy: MrBlueSkies priority: normal severity: normal status: open title: round() produces incorrect results with certain values type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 04:19:40 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Apr 2021 08:19:40 +0000 Subject: [issue43903] round() produces incorrect results with certain values In-Reply-To: <1618992902.95.0.267811041395.issue43903@roundup.psfhosted.org> Message-ID: <1618993180.12.0.40983059031.issue43903@roundup.psfhosted.org> Serhiy Storchaka added the comment: It all works as documented. https://docs.python.org/3/library/functions.html#round ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 04:54:18 2021 From: report at bugs.python.org (berkbayr) Date: Wed, 21 Apr 2021 08:54:18 +0000 Subject: [issue43904] Documentation for argparse, missed opportunity Message-ID: <1618995258.21.0.414286523788.issue43904@roundup.psfhosted.org> New submission from berkbayr : In the API reference page for argparse, the following example is used for formatter_class: ... formatter_class=argparse.RawDescriptionHelpFormatter, ... description=textwrap.dedent('''\ ... Please do not mess up this text! ... -------------------------------- ... I have indented it ... exactly the way ... I want it ... ''')) I propose the example would be vastly improved by the following change: ... Please do not mess up this text! ... -------------------------------- ... I have indented it ... exactly the way ... I intended ... ''')) ---------- assignee: docs at python components: Documentation messages: 391501 nosy: berkbayraktar, docs at python priority: normal severity: normal status: open title: Documentation for argparse, missed opportunity type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 05:02:16 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 21 Apr 2021 09:02:16 +0000 Subject: [issue43904] Documentation for argparse, missed opportunity In-Reply-To: <1618995258.21.0.414286523788.issue43904@roundup.psfhosted.org> Message-ID: <1618995736.65.0.72729259448.issue43904@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +paul.j3, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 05:23:59 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 21 Apr 2021 09:23:59 +0000 Subject: [issue43846] Control stack usage in large expressions In-Reply-To: <1618402171.48.0.736532073467.issue43846@roundup.psfhosted.org> Message-ID: <1618997039.17.0.309718155141.issue43846@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 05:23:47 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 21 Apr 2021 09:23:47 +0000 Subject: [issue43846] Control stack usage in large expressions In-Reply-To: <1618402171.48.0.736532073467.issue43846@roundup.psfhosted.org> Message-ID: <1618997027.06.0.861509568034.issue43846@roundup.psfhosted.org> Mark Shannon added the comment: I've not measured performance, as the sort of large literals it would impact are very rare, and the sort of calls it would change are almost non-existent. I'd be surprised if any performance difference could be reliably detected with our current performance tools. This change is an enabler of future optimizations, such as using a contiguous data stack. The impact of those optimizations will swamp any impact of this change, and should be easily measurable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 05:27:10 2021 From: report at bugs.python.org (Olli) Date: Wed, 21 Apr 2021 09:27:10 +0000 Subject: [issue43903] round() produces incorrect results with certain values In-Reply-To: <1618992902.95.0.267811041395.issue43903@roundup.psfhosted.org> Message-ID: <1618997230.08.0.570880293858.issue43903@roundup.psfhosted.org> Olli added the comment: Just because incorrect results are documented, that doesn't mean the current implementation could not be improved. More over, Python 2.7.16 on the same machine produces expected results: Python 2.7.16 (default, Dec 21 2020, 23:00:36) [GCC Apple LLVM 12.0.0 (clang-1200.0.30.4) [+internal-os, ptrauth-isa=sign+stri on darwin >>> for i in range(0, 10): ... i = float(i) / 2 ... print i, '->', round(i) ... 0.0 -> 0.0 0.5 -> 1.0 1.0 -> 1.0 1.5 -> 2.0 2.0 -> 2.0 2.5 -> 3.0 3.0 -> 3.0 3.5 -> 4.0 4.0 -> 4.0 4.5 -> 5.0 While exactly same code on Python 3.9.1 on same platform: Python 3.9.1 (default, Feb 3 2021, 07:38:02) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin >>> for i in range(0, 10): ... i = float(i) / 2 ... print(i, '->', round(i)) ... 0.0 -> 0 0.5 -> 0 1.0 -> 1 1.5 -> 2 2.0 -> 2 2.5 -> 2 3.0 -> 3 3.5 -> 4 4.0 -> 4 4.5 -> 4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 05:29:10 2021 From: report at bugs.python.org (sruester) Date: Wed, 21 Apr 2021 09:29:10 +0000 Subject: [issue32882] SSLContext.set_ecdh_curve() not accepting x25519 In-Reply-To: <1519120194.11.0.467229070634.issue32882@psf.upfronthosting.co.za> Message-ID: <1618997350.68.0.776701385048.issue32882@roundup.psfhosted.org> sruester added the comment: PEP 543 was withdrawn in the meantime. Any suggestion how to proceed with this? ---------- versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 05:34:11 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Apr 2021 09:34:11 +0000 Subject: [issue43903] round() produces incorrect results with certain values In-Reply-To: <1618992902.95.0.267811041395.issue43903@roundup.psfhosted.org> Message-ID: <1618997651.77.0.432371745124.issue43903@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is correct because it works as documented. Please read the documentation carefully. It was intentional change in Python 3. See https://docs.python.org/3/whatsnew/3.0.html#builtins. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 05:46:02 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 21 Apr 2021 09:46:02 +0000 Subject: [issue43903] round() produces incorrect results with certain values In-Reply-To: <1618992902.95.0.267811041395.issue43903@roundup.psfhosted.org> Message-ID: <1618998362.44.0.176815786405.issue43903@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 06:00:42 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 21 Apr 2021 10:00:42 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1618999242.23.0.6193239316.issue43817@roundup.psfhosted.org> Eric V. Smith added the comment: > If o.__annotations__ is None, should this function set the empty dict on the object? That seems slightly too opinionated to me. On the other hand, the user would probably expect that they could change the dict they got back. Are you saying the user would expect to be able to change __annotations__ my modifying the dict they get back? Is it ever the case that the user can modify __annotations__ through the dict that's returned? That is: does __annotations__ itself ever get returned? I think you'd either want __annotations__ returned all the time, or never returned. Otherwise some cases could modify __annotations__, and some couldn't. If __annotations__ is never returned, then I wouldn't set __annotations__ in this case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 06:16:32 2021 From: report at bugs.python.org (Larry Hastings) Date: Wed, 21 Apr 2021 10:16:32 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619000192.25.0.0777869040269.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: > Are you saying the user would expect to be able to change __annotations__ my modifying the dict they get back? As the docs are currently written, it's ambiguous. > Is it ever the case that the user can modify __annotations__ through the dict that's returned? That is: does __annotations__ itself ever get returned? Yes. I could enumerate the cases in which that is true but I don't think it would shed light. Suffice to say, as currently written, get_annotations() currently returns the original dict unmodified when it can, and returns a freshly-created dict when it can't. > I think you'd either want __annotations__ returned all the time, or never returned. Otherwise some cases could modify __annotations__, and some couldn't. I think you're right! And since there are definitely circumstances in which it can't return __annotations__ directly, that indicates that it should never return __annotations__ directly. Good call! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 06:20:32 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 21 Apr 2021 10:20:32 +0000 Subject: [issue43903] round() produces incorrect results with certain values In-Reply-To: <1618992902.95.0.267811041395.issue43903@roundup.psfhosted.org> Message-ID: <1619000432.27.0.171185866661.issue43903@roundup.psfhosted.org> Eric V. Smith added the comment: I agree this is working as designed and documented, so I'm closing this. Olli: You might want to read https://en.wikipedia.org/wiki/Rounding#Round_half_to_even ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 06:23:21 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 21 Apr 2021 10:23:21 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1619000601.04.0.0570466460459.issue40222@roundup.psfhosted.org> Mark Shannon added the comment: The changes to pyc format aren't user visible so shouldn't matter, but what about the dis output? Consider this program: def f(): try: 1/0 except: return "fail" Currently it compiles to: 2 0 SETUP_FINALLY 7 (to 16) 3 2 LOAD_CONST 1 (1) 4 LOAD_CONST 2 (0) 6 BINARY_TRUE_DIVIDE 8 POP_TOP 10 POP_BLOCK 12 LOAD_CONST 0 (None) 14 RETURN_VALUE 4 >> 16 POP_TOP 18 POP_TOP 20 POP_TOP 5 22 POP_EXCEPT 24 LOAD_CONST 3 ('fail') 26 RETURN_VALUE With zero-cost exception handling, it will compile to something like: 2 0 NOP 3 2 LOAD_CONST 1 (1) 4 LOAD_CONST 2 (0) 6 BINARY_TRUE_DIVIDE 8 POP_TOP 10 LOAD_CONST 0 (None) 12 RETURN_VALUE None 14 PUSH_EXCEPT 4 16 POP_TOP 18 POP_TOP 20 POP_TOP 5 22 POP_EXCEPT 24 LOAD_CONST 3 ('fail') 26 RETURN_VALUE (There are additional optimizations that should be applied, but those are a separate issue) The problem is that the exception handling flow is no longer visible. Should we add it back in somehow, or just append the exception jump table? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 06:34:46 2021 From: report at bugs.python.org (Larry Hastings) Date: Wed, 21 Apr 2021 10:34:46 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619001286.98.0.17813176787.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: Just to round the bases: get_annotations() won't return an unmodified __annotations__ dict, but it *could* return a *consistent* dict. It could keep a cache (lru or otherwise) of all responses so far. I don't think that's what we want, I just thought I should point out the option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 06:39:57 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 21 Apr 2021 10:39:57 +0000 Subject: [issue43903] round() produces incorrect results with certain values In-Reply-To: <1618992902.95.0.267811041395.issue43903@roundup.psfhosted.org> Message-ID: <1619001597.77.0.219476994097.issue43903@roundup.psfhosted.org> Steven D'Aprano added the comment: I concur with Eric that this should be closed. They're not "incorrect results", they are correct results, or at least *better* results. We did not invent the so-called Banker's Rounding technique, it has been the standard used by the American Society for Testing and Materials (ASTM) since 1940, and was in common use even before that. https://infogalactic.com/info/Rounding#History (Despite the name, there's very little evidence that it has been used by bankers.) I am sorry that you expected different results and a worse rounding technique. The method of rounding taught in high schools is worse because it leads to bias. I'm sorry that you have been taught a poor rounding technique, but not everyone expects the same results you do. See previous issue #41598 and likely others. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 07:41:23 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 21 Apr 2021 11:41:23 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1619005283.18.0.469622022143.issue38605@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset b0544ba77cf86074fb1adde00558c67ca75eeea1 by Pablo Galindo in branch 'master': bpo-38605: Revert making 'from __future__ import annotations' the default (GH-25490) https://github.com/python/cpython/commit/b0544ba77cf86074fb1adde00558c67ca75eeea1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 08:01:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Apr 2021 12:01:37 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1619006497.42.0.554568610782.issue40222@roundup.psfhosted.org> Serhiy Storchaka added the comment: We can add a new column for the offset or the index of the error handler. Or add pseudo-instructions (which do not correspond to any bytecode) at boundaries of the code with some error handler. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 08:12:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Apr 2021 12:12:11 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1619007131.45.0.19686600019.issue38605@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10 -> [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 08:15:57 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 21 Apr 2021 12:15:57 +0000 Subject: [issue43430] Exception raised when attempting to create Enum via functional API In-Reply-To: <1615165107.75.0.80264384575.issue43430@roundup.psfhosted.org> Message-ID: <1619007357.34.0.75940452606.issue43430@roundup.psfhosted.org> Ethan Furman added the comment: That sounds more like the way it is intended to be used: make you base enum with all the changes you want, then use that base enum either by inheriting from it or as a function call: class MyBaseEnum(Enum, metaclass=...): ... custom stuff ... ... custom stuff ... class MyRealEnum1(MyBaseEnum): NAME = value NAME = value MyRealEnum2 = MyBaseEnum("MyRealEnum2", [('NAME', value), ('NAME', value)]) What change did you need with `__getitem__`? Maybe there is a way to accomplish that goal without subclassing EnumMeta. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 08:18:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Apr 2021 12:18:51 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1619007531.61.0.736385960054.issue38605@roundup.psfhosted.org> STINNER Victor added the comment: > New changeset b0544ba77cf86074fb1adde00558c67ca75eeea1 by Pablo Galindo in branch 'master': Copy of the NEWS entry: Revert making ``from __future__ import annotations`` the default. This follows the Steering Council decision to postpone PEP 563 changes to at least Python 3.11. See the original email for more information regarding the decision: https://mail.python.org/archives/list/python-dev at python.org/thread/CLVXXPQ2T2LQ5MP2Y53VVQFCXYWQJHKZ/. Patch by Pablo Galindo. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 08:19:17 2021 From: report at bugs.python.org (Erik Carstensen) Date: Wed, 21 Apr 2021 12:19:17 +0000 Subject: [issue43905] dataclasses.astuple does deepcopy on all fields Message-ID: <1619007557.11.0.871267775065.issue43905@roundup.psfhosted.org> 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: object key = object() lut = {key: 5} (y,) = dataclasses.astuple(Foo(x)) # KeyError lut[y] 2. dataclasses can only be converted to a tuple if all fields are serializable: import dataclasses @dataclasses.dataclass class Foo: f: object foo = Foo(open('test.py')) dataclasses.astuple(foo) -> TypeError: cannot pickle '_io.TextIOWrapper' object In my use case, I just want a list of all fields. I can do the following as a workaround: (getattr(foo, field.name) for field in dataclasses.fields(foo)) Tested on Python 3.8.7 and 3.7.9. ---------- components: Library (Lib) messages: 391516 nosy: mandolaerik priority: normal severity: normal status: open title: dataclasses.astuple does deepcopy on all fields versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 08:22:05 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 21 Apr 2021 12:22:05 +0000 Subject: [issue43904] Documentation for argparse, missed opportunity In-Reply-To: <1618995258.21.0.414286523788.issue43904@roundup.psfhosted.org> Message-ID: <1619007725.87.0.381607700943.issue43904@roundup.psfhosted.org> Eric V. Smith added the comment: If we're trying to be poetic, I think the last line should be "I intended it". ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 08:25:03 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 21 Apr 2021 12:25:03 +0000 Subject: [issue43905] dataclasses.astuple does deepcopy on all fields In-Reply-To: <1619007557.11.0.871267775065.issue43905@roundup.psfhosted.org> Message-ID: <1619007903.81.0.600045581205.issue43905@roundup.psfhosted.org> Eric V. Smith added the comment: Unfortunately this can't be changed, although I suppose it should be documented. In general I think this API was a mistake, and should not have been added. There are just too many cases where it doesn't do what you want, or where it fails. I'd like to deprecate it and remove it (along with asdict), but I fear that would be too disruptive. Your approach seems reasonable to me for your use case. ---------- assignee: -> eric.smith nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 08:52:41 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 21 Apr 2021 12:52:41 +0000 Subject: [issue43905] dataclasses.astuple does deepcopy on all fields In-Reply-To: <1619007557.11.0.871267775065.issue43905@roundup.psfhosted.org> Message-ID: <1619009561.78.0.623316337778.issue43905@roundup.psfhosted.org> Serhiy Storchaka added the comment: Why deepcopy is used at all? It is a very specific feature which should not be used by default. If you want to make a deep copy of fields, you can call copy.deepcopy() explicitly. copy.deepcopy(dataclasses.astuple(obj)) or dataclasses.astuple(copy.deepcopy(obj)) ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 09:20:47 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 21 Apr 2021 13:20:47 +0000 Subject: [issue43905] dataclasses.astuple does deepcopy on all fields In-Reply-To: <1619007557.11.0.871267775065.issue43905@roundup.psfhosted.org> Message-ID: <1619011247.44.0.420359353392.issue43905@roundup.psfhosted.org> Eric V. Smith added the comment: The reason for the deep copying was to support changing a hierarchy of dataclasses into something that could be JSON serialized. But it didn't really work out. It recurses into dataclasses, namedtuples, lists, tuples, and dicts, and deep copies everything else. As I said, it's a design flaw. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 09:54:05 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 21 Apr 2021 13:54:05 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1619013245.61.0.31168237648.issue42854@roundup.psfhosted.org> Change by Ethan Furman : ---------- Removed message: https://bugs.python.org/msg391419 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 09:55:39 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 21 Apr 2021 13:55:39 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1619013339.18.0.985433145806.issue42854@roundup.psfhosted.org> Ethan Furman added the comment: False alarm, sorry. Still getting used to merging, rebasing, etc. Current tests run fine. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 09:56:56 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 21 Apr 2021 13:56:56 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619013416.94.0.837077178897.issue38659@roundup.psfhosted.org> Change by Ethan Furman : ---------- versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 09:59:36 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 21 Apr 2021 13:59:36 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619013576.78.0.783305175171.issue38659@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +24219 pull_request: https://github.com/python/cpython/pull/25497 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 10:13:57 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 21 Apr 2021 14:13:57 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1619014437.35.0.355567000241.issue40222@roundup.psfhosted.org> Guido van Rossum added the comment: I like Serhiy?s idea. BTW, what are the three POP_TOP op codes in a row popping? ---------- nosy: +Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 10:28:41 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 21 Apr 2021 14:28:41 +0000 Subject: [issue43859] Improve syntax error for indentation errors In-Reply-To: <1618532769.85.0.413956426604.issue43859@roundup.psfhosted.org> Message-ID: <1619015321.95.0.530437706226.issue43859@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 56c95dfe271b1242bdc8163d4677e311552c00cb by Pablo Galindo in branch 'master': bpo-43859: Improve the error message for IndentationError exceptions (GH-25431) https://github.com/python/cpython/commit/56c95dfe271b1242bdc8163d4677e311552c00cb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 10:32:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 21 Apr 2021 14:32:46 +0000 Subject: [issue43859] Improve syntax error for indentation errors In-Reply-To: <1618532769.85.0.413956426604.issue43859@roundup.psfhosted.org> Message-ID: <1619015566.61.0.891347540339.issue43859@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 10:36:06 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 21 Apr 2021 14:36:06 +0000 Subject: [issue41701] Buildbot web page: connection lost after 1 minute, then display "Connection restored" popup In-Reply-To: <1599128479.83.0.639934661132.issue41701@roundup.psfhosted.org> Message-ID: <1619015766.82.0.198196892455.issue41701@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Can someone confirm if they still have this problem on the buildbot server? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 11:17:26 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 21 Apr 2021 15:17:26 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619018246.81.0.434078741288.issue43817@roundup.psfhosted.org> Eric V. Smith added the comment: > And since there are definitely circumstances in which it can't return __annotations__ directly, that indicates that it should never return __annotations__ directly. And the follow on here is that get_annotations() shouldn't set __annotations__ if it's None. I realize I'm just stating the obvious. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 11:23:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Apr 2021 15:23:50 +0000 Subject: [issue41701] Buildbot web page: connection lost after 1 minute, then display "Connection restored" popup In-Reply-To: <1599128479.83.0.639934661132.issue41701@roundup.psfhosted.org> Message-ID: <1619018630.56.0.45747055986.issue41701@roundup.psfhosted.org> STINNER Victor added the comment: > Can someone confirm if they still have this problem on the buildbot server? Oh wow, I don't have the issue anymore! Thank you very much :-) Previously, the website was barely usable :-( ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 11:43:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 21 Apr 2021 15:43:31 +0000 Subject: [issue30069] External library behave differently when loaded by Python (maybe thread issue) In-Reply-To: <1492164589.43.0.483719892275.issue30069@psf.upfronthosting.co.za> Message-ID: <1619019811.64.0.669136682527.issue30069@roundup.psfhosted.org> Irit Katriel added the comment: I'm closing this as out of date because the links no longer work and both Python 2.7/3.6 are no longer maintained. If you are still having this problem with more recent versions of Python, please create a new issue with up-to-date reproduction information. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 12:21:14 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 21 Apr 2021 16:21:14 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1619022074.26.0.750854250198.issue43284@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- keywords: +patch pull_requests: +24220 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25500 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 12:22:44 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 21 Apr 2021 16:22:44 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1619022164.65.0.550327747052.issue43284@roundup.psfhosted.org> Shreyan Avigyan added the comment: PR opened against master branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 12:49:30 2021 From: report at bugs.python.org (=?utf-8?b?0LrQvtGE0LXRkdC6?=) Date: Wed, 21 Apr 2021 16:49:30 +0000 Subject: [issue43906] turtle graphics don't work Message-ID: <1619023770.04.0.6173882524.issue43906@roundup.psfhosted.org> Change by ?????? : ---------- components: Build files: Screenshot_16.png nosy: antiendershow221 priority: normal severity: normal status: open title: turtle graphics don't work type: compile error versions: Python 3.8 Added file: https://bugs.python.org/file49969/Screenshot_16.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 13:09:35 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 21 Apr 2021 17:09:35 +0000 Subject: [issue43902] ssl module: add getter for SSL_CTX* and SSL* In-Reply-To: <1618991993.39.0.313806581209.issue43902@roundup.psfhosted.org> Message-ID: <1619024975.18.0.927311064395.issue43902@roundup.psfhosted.org> Steve Dower added the comment: Could we have the address exposed in a way that can only be passed back into ctypes? Or alternatively, doesn't function if ctypes is missing? I don't like offering ways to get real memory addresses, especially for interesting objects. At the same time, I see the value of it being available raw for CFFI and other tools that can use it. Maybe it would be better to expose it as ctx._call_with_ctypes("SSL_CTX_set_ciphersuites", b"TLS_CHACHA20_POLY1305_SHA256")? That also leaves the opportunity to special-case certain functions in the future. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 13:09:34 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 21 Apr 2021 17:09:34 +0000 Subject: [issue43906] turtle graphics don't work Message-ID: <1619024974.54.0.889799580121.issue43906@roundup.psfhosted.org> New submission from Steven D'Aprano : You have a bug in your code. This is a bug tracker for bugs in Python, not a help desk for solving errors in your own code. In this case, the problem is that you have created a file called "turtle.py" which is shadowing the original turtle module. Rename your file and try again. If you still have problems, please don't create bug reports here. Please discuss them at any of the many forums where you can get help, such as Reddit's r/learnpython, the Python mailing lists, or the Python Discuss. Thank you. Also, in future please don't post screen shots of error messages. They are text: please copy and paste the text into your bug report. Thank you. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved type: compile error -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 13:20:33 2021 From: report at bugs.python.org (Xi Ruoyao) Date: Wed, 21 Apr 2021 17:20:33 +0000 Subject: [issue40642] Cpython "pystate.h" subdirectory wrong In-Reply-To: <1589614857.55.0.73631693439.issue40642@roundup.psfhosted.org> Message-ID: <1619025633.61.0.0615325363068.issue40642@roundup.psfhosted.org> Xi Ruoyao added the comment: Dup of #39026. And the proposed fix is nack'ed in #39026. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 13:20:51 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 21 Apr 2021 17:20:51 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619025651.7.0.102034702382.issue38659@roundup.psfhosted.org> Ethan Furman added the comment: New changeset a02cb474f9c097c83cd444a47e9fb5f99b4aaf45 by Ethan Furman in branch 'master': bpo-38659: [Enum] add _simple_enum decorator (GH-25497) https://github.com/python/cpython/commit/a02cb474f9c097c83cd444a47e9fb5f99b4aaf45 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 13:29:38 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 21 Apr 2021 17:29:38 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619026178.5.0.286719248538.issue38659@roundup.psfhosted.org> Change by Ethan Furman : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 13:31:58 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 21 Apr 2021 17:31:58 +0000 Subject: [issue43906] turtle graphics don't work In-Reply-To: <1619024974.54.0.889799580121.issue43906@roundup.psfhosted.org> Message-ID: <1619026318.2.0.338992091811.issue43906@roundup.psfhosted.org> Change by Eric V. Smith : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 13:36:59 2021 From: report at bugs.python.org (Nathaniel Smith) Date: Wed, 21 Apr 2021 17:36:59 +0000 Subject: [issue43902] ssl module: add getter for SSL_CTX* and SSL* In-Reply-To: <1618991993.39.0.313806581209.issue43902@roundup.psfhosted.org> Message-ID: <1619026619.95.0.321040239273.issue43902@roundup.psfhosted.org> Nathaniel Smith added the comment: Funny, I was actually looking at this a bit last week, because I was trying to figure out if I could trick `ssl` into doing DTLS... The two big problems I ran into are: - for DTLS you need to instantiate the SSLContext with PROTOCOL_DTLS, and idk how you create a Python ssl._SSLMethod object for a random pointer. - You need to somehow find the libssl symbols, and it's not clear how to do that in a safe and portable way. The second issue seems like the big blocker. Your example does `ctypes.CDLL("libssl.so.1.1")`, but there's no guarantee that this will find the same libssl that the `ssl` module is linked against. (And if you get the wrong one then everything will probably explode.) And like you say, `ctypes.CDLL(ssl._ssl.__file__)` also works, by taking advantage of how ELF shared libraries tend to reexport all the symbols they import, but... this is an ELF-specific thing. It doesn't work on Windows or macOS. So to me the first question would be: is it possible to offer a utility function that reliably gives users a handle to the right libssl, on all systems and build configurations? If not then I don't see how this could work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 13:41:02 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 21 Apr 2021 17:41:02 +0000 Subject: [issue43902] ssl module: add getter for SSL_CTX* and SSL* In-Reply-To: <1618991993.39.0.313806581209.issue43902@roundup.psfhosted.org> Message-ID: <1619026862.11.0.239955087868.issue43902@roundup.psfhosted.org> Christian Heimes added the comment: I don't want to import ctypes from the ssl module code. PyCapsule could be a solution for the problem. Users would have to call PyCapsule_Import("_ssl.capsule") and PyCapsule_GetPointer() to access a struct with additional methods. It's a bit more work to implement and slightly harder to use, but safer than exposing raw memory addresses. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 13:53:23 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 21 Apr 2021 17:53:23 +0000 Subject: [issue43902] ssl module: add getter for SSL_CTX* and SSL* In-Reply-To: <1618991993.39.0.313806581209.issue43902@roundup.psfhosted.org> Message-ID: <1619027603.11.0.90588425672.issue43902@roundup.psfhosted.org> Christian Heimes added the comment: Funny, I was looking into the same issue with CDLL(). :) The trick with ssl._ssl.__file__ may even break if users change sys.setdlopenflag() from RTLD_GLOBAL to RTLD_LOCAL. Static linking will also influence which symbols are available. Python/dynload_shlib.c keeps a list of dlopen handles around, but there is no way to access the list of handles. Mmh ... tricky. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 13:55:13 2021 From: report at bugs.python.org (Nathaniel Smith) Date: Wed, 21 Apr 2021 17:55:13 +0000 Subject: [issue43902] ssl module: add getter for SSL_CTX* and SSL* In-Reply-To: <1618991993.39.0.313806581209.issue43902@roundup.psfhosted.org> Message-ID: <1619027713.55.0.289321102203.issue43902@roundup.psfhosted.org> Nathaniel Smith added the comment: Python's 'id' function exposes raw memory addresses constantly. As long as they're just integers, they can't do much harm. (In Rust, taking a pointer to a random object is considered totally safe, can be done anywhere. It's *dereferencing* a pointer where you need special 'unsafe' annotations.) Addresses can potentially reveal ASLR slides or heap layout to an attacker, but I think the marginal risk here is pretty low. You'd need a situation where someone is like, tricking your program into calling ctx._ssl_ctx_addr() and then sending the result to the attacker? Seems unlikely, and not something anyone worries about with 'id'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 14:08:15 2021 From: report at bugs.python.org (Carl Friedrich Bolz-Tereick) Date: Wed, 21 Apr 2021 18:08:15 +0000 Subject: [issue43907] pickle.py bytearray memoization bug with protocol 5 Message-ID: <1619028495.22.0.0031927289703.issue43907@roundup.psfhosted.org> New submission from Carl Friedrich Bolz-Tereick : The new codepath for the BYTEARRAY8 bytecode is missing memoization: >>> import pickletools, pickle >>> b = (bytearray(b"abc"), ) * 2 >>> b1, b2 = pickle.loads(pickle.dumps(b, 5)) # C version >>> b1 is b2 True (bytearray(b'abc'), bytearray(b'abc')) >>> b1, b2 = pickle.loads(pickle._dumps(b, 5)) # python version >>> b1 is b2 # :-( False Found it because PyPy is using pickle.py with no C implementation. I'm preparing a patch. ---------- messages: 391537 nosy: Carl.Friedrich.Bolz priority: normal severity: normal status: open title: pickle.py bytearray memoization bug with protocol 5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 14:17:24 2021 From: report at bugs.python.org (Carl Friedrich Bolz-Tereick) Date: Wed, 21 Apr 2021 18:17:24 +0000 Subject: [issue43907] pickle.py bytearray memoization bug with protocol 5 In-Reply-To: <1619028495.22.0.0031927289703.issue43907@roundup.psfhosted.org> Message-ID: <1619029044.34.0.949338040006.issue43907@roundup.psfhosted.org> Change by Carl Friedrich Bolz-Tereick : ---------- keywords: +patch pull_requests: +24221 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25501 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 14:18:29 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 21 Apr 2021 18:18:29 +0000 Subject: [issue43907] pickle.py bytearray memoization bug with protocol 5 In-Reply-To: <1619028495.22.0.0031927289703.issue43907@roundup.psfhosted.org> Message-ID: <1619029109.61.0.3448661589.issue43907@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 14:20:43 2021 From: report at bugs.python.org (Sofian Brabez) Date: Wed, 21 Apr 2021 18:20:43 +0000 Subject: [issue42422] types.CodeType() has no bytecode verifier In-Reply-To: <1605943207.33.0.904447657295.issue42422@roundup.psfhosted.org> Message-ID: <1619029243.03.0.438784203636.issue42422@roundup.psfhosted.org> Sofian Brabez added the comment: Thanks Victor, it's clear now. About the updates of the crashers, I sent the updated patches to update them in PR [3] before the following issue [1] and PR [2] but the other seems to have been merged already. It seems my submission was totally forgot and now obsolete. So I'm gonna close this ticket. [1] https://bugs.python.org/issue42734 [2] https://github.com/python/cpython/pull/23939 [3] https://github.com/python/cpython/pull/23448 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 14:27:37 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 21 Apr 2021 18:27:37 +0000 Subject: [issue43902] ssl module: add getter for SSL_CTX* and SSL* In-Reply-To: <1618991993.39.0.313806581209.issue43902@roundup.psfhosted.org> Message-ID: <1619029657.57.0.517222052725.issue43902@roundup.psfhosted.org> Steve Dower added the comment: There's a working POC out there for modifying tuple elements that relies on the fact that id() returns real memory addresses, so I don't see it as a harmless thing. Also, Rust is only worrying about code that's put into its compiler, whereas Python has to worry about any code that might be injected into a running process, which is vastly easier than in Rust. The situations don't really compare. It's also part of defense-in-depth. If there's no good reason to make it trivial for people to locate TLS-specific data structures in memory, why make it trivial? It's probably still possible (turns out everything is...), but it's worth raising the complexity and lowering the reliability by making someone jump through crazy hoops to get it. > The second issue seems like the big blocker. Your example does `ctypes.CDLL("libssl.so.1.1")`, but there's no guarantee that this will find the same libssl that the `ssl` module is linked against. On Windows, it's spelled "libssl-1_1", but it *is* guaranteed to load the right one. However, I'd rather encode this information somewhere inside _ssl than making it a guarantee (as presumably OpenSSL 3.0 will change this name structure). Also, this is not the same as ssl._ssl.__file__. So yeah, this aspect is not very portable, which is why I'd rather it just be exposed as a "call OpenSSL function on this context by name". > I don't want to import ctypes from the ssl module code. Import it in the function when it's called, then. Reimports are so close to free they're basically irrelevant, and if your tight inner loop includes TLS then it's not actually a tight inner loop, so looking in sys.modules isn't going to hurt anyone. I would definitely push back on importing it eagerly in ssl.py :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 14:52:19 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 21 Apr 2021 18:52:19 +0000 Subject: [issue43908] array.array should remain immutable Message-ID: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> New submission from Guido van Rossum : Hi Victor, Sorry for making this a deferred blocker. I recall that we had a brief discussion somewhere about an accidental change to the array.array type -- this is now a heap type (Py_TPFLAGS_HEAPTYPE is set), and as a consequence it is no longer immutable. In 3.9 this is an error: >>> import array >>> array.array.foo = 1 Traceback (most recent call last): File "", line 1, in TypeError: can't set attributes of built-in/extension type 'array.array' >>> But in 3.10a7 it passes: >>> array.array.foo = 1 >>> array.array.foo 1 >>> I would like this type (and other types that have been or will be converted to heap types) to remain immutable. How can we do that? I think we may need a new flag bit meaning "built-in type, immutable". This bit should not be inherited of course. What do you think? (Feel free to close if this is a duplicate -- I couldn't find where we discussed this previously, sorry.) ---------- assignee: vstinner messages: 391540 nosy: gvanrossum, vstinner priority: deferred blocker severity: normal status: open title: array.array should remain immutable type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 14:54:21 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 21 Apr 2021 18:54:21 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619031261.05.0.198449374023.issue43908@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 15:04:40 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Apr 2021 19:04:40 +0000 Subject: [issue43904] Documentation for argparse, missed opportunity In-Reply-To: <1618995258.21.0.414286523788.issue43904@roundup.psfhosted.org> Message-ID: <1619031880.36.0.84212116659.issue43904@roundup.psfhosted.org> Raymond Hettinger added the comment: It's a cute suggestion but I think it would be a distraction that makes the docs slightly worse. The example "works" because the eye has to search to see what makes the text special, the indentation. If you add a second special but irrelevant text feature, it makes it less likely that the first will succeed. Thanks for the cute and entertaining submission, but I'll decline because clarity comes first. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 16:15:35 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 21 Apr 2021 20:15:35 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619036135.96.0.0241126557165.issue43901@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 16:26:23 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 21 Apr 2021 20:26:23 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619036783.49.0.155942445659.issue43901@roundup.psfhosted.org> Guido van Rossum added the comment: Sounds like a plan, I agree that the original design misfired here (we were probably worried about million-line code bases with tens of thousands of classes having to pay the price of tens of thousands of empty dicts, but I now think that was an unnecessary worry -- that should be a few megabytes on a very much larger total). But given that you're not done yet: - Is it possible to create __annotations__ lazily? (IIRC in January we came to a conclusion about this, something like yes for modules but for classes, or the other way around?) - Why would __annotations__ ever be None? Why do you allow setting it to None? Do we know of people ever write '__annotations__ = None' in their class or write 'cls.__annotations__ = None'? - And where's your PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 16:29:04 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 21 Apr 2021 20:29:04 +0000 Subject: [issue42737] PEP 563: drop annotations for complex assign targets In-Reply-To: <1608888770.02.0.483696766952.issue42737@roundup.psfhosted.org> Message-ID: <1619036944.69.0.202431465283.issue42737@roundup.psfhosted.org> Batuhan Taskaya added the comment: > Batuhan, can you summarize the argument from the thread? What do you think yourself? Myself, I'm not sure either way, but it seems okay to remove the remnant bytecode. I feel like we shouldn't generate code for these annotations at all, and only evaluate the targets. Since this is one of the things that blocks us right now regarding the bugfix of different issues (e.g annotations have side effects on symbol table). Even though the PEP 563 being default change is reverted, I think we should move forward with this change but only do it under the future_annotations flag. @gvanrossum @pablogsal what do you think about this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 17:01:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Apr 2021 21:01:06 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619038866.5.0.0742795244791.issue43908@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +Library (Lib) nosy: +corona10, shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 17:11:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Apr 2021 21:11:57 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1619039517.55.0.1374138564.issue40137@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24222 pull_request: https://github.com/python/cpython/pull/25504 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 17:18:21 2021 From: report at bugs.python.org (David Felsen) Date: Wed, 21 Apr 2021 21:18:21 +0000 Subject: [issue38119] resource tracker destroys shared memory segments when other processes should still have valid access In-Reply-To: <1568217506.85.0.770661201111.issue38119@roundup.psfhosted.org> Message-ID: <1619039901.76.0.624252773805.issue38119@roundup.psfhosted.org> Change by David Felsen : ---------- nosy: +davfelsen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 17:24:25 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 21 Apr 2021 21:24:25 +0000 Subject: [issue42737] PEP 563: drop annotations for complex assign targets In-Reply-To: <1608888770.02.0.483696766952.issue42737@roundup.psfhosted.org> Message-ID: <1619040265.13.0.967676037694.issue42737@roundup.psfhosted.org> Guido van Rossum added the comment: Hum, there seems to be an actual bug here: even with PEP 563, the annotations for "complex targets" are evaluated. For example: from __future__ import annotations class C: x.y: z.w a: b.c The relevant parts of the disassembly of the code for the class object are: 3 10 LOAD_NAME 3 (x) 12 POP_TOP 14 LOAD_NAME 4 (z) 16 LOAD_ATTR 5 (w) 18 POP_TOP 4 20 LOAD_CONST 1 ('b.c') 22 LOAD_NAME 6 (__annotations__) 24 LOAD_CONST 2 ('a') 26 STORE_SUBSCR So for x.y: z.w, not only do we evaluate x, we also evaluate z.w; whereas b.c is not evaluated (the stringified version is added as __annotations__['a']). I think the "LOAD_NAME(x), POP_TOP" part is correct, but "LOAD_NAME(z), LOAD_ATTR(w), POP_TOP" should not be generated at all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 17:26:48 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 21 Apr 2021 21:26:48 +0000 Subject: [issue42737] PEP 563: drop annotations for complex assign targets In-Reply-To: <1608888770.02.0.483696766952.issue42737@roundup.psfhosted.org> Message-ID: <1619040408.81.0.53638323033.issue42737@roundup.psfhosted.org> Guido van Rossum added the comment: The same thing happens at the module level. However in functions all is well (because inside functions annotations are never evaluated, apparently). It may be as simple as the code forgetting to check the PEP 563 bit when generating code for complex annotations in classes and at the top (module) level. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 17:34:34 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 21 Apr 2021 21:34:34 +0000 Subject: [issue42737] PEP 563: drop annotations for complex assign targets In-Reply-To: <1608888770.02.0.483696766952.issue42737@roundup.psfhosted.org> Message-ID: <1619040874.48.0.496694332741.issue42737@roundup.psfhosted.org> Batuhan Taskaya added the comment: > Hum, there seems to be an actual bug here: even with PEP 563, the annotations for "complex targets" are evaluated. For example: Yes, that is what this issue is about. This bug only surfaced while doing other stuff and PEP 563 being the default > I think the "LOAD_NAME(x), POP_TOP" part is correct, but "LOAD_NAME(z), LOAD_ATTR(w), POP_TOP" should not be generated at all. Agreed, which is what the PR 23952 has proposed. I'll proceed with the PR and update it according to the revert of PEP 563, which should hopefully fix this only when the future flag is activated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 17:36:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Apr 2021 21:36:43 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1619041003.67.0.984342969073.issue40137@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d4aaa34798f0dd8402f412e2aa9d6fa2d6cff5fa by Victor Stinner in branch 'master': bpo-40137: _PyType_GetModuleByDef() doesn't check tp_flags (GH-25504) https://github.com/python/cpython/commit/d4aaa34798f0dd8402f412e2aa9d6fa2d6cff5fa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 17:40:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Apr 2021 21:40:16 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1619041216.64.0.328977037239.issue40137@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24223 pull_request: https://github.com/python/cpython/pull/25505 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 17:50:39 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 21 Apr 2021 21:50:39 +0000 Subject: [issue43472] [security][subinterpreters] Add auditing hooks to subinterpreter module In-Reply-To: <1615455062.58.0.468186541544.issue43472@roundup.psfhosted.org> Message-ID: <1619041839.34.0.397147148294.issue43472@roundup.psfhosted.org> Steve Dower added the comment: I'll need Eric to confirm, but I think the best thing to do here is to not release the thread state in _xxsubinterpreters.interp_create, but let _Py_NewInterpreter() do it. That way the existing event will be raised in interpreter-level hooks, rather than only the process-wide hook. PR incoming. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 17:58:53 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 21 Apr 2021 21:58:53 +0000 Subject: [issue43472] [security][subinterpreters] Add auditing hooks to subinterpreter module In-Reply-To: <1615455062.58.0.468186541544.issue43472@roundup.psfhosted.org> Message-ID: <1619042333.04.0.466728725002.issue43472@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +24224 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25506 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 18:10:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Apr 2021 22:10:35 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1619043035.67.0.545107743212.issue40137@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 760da626ff4124e1344fd8b7dbeb83b2c4b7c12c by Victor Stinner in branch 'master': bpo-40137: Optimize _PyType_GetModuleByDef() loop (GH-25505) https://github.com/python/cpython/commit/760da626ff4124e1344fd8b7dbeb83b2c4b7c12c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 18:15:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Apr 2021 22:15:05 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1619043305.81.0.466661351041.issue40137@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24225 pull_request: https://github.com/python/cpython/pull/25507 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 18:22:29 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Apr 2021 22:22:29 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1619043749.55.0.103851582354.issue40137@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 139c232f3851b393798d0ea4e65f1298bfbcd9cf by Raymond Hettinger in branch 'master': bpo-40137: Move state lookups out of the critical path (GH-25492) https://github.com/python/cpython/commit/139c232f3851b393798d0ea4e65f1298bfbcd9cf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 18:34:37 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 21 Apr 2021 22:34:37 +0000 Subject: [issue43472] [security][subinterpreters] Add auditing hooks to subinterpreter module In-Reply-To: <1615455062.58.0.468186541544.issue43472@roundup.psfhosted.org> Message-ID: <1619044477.52.0.462494927902.issue43472@roundup.psfhosted.org> Steve Dower added the comment: New changeset 7b86e47617d81a4b14d929743425f448971e8c86 by Steve Dower in branch 'master': bpo-43472: Ensure PyInterpreterState_New audit events are raised when called through _xxsubinterpreters module (GH-25506) https://github.com/python/cpython/commit/7b86e47617d81a4b14d929743425f448971e8c86 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 18:34:55 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Apr 2021 22:34:55 +0000 Subject: [issue43472] [security][subinterpreters] Add auditing hooks to subinterpreter module In-Reply-To: <1615455062.58.0.468186541544.issue43472@roundup.psfhosted.org> Message-ID: <1619044495.99.0.979125023275.issue43472@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24226 pull_request: https://github.com/python/cpython/pull/25508 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 18:35:05 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Apr 2021 22:35:05 +0000 Subject: [issue43472] [security][subinterpreters] Add auditing hooks to subinterpreter module In-Reply-To: <1615455062.58.0.468186541544.issue43472@roundup.psfhosted.org> Message-ID: <1619044505.51.0.0703909545307.issue43472@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24227 pull_request: https://github.com/python/cpython/pull/25509 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 18:40:55 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 21 Apr 2021 22:40:55 +0000 Subject: [issue43472] [security][subinterpreters] Add auditing hooks to subinterpreter module In-Reply-To: <1615455062.58.0.468186541544.issue43472@roundup.psfhosted.org> Message-ID: <1619044855.38.0.266341946064.issue43472@roundup.psfhosted.org> Change by Steve Dower : ---------- assignee: -> steve.dower resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 18:40:35 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 21 Apr 2021 22:40:35 +0000 Subject: [issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname In-Reply-To: <1453942730.98.0.111965775649.issue26227@psf.upfronthosting.co.za> Message-ID: <1619044835.59.0.202903381142.issue26227@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +24228 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25510 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 18:41:49 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 21 Apr 2021 22:41:49 +0000 Subject: [issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname In-Reply-To: <1453942730.98.0.111965775649.issue26227@psf.upfronthosting.co.za> Message-ID: <1619044909.96.0.226722279868.issue26227@roundup.psfhosted.org> Change by Steve Dower : ---------- assignee: -> steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 18:43:03 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 21 Apr 2021 22:43:03 +0000 Subject: [issue43756] About updating audit events when function gains new arguments In-Reply-To: <1617750271.94.0.577978285316.issue43756@roundup.psfhosted.org> Message-ID: <1619044983.75.0.0390482053729.issue43756@roundup.psfhosted.org> Steve Dower added the comment: New changeset a32f8fe7133aad4f3cf8946534e3b79a5f2659da by Saiyang Gou in branch 'master': bpo-43756: Add new audit event for new arguments added to glob.glob (GH-25239) https://github.com/python/cpython/commit/a32f8fe7133aad4f3cf8946534e3b79a5f2659da ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 18:53:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Apr 2021 22:53:00 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1619045579.99.0.732361228829.issue40137@roundup.psfhosted.org> STINNER Victor added the comment: New changeset cdad2724e6f7426372901cc5dedd8a462ba046a6 by Victor Stinner in branch 'master': bpo-40137: Add pycore_moduleobject.h internal header (GH-25507) https://github.com/python/cpython/commit/cdad2724e6f7426372901cc5dedd8a462ba046a6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 18:53:34 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Apr 2021 22:53:34 +0000 Subject: [issue43472] [security][subinterpreters] Add auditing hooks to subinterpreter module In-Reply-To: <1615455062.58.0.468186541544.issue43472@roundup.psfhosted.org> Message-ID: <1619045614.44.0.291878114158.issue43472@roundup.psfhosted.org> miss-islington added the comment: New changeset 602eefef0bd0187049c2ab9071390f8573fc299a by Miss Islington (bot) in branch '3.8': bpo-43472: Ensure PyInterpreterState_New audit events are raised when called through _xxsubinterpreters module (GH-25506) https://github.com/python/cpython/commit/602eefef0bd0187049c2ab9071390f8573fc299a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 18:56:30 2021 From: report at bugs.python.org (Larry Hastings) Date: Wed, 21 Apr 2021 22:56:30 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619045790.07.0.418989332843.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: > - Is it possible to create __annotations__ lazily? (IIRC in January we came to a conclusion about this, something like yes for modules but for classes, or the other way around?) Maybe for modules, definitely not for classes. The problem is that best practice for classes is to look in the class dict for __annotations__. That sidesteps the inheritance problem. Functions already lazily create a dict __annotations__ if not set. And it's not stored in the function dict. So nobody ever looks in the function dict for __annotations__. That all works fine. Would you prefer that *just classes* lazily create __annotations__? It's not hard code to write, but I was being cautious. "always set __annotations__ to an empty dict" is the easiest code to write and get correct. And since modules are not all that numerous even in the largest projects, it seemed like this un-optimized approach would have a minimal contribution to the heat death of the universe. It's also remotely possible that someone out there does look in the module dict for __annotations__, though I admit I've never seen it. It seems like it'd be tempting to write your code that way though: if isinstance(o, (type, types.ModuleType)): ann = o.__dict__.get("__annotations__", None) elif callable(o): ann = o.__annotations__ else: raise ValueError(f"{o!r} doesn't support annotations") > - Why would __annotations__ ever be None? Simply because it's the cheapest sensible way to indicate "this object has no annotations". It would be nice if the world accepted __annotations__ being None to mean "no annotations". But I don't think we're there. I note that the function object has a special setter for __annotations__ (func_set_annotations()), since at least Python 3.1, which explicitly only allows setting __annotations__ to either a dict or None. (I didn't have 3.0 handy.) > Why do you allow setting it to None? Me? I've never contributed code to Python that restricts the permissible types of values one is allowed to set on __annotations__. Function objects are opinionated as mentioned (either dict or None), classes and modules have no opinion whatsoever, and allow you to set __annotations__ to any value. That was all true long before I started working on annotations. > Do we know of people ever write '__annotations__ = None' in their class or write 'cls.__annotations__ = None'? AFAIK I've never seen anyone set __annotations__ to None. > - And where's your PR? Not done yet. I only started it last night, and there were a lot of test failures--it turns out, a *lot* of regression tests do a sanity check that __annotations__ isn't set on classes (and maybe modules too). For example, I was surprised that test_opcodes has two such test failures. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 18:59:40 2021 From: report at bugs.python.org (Larry Hastings) Date: Wed, 21 Apr 2021 22:59:40 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619045980.53.0.850350648931.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: By the way, here's a tidbit I never got around to posting in c.l.p-d. I noted in the conversation in January that attrs is an outlier here: it *doesn't* look in the class dict for __annotations__. Instead, it has some complicated code where it asks the class for its annotations, then iterates over the __mro__ and asks every base class for *its* annotations. If the class and a base class have the same class dict (using the "is" operator iirc) then attrs says "oh, that class doesn't have its own annotations, it's inheriting them" and reacts appropriately. I emailed Hynek to ask him why he did it that way. It turns out, he did that because at the time he didn't know you could peek in the class dict for __annotations__. He literally had a todo item saying "change to looking in the class dict". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 19:06:34 2021 From: report at bugs.python.org (Saiyang Gou) Date: Wed, 21 Apr 2021 23:06:34 +0000 Subject: [issue42737] PEP 563: drop annotations for complex assign targets In-Reply-To: <1608888770.02.0.483696766952.issue42737@roundup.psfhosted.org> Message-ID: <1619046394.09.0.825148892646.issue42737@roundup.psfhosted.org> Change by Saiyang Gou : ---------- pull_requests: +24229 pull_request: https://github.com/python/cpython/pull/25511 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 19:12:34 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Apr 2021 23:12:34 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1619046754.22.0.498498641989.issue40137@roundup.psfhosted.org> STINNER Victor added the comment: New microbenchmark on the functools.lru_cache(lambda: 42) function using my 3 optimizations on _PyType_GetModuleByDef(): * commit d4aaa34798f0dd8402f412e2aa9d6fa2d6cff5fa * commit 760da626ff4124e1344fd8b7dbeb83b2c4b7c12c * commit cdad2724e6f7426372901cc5dedd8a462ba046a6 * I didn't pick Raymond's optimization for this benchmark, so I can still use _functools for my benchmark. $ python3 -m pyperf compare_to py39.json master.json Mean +- std dev: [py39] 38.8 ns +- 0.5 ns -> [master] 39.2 ns +- 0.9 ns: 1.01x slower The _PyType_GetModuleByDef() overhead in _functools is now about +0.4 ns, it's better than my previous measurement before optimization: +5.7 ns (37.5 ns +- 1.0 ns -> 43.2 ns +- 0.7 ns). These timings are really tiny, it's really hard to get reliable timing even with CPU isolation. For example, two measurements on Python 3.9: * Old measurement: 37.5 ns +- 1.0 ns * New measurement: 38.8 ns +- 0.5 ns I guess that for timings under 100 ns, the PGO build is no longer reliable enough. Moreover, the std dev is around to 1 ns on 40 ns. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 19:14:26 2021 From: report at bugs.python.org (Larry Hastings) Date: Wed, 21 Apr 2021 23:14:26 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619046866.75.0.0978538925961.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: It occurs to me that part of this work should also be a new "best practices for __annotations__" entry in the Python docs. Best practices for working with annotations, for code that requires a minimum Python version of 3.10+: Best practice is to call either inspect.get_annotations() or typing.get_type_hints() to access annotations. But if you want to access '__annotations__' on an object directly: * Always access the annotations on an object using the attribute interface, either o.__annotations__ or getattr(o, '__annotations__'). Accessing '__annotations__' through other mechanisms (e.g. looking in the class dict) is unsupported. * Assume that o.__annotations__ is always either a dict or None. * It's best to not assign to o.__annotations__. But if you must, always set it to either a dict or None. * Never delete o.__annotations__. * Never modify o.__annotations__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 19:18:31 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Apr 2021 23:18:31 +0000 Subject: [issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname In-Reply-To: <1453942730.98.0.111965775649.issue26227@psf.upfronthosting.co.za> Message-ID: <1619047111.19.0.553160529625.issue26227@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 11.0 -> 12.0 pull_requests: +24230 pull_request: https://github.com/python/cpython/pull/25512 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 19:18:40 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Apr 2021 23:18:40 +0000 Subject: [issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname In-Reply-To: <1453942730.98.0.111965775649.issue26227@psf.upfronthosting.co.za> Message-ID: <1619047120.02.0.334230834772.issue26227@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24231 pull_request: https://github.com/python/cpython/pull/25513 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 19:18:23 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 21 Apr 2021 23:18:23 +0000 Subject: [issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname In-Reply-To: <1453942730.98.0.111965775649.issue26227@psf.upfronthosting.co.za> Message-ID: <1619047103.42.0.140390502361.issue26227@roundup.psfhosted.org> Steve Dower added the comment: New changeset dc516ef8395d15da0ab225eb0dceb2e0581f51ca by Steve Dower in branch 'master': bpo-26227: Fixes decoding of host names on Windows from ANSI instead of UTF-8 (GH-25510) https://github.com/python/cpython/commit/dc516ef8395d15da0ab225eb0dceb2e0581f51ca ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 19:23:53 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 21 Apr 2021 23:23:53 +0000 Subject: [issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname In-Reply-To: <1453942730.98.0.111965775649.issue26227@psf.upfronthosting.co.za> Message-ID: <1619047433.02.0.636564505667.issue26227@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 19:24:35 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 21 Apr 2021 23:24:35 +0000 Subject: [issue43756] About updating audit events when function gains new arguments In-Reply-To: <1617750271.94.0.577978285316.issue43756@roundup.psfhosted.org> Message-ID: <1619047475.23.0.997208155912.issue43756@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 19:27:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Apr 2021 23:27:27 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1619047647.53.0.541144988327.issue40137@roundup.psfhosted.org> STINNER Victor added the comment: msg391004 benchmark comparing master with Raymond's optimization (commit 139c232f3851b393798d0ea4e65f1298bfbcd9cf) compared to Python 3.9: Mean +- std dev: [py39] 38.8 ns +- 0.5 ns -> [obj_cache] 40.3 ns +- 0.1 ns: 1.04x slower For me, these numbers make no sense :-D Getting kwd_mark from the instance (Raymond's new code) *must* be faster than calling _PyType_GetModuleByDef() on the instance. As I wrote in my previous comment, my bet is that PGO is not reproducible and so we should not pay too much attention to differences of a few nanoseconds. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 19:28:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Apr 2021 23:28:53 +0000 Subject: [issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented In-Reply-To: <1585753703.83.0.0762180613721.issue40137@roundup.psfhosted.org> Message-ID: <1619047733.91.0.391504215279.issue40137@roundup.psfhosted.org> STINNER Victor added the comment: IMO we spent enough time micro-optimizing _functools and _PyType_GetModuleByDef(). I don't think that it's worth it to spend too much time trying to investigate differences between benchmarks around +- 1 ns on ~40 ns. I close the issue. Thanks Raymond for fixing the slowdown ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 19:34:29 2021 From: report at bugs.python.org (Larry Hastings) Date: Wed, 21 Apr 2021 23:34:29 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619048069.74.0.671887895332.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: > * Never modify o.__annotations__. Let me revise that to: * If o.__annotations__ is a dict, never modify the contents of that dict. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 19:36:43 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Apr 2021 23:36:43 +0000 Subject: [issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname In-Reply-To: <1453942730.98.0.111965775649.issue26227@psf.upfronthosting.co.za> Message-ID: <1619048203.08.0.973773632307.issue26227@roundup.psfhosted.org> miss-islington added the comment: New changeset f7bc44170b4bdd16c46b4b6acf7673ffc24dfb19 by Miss Islington (bot) in branch '3.8': bpo-26227: Fixes decoding of host names on Windows from ANSI instead of UTF-8 (GH-25510) https://github.com/python/cpython/commit/f7bc44170b4bdd16c46b4b6acf7673ffc24dfb19 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 19:43:43 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Apr 2021 23:43:43 +0000 Subject: [issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname In-Reply-To: <1453942730.98.0.111965775649.issue26227@psf.upfronthosting.co.za> Message-ID: <1619048623.78.0.869200592372.issue26227@roundup.psfhosted.org> miss-islington added the comment: New changeset d8576b1d15155688a67baac24c15254700bdd3b7 by Miss Islington (bot) in branch '3.9': bpo-26227: Fixes decoding of host names on Windows from ANSI instead of UTF-8 (GH-25510) https://github.com/python/cpython/commit/d8576b1d15155688a67baac24c15254700bdd3b7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 20:08:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 22 Apr 2021 00:08:46 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619050126.54.0.647975968858.issue38659@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Commit a02cb474f9c097c83cd444a47e9fb5f99b4aaf45 fails to build in the refleak buildbots: https://buildbot.python.org/all/#/builders/75/builds/2/steps/5/logs/stdio Example failure: ? ./python -m test test_enum -R : 0:00:00 load avg: 1.81 Run tests sequentially 0:00:00 load avg: 1.81 [1/1] test_enum beginning 9 repetitions 123456789 .test test_enum failed -- Traceback (most recent call last): File "/home/pablogsal/github/python/master/Lib/test/test_enum.py", line 3700, in test_convert_repr_and_str self.assertEqual(format(test_type.CONVERT_STRING_TEST_NAME_A), '5') AssertionError: 'CONVERT_STRING_TEST_NAME_A' != '5' - CONVERT_STRING_TEST_NAME_A + 5 test_enum failed == Tests result: FAILURE == 1 test failed: test_enum Total duration: 586 ms Tests result: FAILURE ---------- nosy: +pablogsal resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 20:10:07 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 22 Apr 2021 00:10:07 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619050207.84.0.65541107176.issue38659@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 20:10:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 22 Apr 2021 00:10:36 +0000 Subject: [issue12403] Mention sys.displayhook in code module docs and the compile builtin docs In-Reply-To: <1308959744.93.0.261089879651.issue12403@psf.upfronthosting.co.za> Message-ID: <1619050236.44.0.214891620076.issue12403@roundup.psfhosted.org> Irit Katriel added the comment: The patch for the code module doc needs to be converted into a github PR. A new patch is needed for the compile builtin documentation: https://docs.python.org/3/library/functions.html#compile This could be added at the end of the third paragraph, where it says that in 'single' mode non-None results are printed - clarify that sys.displayhook is used for that. (See these unit tests for examples: https://github.com/python/cpython/blob/09b90a037d18f5d4acdf1b14082e57bda78e85d3/Lib/test/test_sys.py#L26) ---------- keywords: +easy -patch nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.1, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 20:11:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 22 Apr 2021 00:11:21 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619050281.42.0.601245486626.issue38659@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Can someone take a look? As per the buildbot policy (https://discuss.python.org/t/policy-to-revert-commits-on-buildbot-failure/404) we may need to revert it if is not fixed in 24 because of the risk of masking errors. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 20:21:24 2021 From: report at bugs.python.org (Saiyang Gou) Date: Thu, 22 Apr 2021 00:21:24 +0000 Subject: [issue28724] Add method send_io, recv_io to the socket module. In-Reply-To: <1479395133.65.0.0720889900419.issue28724@psf.upfronthosting.co.za> Message-ID: <1619050884.74.0.488203683222.issue28724@roundup.psfhosted.org> Change by Saiyang Gou : ---------- nosy: +gousaiyang nosy_count: 7.0 -> 8.0 pull_requests: +24232 pull_request: https://github.com/python/cpython/pull/22608 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 21:16:11 2021 From: report at bugs.python.org (Saiyang Gou) Date: Thu, 22 Apr 2021 01:16:11 +0000 Subject: [issue38692] add a pidfd child process watcher In-Reply-To: <1572932584.65.0.943486856043.issue38692@roundup.psfhosted.org> Message-ID: <1619054171.12.0.923170944142.issue38692@roundup.psfhosted.org> Change by Saiyang Gou : ---------- nosy: +gousaiyang nosy_count: 10.0 -> 11.0 pull_requests: +24233 pull_request: https://github.com/python/cpython/pull/25515 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 21:19:18 2021 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 22 Apr 2021 01:19:18 +0000 Subject: [issue42422] types.CodeType() has no bytecode verifier In-Reply-To: <1605943207.33.0.904447657295.issue42422@roundup.psfhosted.org> Message-ID: <1619054358.94.0.791051325605.issue42422@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 21:31:13 2021 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Thu, 22 Apr 2021 01:31:13 +0000 Subject: [issue38692] add a pidfd child process watcher In-Reply-To: <1572932584.65.0.943486856043.issue38692@roundup.psfhosted.org> Message-ID: <1619055073.82.0.955840645367.issue38692@roundup.psfhosted.org> Change by Chih-Hsuan Yen : ---------- nosy: -yan12125 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 22:44:22 2021 From: report at bugs.python.org (Ammar Askar) Date: Thu, 22 Apr 2021 02:44:22 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619059462.16.0.581065417193.issue38659@roundup.psfhosted.org> Ammar Askar added the comment: Looks like this is the issue described in the comment here: https://github.com/python/cpython/blob/master/Lib/test/test_enum.py#L3691-L3692 On the first run you have the correct ('CONVERT_STRING_TEST_NAME_A', 5) but later it turns into ('CONVERT_STRING_TEST_NAME_A', test.test_enum.CONVERT_STRING_TEST_NAME_A) causing double-conversions of the enum elements. This causes the format(x) test to fail. You can re-create the same issue outside of the refleak by adding a simple: def test_convert_repr_and_str_again(self): self.test_convert_repr_and_str() method. ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 23:04:17 2021 From: report at bugs.python.org (Ammar Askar) Date: Thu, 22 Apr 2021 03:04:17 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619060657.6.0.216769126616.issue38659@roundup.psfhosted.org> Change by Ammar Askar : ---------- pull_requests: +24234 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/25516 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 23:19:00 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 22 Apr 2021 03:19:00 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619061540.03.0.109014520268.issue38659@roundup.psfhosted.org> Ethan Furman added the comment: `format` issue resolved, but not the refleak issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 23:23:27 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 22 Apr 2021 03:23:27 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619061807.79.0.622511546648.issue38659@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 37b173c5231b7b202859af97c17bc3d04b1e4c75 by Ammar Askar in branch 'master': bpo-38659: Properly re-intialize module variables in test_enum (GH-25516) https://github.com/python/cpython/commit/37b173c5231b7b202859af97c17bc3d04b1e4c75 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 21 23:35:02 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 22 Apr 2021 03:35:02 +0000 Subject: [issue30800] zlib.compressobj took too much memory on window In-Reply-To: <1498715799.11.0.0910878994528.issue30800@psf.upfronthosting.co.za> Message-ID: <1619062502.84.0.918030637997.issue30800@roundup.psfhosted.org> Change by Inada Naoki : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 00:06:17 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 22 Apr 2021 04:06:17 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619064377.14.0.770411823099.issue38659@roundup.psfhosted.org> Ethan Furman added the comment: Actually, I think that fixed the refleak issue as well. Thanks, Ammar! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 00:07:43 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 22 Apr 2021 04:07:43 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619064463.55.0.126771325503.issue43901@roundup.psfhosted.org> Guido van Rossum added the comment: I?d say that best practices for 3.9+ are more useful. There seem to be several contradictions in your remarks, but we?ll get to those in the review. ---------- nosy: +Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 00:08:53 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 22 Apr 2021 04:08:53 +0000 Subject: [issue28724] Add method send_io, recv_io to the socket module. In-Reply-To: <1479395133.65.0.0720889900419.issue28724@psf.upfronthosting.co.za> Message-ID: <1619064533.57.0.595934142389.issue28724@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 660592f67c0d825b06eb4a38ccc04b34a1f01f00 by Saiyang Gou in branch 'master': bpo-28724: Doc: Move socket.send_fds and socket.recv_fds docs to right section (GH-22608) https://github.com/python/cpython/commit/660592f67c0d825b06eb4a38ccc04b34a1f01f00 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 00:09:03 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 04:09:03 +0000 Subject: [issue28724] Add method send_io, recv_io to the socket module. In-Reply-To: <1479395133.65.0.0720889900419.issue28724@psf.upfronthosting.co.za> Message-ID: <1619064543.23.0.618713919144.issue28724@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +24235 pull_request: https://github.com/python/cpython/pull/25517 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 00:29:23 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Thu, 22 Apr 2021 04:29:23 +0000 Subject: [issue43909] Fuzz dis module and find crashes for dis.dis(), dis.get_instructions() dis.show_code() Message-ID: <1619065763.61.0.475663843227.issue43909@roundup.psfhosted.org> New submission from Xinmeng Xia : We write a fuzz tool to fuzz Python standard libraries, and find three crashes: dis.dis(), dis.get_instructions() dis.show_code() in dis module. dis.dis() ========================================== xiaxinmeng:~ xiaxinmeng$ python3.10 Python 3.10.0a3 (v3.10.0a3:8bae2a958e, Dec 7 2020, 15:31:51) [Clang 12.0.0 (clang-1200.0.32.27)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import dis >>> dis.dis("s%-yPdrns"*1000000) Segmentation fault: 11 ================================================= dis.get_instructions() ================================================= Python 3.10.0a3 (v3.10.0a3:8bae2a958e, Dec 7 2020, 15:31:51) [Clang 12.0.0 (clang-1200.0.32.27)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import dis >>> dis.get_instructions("c/f/x"*1000000) Segmentation fault: 11 ================================================== dis.show_code() =================================================== Python 3.10.0a3 (v3.10.0a3:8bae2a958e, Dec 7 2020, 15:31:51) [Clang 12.0.0 (clang-1200.0.32.27)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import dis >>> dis.show_code("G/7/K"*1000000) Segmentation fault: 11 ==================================================== ---------- components: Library (Lib) messages: 391574 nosy: xxm priority: normal severity: normal status: open title: Fuzz dis module and find crashes for dis.dis(), dis.get_instructions() dis.show_code() type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 00:32:52 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 04:32:52 +0000 Subject: [issue28724] Add method send_io, recv_io to the socket module. In-Reply-To: <1479395133.65.0.0720889900419.issue28724@psf.upfronthosting.co.za> Message-ID: <1619065972.66.0.715744878084.issue28724@roundup.psfhosted.org> miss-islington added the comment: New changeset 87a392db40d52cba18ffc67730856e11cb8cf945 by Miss Islington (bot) in branch '3.9': bpo-28724: Doc: Move socket.send_fds and socket.recv_fds docs to right section (GH-22608) https://github.com/python/cpython/commit/87a392db40d52cba18ffc67730856e11cb8cf945 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 00:35:33 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 22 Apr 2021 04:35:33 +0000 Subject: [issue28724] Add method send_io, recv_io to the socket module. In-Reply-To: <1479395133.65.0.0720889900419.issue28724@psf.upfronthosting.co.za> Message-ID: <1619066133.66.0.54070407007.issue28724@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 01:13:45 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Thu, 22 Apr 2021 05:13:45 +0000 Subject: [issue27763] Add complex case to test_builtin abs() In-Reply-To: <1471203172.09.0.573399775535.issue27763@psf.upfronthosting.co.za> Message-ID: <1619068425.16.0.640232032126.issue27763@roundup.psfhosted.org> Sergey B Kirpichev added the comment: > We're testing the cmath functions on complex number inputs Indeed. Also, for abs(complex) - there is test_abs() in the test_complex.py. > The complex number creation from both strings and pairs of floats should be tested independently, of course. It seems, there are such tests as well. E.g. test_constructor() in the same file. Mark, perhaps this can be closed? ---------- nosy: +Sergey.Kirpichev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 01:19:50 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 22 Apr 2021 05:19:50 +0000 Subject: [issue43898] Python fails to import .dylib but works when extension is changed to .so In-Reply-To: <1618948768.32.0.880323883479.issue43898@roundup.psfhosted.org> Message-ID: <1619068790.77.0.161244314508.issue43898@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the clarification. On most platforms other than Windows, Python expects compiled extension modules (usually written in C or C++) to have an extension of .so. This is true as well on macOS. Typically, extension modules are compiled using Python's Distutils, or one of its newer derivatives, which takes care of creating the proper extension module file name. If you are building an extension module with something else, you'll need to ensure that the shared library file name has the expected format. Note that PEP 3149, implemented in Python 3.2, extends the filename extension to include the Python version (although unversioned .so file names are still accepted for compatibility); see https://docs.python.org/3/whatsnew/3.2.html#pep-3149-abi-version-tagged-so-files for more information. $ python3 -c 'import sysconfig;print(sysconfig.get_config_var("EXT_SUFFIX"))' .cpython-39-darwin.so ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 02:46:09 2021 From: report at bugs.python.org (hai shi) Date: Thu, 22 Apr 2021 06:46:09 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619073969.5.0.0446670128544.issue43908@roundup.psfhosted.org> hai shi added the comment: > I would like this type (and other types that have been or will be converted to heap types) to remain immutable. Hi, Guido. I am interested in what have been broken in fact? or it's a defined behavior? > I think we may need a new flag bit meaning "built-in type, immutable". This bit should not be inherited of course. Aggreed. Adding a new `tp_flag` is a lightweight solution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 03:15:32 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Apr 2021 07:15:32 +0000 Subject: [issue43909] Fuzz dis module and find crashes for dis.dis(), dis.get_instructions() dis.show_code() In-Reply-To: <1619065763.61.0.475663843227.issue43909@roundup.psfhosted.org> Message-ID: <1619075732.67.0.290838599689.issue43909@roundup.psfhosted.org> Serhiy Storchaka added the comment: The problem is not related to dis, but to compile. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Compiling long expression leads to segfault (again) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 03:23:06 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 22 Apr 2021 07:23:06 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1619076186.96.0.835130440871.issue40222@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 03:24:58 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 22 Apr 2021 07:24:58 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619076298.11.0.982649700013.issue43908@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 04:03:45 2021 From: report at bugs.python.org (Mark Gordon) Date: Thu, 22 Apr 2021 08:03:45 +0000 Subject: [issue43910] cgi.parse_header does not handle escaping correctly Message-ID: <1619078625.68.0.392663181082.issue43910@roundup.psfhosted.org> New submission from Mark Gordon : cgi.parse_header incorrectly handles unescaping of quoted-strings Note that you can find the related RFCs to how HTTP encodes the Content-Type header at https://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html and further discussion on how quoted-string is defined at https://greenbytes.de/tech/webdav/draft-ietf-httpbis-p1-messaging-16.html#rfc.section.3.2.1.p.3. The way parse_header is written it has no context to be able to tell if a backslash is escaping a double quote or if the backslash is actually the escaped character and the double quote is free-standing, unescaped. For this reason it fails to parse values that have a backslash literal at the end. e.g. the following Content-Type will fail to be parsed a/b; foo="moo\\"; bar=baz Example run on current cpython master demonstrating the bug: Python 3.10.0a7+ (heads/master:660592f67c, Apr 21 2021, 22:51:04) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import cgi >>> query = 'a; foo="moo\\\\"; bar=cow' >>> print(query) a; foo="moo\\"; bar=cow >>> cgi.parse_header(query) ('a', {'foo': '"moo\\\\"; bar=cow'}) ---------- components: Library (Lib) messages: 391580 nosy: msg555 priority: normal severity: normal status: open title: cgi.parse_header does not handle escaping correctly type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 04:14:58 2021 From: report at bugs.python.org (Mark Gordon) Date: Thu, 22 Apr 2021 08:14:58 +0000 Subject: [issue43910] cgi.parse_header does not handle escaping correctly In-Reply-To: <1619078625.68.0.392663181082.issue43910@roundup.psfhosted.org> Message-ID: <1619079298.29.0.0188561398535.issue43910@roundup.psfhosted.org> Change by Mark Gordon : ---------- keywords: +patch pull_requests: +24236 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25519 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 04:20:20 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 22 Apr 2021 08:20:20 +0000 Subject: [issue27763] Add complex case to test_builtin abs() In-Reply-To: <1471203172.09.0.573399775535.issue27763@psf.upfronthosting.co.za> Message-ID: <1619079620.72.0.240183097013.issue27763@roundup.psfhosted.org> Mark Dickinson added the comment: Yes, it looks as though we do have tests of the form that Evelyn describes in test_complex (which also seems like the right place for those tests). Closing here. Thanks Sergey for the ping! ---------- stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 04:20:29 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 22 Apr 2021 08:20:29 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619079629.44.0.248046182528.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: FWIW, I was the one who converted arraymodule to use heap types in 75bf107c62fbdc00af51ee4f6ab69df4bd201104 (GH-23124) in January. Sorry 'bout the accidental change of behaviour. > I think we may need a new flag bit meaning "built-in type, immutable". This bit should not be inherited of course. +1. See attached PoC patch. As far as I understand, type flags must be explicitly inherited in Objects/typeobject.c, no? Should all previous static types be immutable, or are there exceptions? ---------- keywords: +patch Added file: https://bugs.python.org/file49970/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 04:20:42 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 22 Apr 2021 08:20:42 +0000 Subject: [issue27763] Add complex case to test_builtin abs() In-Reply-To: <1471203172.09.0.573399775535.issue27763@psf.upfronthosting.co.za> Message-ID: <1619079642.05.0.959107328972.issue27763@roundup.psfhosted.org> Change by Mark Dickinson : ---------- resolution: -> out of date _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 04:25:55 2021 From: report at bugs.python.org (Larry Hastings) Date: Thu, 22 Apr 2021 08:25:55 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619079955.2.0.0460969653473.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: When I proposed this new function, stringized annotations were the default behavior in Python 3.10, and there were two calls to typing.get_type_hints() in the standard library: * inspect.signature() * functools.singledispatch() Now that stringized annotations are no longer the default in 3.10, we've reverted that change to inspect.signature(). The call is still present in functools.singledispatch(), but that's been there for a while--it's in 3.9.4 for example. It's worth considering changing inspect.signature() to use get_annotations(). To be honest, I've never been really sure if the idea of PEP 563 stringized annotations are supposed to be a hidden implementation detail, or a first-class concept that the user (and the standard library) is expected to deal with. My current get_annotations() implementation assumes the former, and eval()s the annotations back into real Python values if it thinks that's the right thing to do. Personally I'd prefer that inspect.signature() un-stringized annotations for me--I would see that as a useful feature--but I could be completely wrong on this. For now, I'm going to plan on modifying inspect.signature() so it calls get_annotations() as part of this PR. (I'll also modify inspect.signature() to take a "eval_str" keyword-only parameter, and pass that through to get_annotations(). That gives the caller control over this un-stringizing feature, in case they need to turn it off.) ?ukasz: what about functools.singledispatch()? IIUC, it uses typing.get_type_hints() to get the type of the first parameter of a function, so it can use that as an index into a dict mapping first-argument types to functions.. Since it's not a user-visible detail perhaps it doesn't matter. But it seems a little strange to me that it's using typing.get_type_hints()--ISTM it should be calling inspect.signature(), or possibly this proposed new inspect.get_annotations(). What do you think? ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 04:29:47 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 22 Apr 2021 08:29:47 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619080187.59.0.59096615616.issue43908@roundup.psfhosted.org> Mark Shannon added the comment: Adding an extra flag seems like the sensible thing to do for 3.10 Longer term, we should decouple immutability from whether something is a heap type. I don't know why we would care that it is a heap type at all. Which bit of memory it happens to sit in seems irrelevant to anything but the GC. Erland, could you turn your patch into PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 04:36:10 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 22 Apr 2021 08:36:10 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619080570.8.0.744131748432.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > Erland, could you turn your patch into PR? Certainly, but despite the issue title, this issue mentions all types that have been converted to heap types. Should we apply the new immutable flag to _all_ heap types in the stdlib? Guido: > I would like this type (and other types that have been or will be converted to heap types) to remain immutable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 04:54:00 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 22 Apr 2021 08:54:00 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619081640.18.0.496143167892.issue43908@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24238 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25520 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 05:13:22 2021 From: report at bugs.python.org (Jens) Date: Thu, 22 Apr 2021 09:13:22 +0000 Subject: [issue43911] Queue.get() memory leak Message-ID: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> New submission from Jens : I use the following code to produce what looks like a memory leak after emptying a queue with the get() method. import queue import os import psutil def run(del_after_puts, del_after_gets, n_puts, process): mem = queue.Queue() for msg in range(n_puts): msg_put = f'{msg}_0000000000000000000000000000000000000000000000000000000000000333333333333331111111111' if msg % 1000000 == 0: print(f'puting {msg} qsize {len(mem.queue)}') mem.put(msg_put) print(f'------ put done ----- qsize {len(mem.queue)}') print(f'mem_pct {round(process.memory_percent(), 2)}% ') if del_after_puts: print(f'deleting queue after puts {mem}') del mem print(f'mem_pct {round(process.memory_percent(), 2)}% ') return for _ in range(n_puts): msg_get = mem.get() msg = int(msg_get.split('_')[0]) if msg % 1000000 == 0: print(f'getting_q {msg} qsize {len(mem.queue)} ') mem.task_done() print(f'------ gets done ----- qsize {len(mem.queue)}') print(f'mem_pct {round(process.memory_percent(), 2)}% ') if del_after_gets: print(f'deleting queue after gets {mem}') del mem print(f'mem_pct {round(process.memory_percent(), 2)}% ') return if __name__ == '__main__': del_after_puts = False del_after_gets = False n_puts = 20_000_000 print() print('#########') print(f'del_after_puts {del_after_puts} del_after_gets {del_after_gets} n_puts {n_puts}') process = psutil.Process(os.getpid()) print('before run') print(f'mem_pct {round(process.memory_percent(), 2)}% ') run(del_after_puts, del_after_gets, n_puts, process) print(f'after run return') print(f'mem_pct {round(process.memory_percent(), 2)}% ') This script can be run in 3 ways: 1. Add n_puts elements into the queue and then empty it. 2. Add n_puts elements into the queue and then delete the queue object 3. Add n_puts elements into the queue and then empty it and then delete the queue object. For the 1st and 3rd case, the script seems to produce a memory leak as in the following: 1st case, before putting elements into the queue mem used is 0.15%, after emptying it 2.22%: > ######### > > del_after_puts False del_after_gets False n_puts 20000000 > > before run > > mem_pct 0.15% > > ------ put done ----- qsize 20000000 > > mem_pct 37.61% > > ------ gets done ----- qsize 0 > > mem_pct 2.22% 3rd case, before putting elements into the queue mem used is 0.15%, after emptying it 2.22%, after deleting the object, 2.22%: > ######### > > del_after_puts False del_after_gets True n_puts 20000000 > > before run > > mem_pct 0.15% > > ------ put done ----- qsize 20000000 > > mem_pct 37.61% > > ------ gets done ----- qsize 0 > > mem_pct 2.22% > > deleting queue after gets > > mem_pct 2.22% For the 2nd case, mem_pct at the start is 0.15%, after putting all elements into the queue and just deleting it, 0.16%, which is almost the same. > ######### > > del_after_puts True del_after_gets False n_puts 20000000 > > before run > > mem_pct 0.15% > > ------ put done ----- qsize 20000000 > > mem_pct 37.61% > > deleting queue after puts > > mem_pct 0.16% As it can be seen, memory returns to the start level only in the first case when only `queue.put()` is invoked, hence it seems that `queue.get()` produces a memory leak. This is persistent across python 3.7, 3.8, as well as 3.9. ---------- messages: 391586 nosy: multiks2200 priority: normal severity: normal status: open title: Queue.get() memory leak versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 05:14:47 2021 From: report at bugs.python.org (Jens) Date: Thu, 22 Apr 2021 09:14:47 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619082887.93.0.671324580899.issue43911@roundup.psfhosted.org> Jens added the comment: I've tried to profile the memory with tracemalloc as well as pympler, but they dont show any leaks at python level, so I suspect that might be a C level leak. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 05:24:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Apr 2021 09:24:43 +0000 Subject: [issue43862] warnings: -W option and PYTHONWARNINGS now use the message as a regex In-Reply-To: <1618578407.09.0.811659309688.issue43862@roundup.psfhosted.org> Message-ID: <1619083483.13.0.248394269109.issue43862@roundup.psfhosted.org> STINNER Victor added the comment: I also created a thread on python-dev: https://mail.python.org/archives/list/python-dev at python.org/thread/JMKLA4RUJLTORBPPTM4BWL76VNNMKYVG/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 05:41:31 2021 From: report at bugs.python.org (Christer Weinigel) Date: Thu, 22 Apr 2021 09:41:31 +0000 Subject: [issue42333] Port ssl module to heap types and module state (PEP 573) In-Reply-To: <1605201558.44.0.0361525548575.issue42333@roundup.psfhosted.org> Message-ID: <1619084491.58.0.969732424959.issue42333@roundup.psfhosted.org> Change by Christer Weinigel : ---------- nosy: +wingel71 nosy_count: 3.0 -> 4.0 pull_requests: +24239 pull_request: https://github.com/python/cpython/pull/25255 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 05:41:31 2021 From: report at bugs.python.org (Christer Weinigel) Date: Thu, 22 Apr 2021 09:41:31 +0000 Subject: [issue43669] PEP 644: Require OpenSSL 1.1.1 or newer In-Reply-To: <1617106246.37.0.0210118077092.issue43669@roundup.psfhosted.org> Message-ID: <1619084491.93.0.216865441071.issue43669@roundup.psfhosted.org> Change by Christer Weinigel : ---------- nosy: +wingel71 nosy_count: 1.0 -> 2.0 pull_requests: +24240 pull_request: https://github.com/python/cpython/pull/25255 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 05:52:04 2021 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 22 Apr 2021 09:52:04 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619085124.6.0.447317696232.issue43892@roundup.psfhosted.org> Change by Nick Coghlan : ---------- keywords: +patch pull_requests: +24241 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25521 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 06:01:39 2021 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 22 Apr 2021 10:01:39 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619085699.72.0.737157133054.issue43892@roundup.psfhosted.org> Change by Nick Coghlan : ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 07:10:07 2021 From: report at bugs.python.org (Larry Hastings) Date: Thu, 22 Apr 2021 11:10:07 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619089807.55.0.0343336347123.issue43817@roundup.psfhosted.org> Change by Larry Hastings : ---------- keywords: +patch pull_requests: +24242 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25522 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 07:33:38 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 22 Apr 2021 11:33:38 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619091218.6.0.00723259178915.issue43817@roundup.psfhosted.org> Eric V. Smith added the comment: > To be honest, I've never been really sure if the idea of PEP 563 stringized annotations are supposed to be a hidden implementation detail, or a first-class concept that the user (and the standard library) is expected to deal with. This is an excellent question. My assumption with dataclasses has been that it's something the user is expected to deal with. It's a user-visible change, that all users of __annotations__ are going to have to deal with. I understood PEP 573 as saying: if you don't want to see a stringized annotation, call typing.get_type_hints() yourself. My assumption is that neither @dataclass nor anybody else is going to do that for you. However, not everyone agreed. See for example issue 39442. I do think that wherever we end up with __annotations__ in 3.11, we should be explicit about answering your question. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 07:47:06 2021 From: report at bugs.python.org (Larry Hastings) Date: Thu, 22 Apr 2021 11:47:06 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619092026.45.0.736683540818.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: I think it gets a little murkier when we talk about *annotations* vs *type hints*. Type hints have a defined meaning for a string: a string is a sort of forward declaration, and you eval() the string to get the real value. (Or, not, if you're comfortable working with the stringized version of the type hint.) So typing.get_type_hints() calls eval() on *every* annotation value of type str. But inspect.get_annotations() can't be so opinionated. If the user entered a string as their annotation, it should assume they want the string to show up in the annotations dict. This is why I'm trying to be so smart with the "eval_str" default value heuristic. The text in the docs about a "future version of Python" is pursuant to my vague "PEP 1212" idea, which would let get_annotations() determine or not whether the annotations were stringized by the compiler. Or whatever we wind up deciding to do for Python 3.11--which, as you say, will hopefully disambiguate this question. p.s. assuming you meant PEP 563, not PEP 573. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 07:57:00 2021 From: report at bugs.python.org (Larry Hastings) Date: Thu, 22 Apr 2021 11:57:00 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619092620.71.0.265234428089.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: PR is up, passes all checks. I think it's ready for the first round of reviews! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 08:12:02 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 22 Apr 2021 12:12:02 +0000 Subject: [issue25786] contextlib.ExitStack introduces a cycle in exception __context__ In-Reply-To: <1449086325.2.0.703552973067.issue25786@psf.upfronthosting.co.za> Message-ID: <1619093522.15.0.517534942124.issue25786@roundup.psfhosted.org> Irit Katriel added the comment: Looks like it was fixed in contextlib here: https://github.com/python/cpython/commit/ba2ecd68414b9c53d00560579f5bc13459bc0449 ---------- nosy: +iritkatriel resolution: -> fixed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 08:14:14 2021 From: report at bugs.python.org (Larry Hastings) Date: Thu, 22 Apr 2021 12:14:14 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619093654.28.0.985055751918.issue43817@roundup.psfhosted.org> Change by Larry Hastings : ---------- assignee: -> larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 08:16:27 2021 From: report at bugs.python.org (Aivar Annamaa) Date: Thu, 22 Apr 2021 12:16:27 +0000 Subject: [issue43511] tkinter with Tk 8.6.11 is slow on macOS In-Reply-To: <1615875194.4.0.35991043769.issue43511@roundup.psfhosted.org> Message-ID: <1619093787.49.0.838337232055.issue43511@roundup.psfhosted.org> Aivar Annamaa added the comment: According to Tk people, the regression in performance was unavoidable and the solution is to avoid relying on update in a loop: https://core.tcl-lang.org/tk/tktview/f642d7c0f4 ---------- nosy: +Aivar.Annamaa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 08:18:41 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 22 Apr 2021 12:18:41 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619093921.02.0.675750542738.issue43817@roundup.psfhosted.org> Eric V. Smith added the comment: > p.s. assuming you meant PEP 563, not PEP 573. Yes. Someday I'll figure out this keyboard. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 08:41:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Apr 2021 12:41:17 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619095277.87.0.757130117807.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: Guido: > Sorry for making this a deferred blocker. I recall that we had a brief discussion somewhere about an accidental change to the array.array type -- this is now a heap type (Py_TPFLAGS_HEAPTYPE is set), and as a consequence it is no longer immutable. *Many* static types have been converted to heap types in Python 3.9 and Python 3.10. Is there a rule to decide which types should be mutable or not? All types implemented in Python are mutable, unless the very few which use slots. By the way, some cases can be inherited or not. Do we care about that? Example: $ python3 Python 3.9.2 (default, Feb 20 2021, 00:00:00) >>> def f(): pass ... >>> class MyFuncType(type(f)): pass ... Traceback (most recent call last): File "", line 1, in TypeError: type 'function' is not an acceptable base type ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 08:50:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Apr 2021 12:50:52 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619095852.0.0.349001683209.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: Let me propose a flag name: Py_TPFLAGS_IMMUTABLE. Py_TPFLAGS_IMMUTABLE implies that setattr(type, name, value) fails. A type has a dictionary, but it cannot be modified with type.__dict__[name] = value, since type.__dict__ returns a read-only mapping proxy. Currently, the limitation of not being able to modify a built-in type is arbitrary, it's not a technical limitation. It is implemented in type_setattro() which is the default implementation of tp_setattro: PyType_Type.tp_setattro = type_setattro. Not having Py_TPFLAGS_HEAPTYPE flag implies "immutable". I suggest to add a new Py_TPFLAGS_IMMUTABLE flag and modify PyType_Ready() to use the flag if Py_TPFLAGS_HEAPTYPE is not set: if (!(flags & Py_TPFLAGS_HEAPTYPE)) { flags |= Py_TPFLAGS_IMMUTABLE; } You can try with this change: diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 254d12cc97..4bd02d40c1 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -3875,13 +3875,6 @@ static int type_setattro(PyTypeObject *type, PyObject *name, PyObject *value) { int res; - if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE)) { - PyErr_Format( - PyExc_TypeError, - "can't set attributes of built-in/extension type '%s'", - type->tp_name); - return -1; - } if (PyUnicode_Check(name)) { if (PyUnicode_CheckExact(name)) { if (PyUnicode_READY(name) == -1) It becomes possible to modify built-in types: $ ./python Python 3.10.0a7+ (heads/master-dirty:cdad2724e6, Apr 22 2021, 14:44:44) [GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux >>> str.x=1 >>> str.x 1 >>> del str.x >>> del str.__repr__ >>> del str.__repr__ Traceback (most recent call last): File "", line 1, in AttributeError: __repr__ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 08:51:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Apr 2021 12:51:51 +0000 Subject: [issue38692] add a pidfd child process watcher In-Reply-To: <1572932584.65.0.943486856043.issue38692@roundup.psfhosted.org> Message-ID: <1619095911.83.0.279051725232.issue38692@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 09:01:03 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Apr 2021 13:01:03 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619096463.37.0.146710683585.issue43908@roundup.psfhosted.org> Serhiy Storchaka added the comment: Maybe name it Py_TPFLAGS_IMMUTABLETYPE? Just IMMUTABLE can mean that instances of the type are immutable, but we want to make a type itself immutable. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 09:21:35 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Apr 2021 13:21:35 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619097695.78.0.245947582945.issue43908@roundup.psfhosted.org> Serhiy Storchaka added the comment: Is there a full list of types converted to heap types? There may be other issues related to differences between heap and static types. 1. Static type with tp_new = NULL does not have public constructor, but heap type inherits constructor from base class. As result, it allows to create instances without proper initialization, that can lead to crash. It was fixed for few standard heap types in issue23815, then reintroduced, then fixed again in issue42694. But it should be checked for every type without constructor. 2. Static types was not pickleable with protocol 0 and 1 by default. Heap types were pickleable by default, as result, you did not get error when pickle instances of newly converted types, but get an error when try to unpickle. It was fixed in general enough case in issue41052, but it is worth to recheck it for every converted type. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 09:30:36 2021 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 22 Apr 2021 13:30:36 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619098236.57.0.00674095913357.issue43892@roundup.psfhosted.org> Nick Coghlan added the comment: The draft PR moved because I messed up the previous branch name: https://github.com/ncoghlan/cpython/pull/9/files It's to the point where everything except symtable.c compiles. I put an initial skeleton of a validator in, but only enough to check that the parallel sequence lengths in the class and mapping pattern nodes are consistent - there's still plenty to be done in Batuhan's PR (e.g. because the AST constant folding now just delegates to the expression folding functions for MatchValue values and MatchMapping keys, this iteration only enforces the restrictions on permitted subexpressions in the surface syntax). In addition to Brandt's MatchStar suggestion, I've also tweaked the MatchClassparameter names to better match PEP 634 (the old names were based on PEP 642's attribute pattern concept, so "extra_*" made sense, but "kwd_*" makes more sense for PEP 634): pattern = MatchAlways | MatchValue(expr value) | MatchConstant(constant value) | MatchSequence(pattern* patterns) | MatchMapping(expr* keys, pattern* patterns) | MatchClass(expr cls, pattern* patterns, identifier* kwd_attrs, pattern* kwd_patterns) | MatchStar(identifier? target) -- A NULL entry in the MatchMapping key list handles capturing extra mapping keys | MatchAs(pattern? pattern, identifier target) | MatchOr(pattern* patterns) attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset) I think the idea of making the MatchMapping node signature "MatchMapping(expr* keys, pattern* patterns, identifier? rest)" has merit, but I'd like to get this initial iteration reviewed first to minimise the diff in the compiler_pattern_mapping implementation (right now it is fairly clear that the code generation for mapping patterns hasn't changed, but that will become significantly less obvious if/when the "**rest" handling changes away from working the same way _PyAST_Dict works) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 09:34:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Apr 2021 13:34:12 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619098452.16.0.453539136743.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: > Maybe name it Py_TPFLAGS_IMMUTABLETYPE? "TPFLAGS" stands for "type flags". So IMO adding "TYPE" suffix is redundant. If tomorrow, we want to add a flag for immutable instance, we can add a new Py_TPFLAGS_IMMUTABLE_INSTANCE flag. On the other side, TYPE suffix is consistent with other flags :-) /* Set if the type object is dynamically allocated */ #define Py_TPFLAGS_HEAPTYPE (1UL << 9) /* Set if the type allows subclassing */ #define Py_TPFLAGS_BASETYPE (1UL << 10) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 09:37:04 2021 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 22 Apr 2021 13:37:04 +0000 Subject: [issue43897] Implement support for validation of pattern matching ASTs In-Reply-To: <1618947333.54.0.307745509696.issue43897@roundup.psfhosted.org> Message-ID: <1619098624.12.0.773059464529.issue43897@roundup.psfhosted.org> Change by Nick Coghlan : ---------- priority: normal -> critical _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 09:37:12 2021 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 22 Apr 2021 13:37:12 +0000 Subject: [issue43897] Implement support for validation of pattern matching ASTs In-Reply-To: <1618947333.54.0.307745509696.issue43897@roundup.psfhosted.org> Message-ID: <1619098632.22.0.55469388741.issue43897@roundup.psfhosted.org> Change by Nick Coghlan : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 10:02:51 2021 From: report at bugs.python.org (Andy Maier) Date: Thu, 22 Apr 2021 14:02:51 +0000 Subject: [issue43912] http.client.BadStatusLine raised and response contains request Message-ID: <1619100171.95.0.666024363299.issue43912@roundup.psfhosted.org> New submission from Andy Maier : Hello, we have a nasty occurrence of BadStatusLine that shows the status line of the request(!!) in one of our projects. That exception is raised when checking a response and should check the response, not the request. Further debugging revealed that not only the status line is from the request, but also the headers and the body of the response are from the request when this error happens. Example exception when using http.client to send the requests: http.client.BadStatusLine: POST http://localhost:50000 HTTP/1.1 I have created a standalone script that can be used to reproduce the behavior. The script can use http.client or the requests package for sending the requests. The server is a threaded HTTP server. The script needs to be run multiple times to reproduce the error. On my local system, the error showed up pretty reliably within the first 50 repetitions of the script. The header comment of the script explains the details. If http.client is chosen to be used, the script is purely based on standard Python library functions. The error shows up on all CPython versions I tried, up to 3.9. ---------- components: Library (Lib) files: badstatusline.py messages: 391601 nosy: andymaier priority: normal severity: normal status: open title: http.client.BadStatusLine raised and response contains request type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file49971/badstatusline.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 10:14:25 2021 From: report at bugs.python.org (Andy Maier) Date: Thu, 22 Apr 2021 14:14:25 +0000 Subject: [issue43912] http.client.BadStatusLine raised and response contains request In-Reply-To: <1619100171.95.0.666024363299.issue43912@roundup.psfhosted.org> Message-ID: <1619100865.73.0.0446218770489.issue43912@roundup.psfhosted.org> Andy Maier added the comment: I should have added that my local system is macOS, and that "up to 3.9" means I only tried up to 3.9. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 10:29:42 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 22 Apr 2021 14:29:42 +0000 Subject: [issue37578] Change Glob: Allow Recursion for Hidden Files In-Reply-To: <1562984633.23.0.0355519865943.issue37578@roundup.psfhosted.org> Message-ID: <1619101782.06.0.0142044495359.issue37578@roundup.psfhosted.org> Petr Viktorin added the comment: I wonder if it would be worth it to add a new option to include hidden files (except . and ..) For the record, setuptools' fork of glob does this unconditionally: https://github.com/pypa/setuptools/blob/main/setuptools/glob.py ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 10:34:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 22 Apr 2021 14:34:16 +0000 Subject: [issue25786] contextlib.ExitStack introduces a cycle in exception __context__ In-Reply-To: <1449086325.2.0.703552973067.issue25786@psf.upfronthosting.co.za> Message-ID: <1619102056.88.0.958437294018.issue25786@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: fixed -> duplicate stage: -> resolved status: pending -> closed superseder: -> Hang with contextlib.ExitStack and subprocess.Popen (regression) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 11:26:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 22 Apr 2021 15:26:29 +0000 Subject: [issue1697943] msgfmt cannot cope with BOM - improve error message Message-ID: <1619105189.56.0.35391772323.issue1697943@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: not a bug -> title: msgfmt cannot cope with BOM -> msgfmt cannot cope with BOM - improve error message versions: +Python 3.11 -Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 11:30:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 22 Apr 2021 15:30:52 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619105452.02.0.572201700211.issue38659@roundup.psfhosted.org> STINNER Victor added the comment: def setUp(self): # Reset the module-level test variables to their original integer # values, otherwise the already created enum values get converted # instead. Why not doing that in a tearDown() method instead? What if you run explicitly a single test method? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 11:35:20 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 22 Apr 2021 15:35:20 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1619105720.06.0.255886306165.issue43475@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset a07da09ad5bd7d234ccd084a3a0933c290d1b592 by Raymond Hettinger in branch 'master': bpo-43475: Fix worst case collision behavior for NaN instances (GH-25493) https://github.com/python/cpython/commit/a07da09ad5bd7d234ccd084a3a0933c290d1b592 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 11:35:40 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 22 Apr 2021 15:35:40 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1619105740.56.0.981099504207.issue43475@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 11:40:22 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 22 Apr 2021 15:40:22 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1619106022.92.0.0515808908533.issue43475@roundup.psfhosted.org> Mark Dickinson added the comment: Thanks, Raymond. I'll open something on the NumPy bug tracker, too, since they may want to consider doing something similar for numpy.float64 and friends. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 11:57:30 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 22 Apr 2021 15:57:30 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1619107050.72.0.654557890949.issue43475@roundup.psfhosted.org> Mark Dickinson added the comment: Opened https://github.com/numpy/numpy/issues/18833 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 11:59:23 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 22 Apr 2021 15:59:23 +0000 Subject: [issue43804] Add more info about building C/C++ Extensions on Windows using MSVC In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1619107163.25.0.930078273048.issue43804@roundup.psfhosted.org> Shreyan Avigyan added the comment: Ping ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 12:09:05 2021 From: report at bugs.python.org (Zachary Ware) Date: Thu, 22 Apr 2021 16:09:05 +0000 Subject: [issue43804] Add more info about building C/C++ Extensions on Windows using MSVC In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1619107745.88.0.673557451225.issue43804@roundup.psfhosted.org> Zachary Ware added the comment: Please have some patience. Constant requests for review or pings are frankly quite annoying. Everyone on this project is a volunteer, and as such things only get done when someone has the time and inclination to do them. If your issue/PR has sat idle for a month or so, then it may be time to consider a ping, but a ping every two days will quickly come to be seen as spam and ignored. ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 12:14:09 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 22 Apr 2021 16:14:09 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619108049.19.0.243022056013.issue43892@roundup.psfhosted.org> Batuhan Taskaya added the comment: > | MatchStar(identifier? target) +1 on MatchStar(). Much more similiar to the existing node names, and also less semantically-named. > attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset) I'm not really sure whether we should continue following this old tradition of int? end_* attributes for new sum types like pattern, considering that it was done for supporting the creation of old nodes 3.8< without any change on 3.8>=. pattern subclasses will only be created on 3.10>= so we should be safe by requiring end_* attributes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 12:28:51 2021 From: report at bugs.python.org (Zachary Ware) Date: Thu, 22 Apr 2021 16:28:51 +0000 Subject: [issue43804] "Building C and C++ Extensions on Windows" docs are very out-of-date In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1619108931.79.0.271948539938.issue43804@roundup.psfhosted.org> Change by Zachary Ware : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden stage: patch review -> needs patch title: Add more info about building C/C++ Extensions on Windows using MSVC -> "Building C and C++ Extensions on Windows" docs are very out-of-date versions: +Python 3.11 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 12:43:56 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 16:43:56 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1619109836.74.0.0148556188331.issue43284@roundup.psfhosted.org> Steve Dower added the comment: New changeset 2a3f4899c63806439e5bcea0c30f7e6a6295a763 by Shreyan Avigyan in branch 'master': bpo-43284: Update platform.win32_ver to use _syscmd_ver instead of sys.getwindowsversion() (GH-25500) https://github.com/python/cpython/commit/2a3f4899c63806439e5bcea0c30f7e6a6295a763 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 12:44:15 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 16:44:15 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1619109855.8.0.698062893544.issue43284@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +24243 pull_request: https://github.com/python/cpython/pull/25523 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 12:44:22 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 16:44:22 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1619109862.02.0.931319121891.issue43284@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24244 pull_request: https://github.com/python/cpython/pull/25524 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 12:45:39 2021 From: report at bugs.python.org (Alex Mijalis) Date: Thu, 22 Apr 2021 16:45:39 +0000 Subject: [issue17681] Work with an extra field of gzip and zip files In-Reply-To: <1365519781.38.0.309194725625.issue17681@psf.upfronthosting.co.za> Message-ID: <1619109939.62.0.304865771652.issue17681@roundup.psfhosted.org> Alex Mijalis added the comment: Agreed, it would be really nice to integrate these changes. These special fields are found in gzipped .bam files, a common DNA sequence alignment format used in the bioinformatics community. It would be nice to be able to read and write them with the standard library. ---------- nosy: +amijalis _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 12:47:28 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 16:47:28 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1619110048.31.0.632465073773.issue43284@roundup.psfhosted.org> Steve Dower added the comment: Thanks for doing the patch! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 12:51:56 2021 From: report at bugs.python.org (Felix C. Stegerman) Date: Thu, 22 Apr 2021 16:51:56 +0000 Subject: [issue29708] support reproducible Python builds In-Reply-To: <1488540966.18.0.904677570473.issue29708@psf.upfronthosting.co.za> Message-ID: <1619110316.82.0.775438278462.issue29708@roundup.psfhosted.org> Change by Felix C. Stegerman : ---------- nosy: +obfusk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 12:53:15 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 22 Apr 2021 16:53:15 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619110395.22.0.463471648001.issue43911@roundup.psfhosted.org> Raymond Hettinger added the comment: This may be a memory fragmentation problem and likely doesn't have anything to do with Queue instances. As an experiment, try using queue.PriorityQueue and queue.LifoQueue to see if the issue persists. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 12:54:47 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 16:54:47 +0000 Subject: [issue43804] "Building C and C++ Extensions on Windows" docs are very out-of-date In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1619110487.07.0.327997831055.issue43804@roundup.psfhosted.org> Steve Dower added the comment: I agree with Zach's comment on the PR - this topic needs an overhaul. All the information required is going to be out there somewhere, and those of us on this issue can help fill in any gaps, but someone will need to spend a bit of time on research and laying it out nicely. This is a great contribution opportunity for someone who would rather contribute writing and research rather than just code. However, it is a tough area, and so any improvements will be pretty well scrutinised. Good docs here will be very impactful throughout the community, so let's make sure they're good. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 13:01:17 2021 From: report at bugs.python.org (Felix C. Stegerman) Date: Thu, 22 Apr 2021 17:01:17 +0000 Subject: [issue29708] support reproducible Python builds In-Reply-To: <1488540966.18.0.904677570473.issue29708@psf.upfronthosting.co.za> Message-ID: <1619110877.46.0.609100153436.issue29708@roundup.psfhosted.org> Felix C. Stegerman added the comment: Hi! I've been working on reproducible builds for python-for-android [1,2,3]. Current issues with .pyc files are: * .pyc files differ depending on whether Python was compiled w/ liblzma-dev installed or not; * many .pyc files include build paths; * some .pyc files include paths to system utilities, like `/bin/mkdir` or `/usr/bin/install`, which can differ between systems (e.g. on Debian w/ merged /usr). [1] https://github.com/kivy/python-for-android/pull/2390 [2] https://lists.reproducible-builds.org/pipermail/rb-general/2021-January/002132.html [3] https://lists.reproducible-builds.org/pipermail/rb-general/2021-March/002207.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 13:03:44 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 17:03:44 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1619111024.82.0.480935481289.issue43284@roundup.psfhosted.org> miss-islington added the comment: New changeset ef63328b46fe7402794cde51008a47e79f37b153 by Miss Islington (bot) in branch '3.8': bpo-43284: Update platform.win32_ver to use _syscmd_ver instead of sys.getwindowsversion() (GH-25500) https://github.com/python/cpython/commit/ef63328b46fe7402794cde51008a47e79f37b153 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 13:19:38 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 22 Apr 2021 17:19:38 +0000 Subject: [issue43804] "Building C and C++ Extensions on Windows" docs are very out-of-date In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1619111978.74.0.268730582801.issue43804@roundup.psfhosted.org> Shreyan Avigyan added the comment: Both https://docs.python.org/3/extending/windows.html#building-on-windows and https://docs.python.org/3/extending/building.html recommends using distutils. As mentioned in PEP 632 distutils will soon be deprecated. I think it'll be a good idea to change the docs to recommend using setuptools and also change the source code for setup.py to use setuptools instead of distutils. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 13:30:03 2021 From: report at bugs.python.org (Ryan Tarpine) Date: Thu, 22 Apr 2021 17:30:03 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined Message-ID: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> New submission from Ryan Tarpine : Functions registered with unittest.addModuleCleanup are not called unless the user defines tearDownModule in their test module. This behavior is unexpected because functions registered with TestCase.addClassCleanup are called even the user doesn't define tearDownClass, and similarly with addCleanup/tearDown. The implementing code is basically the same for all 3 cases, the difference is that unittest.TestCase itself defines tearDown and tearDownClass; so even though doClassCleanups is only called if tearDownClass is defined, in practice it always is. doModuleCleanups should be called even if tearDownModule is not defined. ---------- components: Library (Lib) messages: 391619 nosy: rtarpine priority: normal severity: normal status: open title: unittest module cleanup functions not run unless tearDownModule() is defined type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 13:51:36 2021 From: report at bugs.python.org (Cebtenzzre) Date: Thu, 22 Apr 2021 17:51:36 +0000 Subject: [issue32596] Lazy import concurrent.futures.process and thread In-Reply-To: <1516359250.47.0.467229070634.issue32596@psf.upfronthosting.co.za> Message-ID: <1619113896.45.0.614352052629.issue32596@roundup.psfhosted.org> Change by Cebtenzzre : ---------- nosy: +cebtenzzre _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 14:08:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 22 Apr 2021 18:08:13 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1619114893.18.0.308605369236.issue43914@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 14:08:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 22 Apr 2021 18:08:10 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors Message-ID: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : To improve the user experience understanding what part of the error messages associated to SyntaxErrors are wrong, we can highlight the whole error range and not only place the caret at the first character. In this way: >>> foo(x, z for z in range(10), t, w) File "", line 1 foo(x, z for z in range(10), t, w) ^ SyntaxError: Generator expression must be parenthesized becomes >>> foo(x, z for z in range(10), t, w) File "", line 1 foo(x, z for z in range(10), t, w) ^^^^^^^^^^^^^^^^^^^^ SyntaxError: Generator expression must be parenthesized ---------- messages: 391620 nosy: pablogsal priority: normal severity: normal status: open title: Highlight invalid ranges in SyntaxErrors _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 14:08:24 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 22 Apr 2021 18:08:24 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1619114904.35.0.750566011805.issue43914@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +24245 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25525 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 14:10:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 22 Apr 2021 18:10:30 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1619115030.27.0.0283383783277.issue43914@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +lys.nikolaou stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 14:13:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 22 Apr 2021 18:13:31 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1619115211.9.0.370268558903.issue43914@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- components: +Parser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 14:44:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 22 Apr 2021 18:44:11 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619117051.27.0.671759526174.issue38659@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks Ammar for the fix. Unfortunately there is still some failures related to this on test_socker: ====================================================================== ERROR: test_msgflag_enum (test.test_socket.GeneralModuleTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-ppc64le.refleak/build/Lib/test/test_socket.py", line 1969, in test_msgflag_enum enum._test_simple_enum(CheckedMsgFlag, socket.MsgFlag) File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-ppc64le.refleak/build/Lib/enum.py", line 1664, in _test_simple_enum raise TypeError('enum mismatch:\n %s' % '\n '.join(failed)) TypeError: enum mismatch: 'MSG_TRUNC' member mismatch: extra key '_inverted_' in simple enum member 'MSG_TRUNC' 'MSG_CTRUNC' member mismatch: extra key '_inverted_' in simple enum member 'MSG_CTRUNC' ---------------------------------------------------------------------- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 14:46:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 22 Apr 2021 18:46:30 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619117190.43.0.182442608491.issue43892@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I'm not really sure whether we should continue following this old tradition of int? end_* attributes for new sum types like pattern, considering that it was done for supporting the creation of old nodes 3.8< without any change on 3.8>=. pattern subclasses will only be created on 3.10>= so we should be safe by requiring end_* attributes. Yeah, it will be a requirement very soon actually. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 15:02:29 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 19:02:29 +0000 Subject: [issue38822] [Windows] Inconsistent os.stat behavior for directory with Access Denied In-Reply-To: <1573928094.88.0.209131085868.issue38822@roundup.psfhosted.org> Message-ID: <1619118149.89.0.265709432589.issue38822@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +24246 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25527 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 15:04:40 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 19:04:40 +0000 Subject: [issue43915] Add PCbuild/blurb.bat Message-ID: <1619118280.75.0.975256494991.issue43915@roundup.psfhosted.org> New submission from Steve Dower : I'm sick of writing long commands to invoke blurb, so add a batch file to do it. ---------- assignee: steve.dower components: Build, Windows messages: 391623 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Add PCbuild/blurb.bat versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 15:05:29 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 19:05:29 +0000 Subject: [issue43915] Add PCbuild/blurb.bat In-Reply-To: <1619118280.75.0.975256494991.issue43915@roundup.psfhosted.org> Message-ID: <1619118329.58.0.923269731908.issue43915@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +24247 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25528 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 15:06:32 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 19:06:32 +0000 Subject: [issue43915] Add PCbuild/blurb.bat In-Reply-To: <1619118280.75.0.975256494991.issue43915@roundup.psfhosted.org> Message-ID: <1619118392.12.0.898197492747.issue43915@roundup.psfhosted.org> Steve Dower added the comment: Well, it's not so much the long command line, as having to remember which install of Python has blurb in it. This way, it's always the same one (and probably the copy that we installed into externals) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 15:41:27 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 19:41:27 +0000 Subject: [issue35306] [Windows] OSError when testing whether pathlib.Path('*') exists In-Reply-To: <1543038959.25.0.788709270274.issue35306@psf.upfronthosting.co.za> Message-ID: <1619120487.51.0.225565019122.issue35306@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +24248 pull_request: https://github.com/python/cpython/pull/25529 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 15:45:10 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 19:45:10 +0000 Subject: [issue38822] [Windows] Inconsistent os.stat behavior for directory with Access Denied In-Reply-To: <1573928094.88.0.209131085868.issue38822@roundup.psfhosted.org> Message-ID: <1619120710.41.0.397115124502.issue38822@roundup.psfhosted.org> Steve Dower added the comment: New changeset fe63a401a9b3ca1751b81b5d6ddb2beb7f3675c1 by Steve Dower in branch 'master': bpo-38822: Fixed os.stat failing on inaccessible directories. (GH-25527) https://github.com/python/cpython/commit/fe63a401a9b3ca1751b81b5d6ddb2beb7f3675c1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 15:45:13 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 19:45:13 +0000 Subject: [issue38822] [Windows] Inconsistent os.stat behavior for directory with Access Denied In-Reply-To: <1573928094.88.0.209131085868.issue38822@roundup.psfhosted.org> Message-ID: <1619120713.69.0.503220556446.issue38822@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +24249 pull_request: https://github.com/python/cpython/pull/25530 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 15:45:20 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 19:45:20 +0000 Subject: [issue38822] [Windows] Inconsistent os.stat behavior for directory with Access Denied In-Reply-To: <1573928094.88.0.209131085868.issue38822@roundup.psfhosted.org> Message-ID: <1619120720.87.0.97249284064.issue38822@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24250 pull_request: https://github.com/python/cpython/pull/25531 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 15:45:54 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 19:45:54 +0000 Subject: [issue43915] Add PCbuild/blurb.bat In-Reply-To: <1619118280.75.0.975256494991.issue43915@roundup.psfhosted.org> Message-ID: <1619120754.87.0.220185578116.issue43915@roundup.psfhosted.org> Steve Dower added the comment: New changeset a911bd15a19824c92af8e90b63af4a84a9670222 by Steve Dower in branch 'master': bpo-43915: Add PCbuild/blurb.bat to simplify Windows contributors (GH-25528) https://github.com/python/cpython/commit/a911bd15a19824c92af8e90b63af4a84a9670222 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 15:46:21 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 19:46:21 +0000 Subject: [issue43915] Add PCbuild/blurb.bat In-Reply-To: <1619118280.75.0.975256494991.issue43915@roundup.psfhosted.org> Message-ID: <1619120781.53.0.339466766554.issue43915@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 15:48:08 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 19:48:08 +0000 Subject: [issue38822] [Windows] Inconsistent os.stat behavior for directory with Access Denied In-Reply-To: <1573928094.88.0.209131085868.issue38822@roundup.psfhosted.org> Message-ID: <1619120888.5.0.13387629802.issue38822@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 15:59:34 2021 From: report at bugs.python.org (Pete Wicken) Date: Thu, 22 Apr 2021 19:59:34 +0000 Subject: [issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32 In-Reply-To: <1477983724.8.0.857875109595.issue28577@psf.upfronthosting.co.za> Message-ID: <1619121574.09.0.606513666985.issue28577@roundup.psfhosted.org> Change by Pete Wicken : ---------- pull_requests: +24251 pull_request: https://github.com/python/cpython/pull/25532 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 16:01:51 2021 From: report at bugs.python.org (Pete Wicken) Date: Thu, 22 Apr 2021 20:01:51 +0000 Subject: [issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32 In-Reply-To: <1477983724.8.0.857875109595.issue28577@psf.upfronthosting.co.za> Message-ID: <1619121711.16.0.423938157389.issue28577@roundup.psfhosted.org> Change by Pete Wicken : ---------- pull_requests: +24252 pull_request: https://github.com/python/cpython/pull/25533 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 16:04:47 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 20:04:47 +0000 Subject: [issue35306] [Windows] OSError when testing whether pathlib.Path('*') exists In-Reply-To: <1543038959.25.0.788709270274.issue35306@psf.upfronthosting.co.za> Message-ID: <1619121887.6.0.288488530981.issue35306@roundup.psfhosted.org> Steve Dower added the comment: New changeset 4696f1285d83dd7b69f459c63e14080b1f87f797 by Steve Dower in branch 'master': bpo-35306: Avoid raising OSError from pathlib.Path.exists when passed an invalid filename (GH-25529) https://github.com/python/cpython/commit/4696f1285d83dd7b69f459c63e14080b1f87f797 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 16:04:54 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 20:04:54 +0000 Subject: [issue35306] [Windows] OSError when testing whether pathlib.Path('*') exists In-Reply-To: <1543038959.25.0.788709270274.issue35306@psf.upfronthosting.co.za> Message-ID: <1619121894.74.0.232261314986.issue35306@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +24253 pull_request: https://github.com/python/cpython/pull/25534 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 16:05:01 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 20:05:01 +0000 Subject: [issue35306] [Windows] OSError when testing whether pathlib.Path('*') exists In-Reply-To: <1543038959.25.0.788709270274.issue35306@psf.upfronthosting.co.za> Message-ID: <1619121901.99.0.104245680033.issue35306@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24254 pull_request: https://github.com/python/cpython/pull/25535 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 16:05:06 2021 From: report at bugs.python.org (Pete Wicken) Date: Thu, 22 Apr 2021 20:05:06 +0000 Subject: [issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32 In-Reply-To: <1477983724.8.0.857875109595.issue28577@psf.upfronthosting.co.za> Message-ID: <1619121906.73.0.457865305661.issue28577@roundup.psfhosted.org> Change by Pete Wicken : ---------- pull_requests: +24255 pull_request: https://github.com/python/cpython/pull/25536 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 16:07:09 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 20:07:09 +0000 Subject: [issue38822] [Windows] Inconsistent os.stat behavior for directory with Access Denied In-Reply-To: <1573928094.88.0.209131085868.issue38822@roundup.psfhosted.org> Message-ID: <1619122029.2.0.543803181926.issue38822@roundup.psfhosted.org> miss-islington added the comment: New changeset 400bd9a3858ea28ea264682b7f050c69638b1ff1 by Miss Islington (bot) in branch '3.8': bpo-38822: Fixed os.stat failing on inaccessible directories. (GH-25527) https://github.com/python/cpython/commit/400bd9a3858ea28ea264682b7f050c69638b1ff1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 16:10:04 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 20:10:04 +0000 Subject: [issue38822] [Windows] Inconsistent os.stat behavior for directory with Access Denied In-Reply-To: <1573928094.88.0.209131085868.issue38822@roundup.psfhosted.org> Message-ID: <1619122204.57.0.0493878492754.issue38822@roundup.psfhosted.org> miss-islington added the comment: New changeset 8e7cebb497e6004715a5475f6b53d8ef9d30a9fa by Miss Islington (bot) in branch '3.9': bpo-38822: Fixed os.stat failing on inaccessible directories. (GH-25527) https://github.com/python/cpython/commit/8e7cebb497e6004715a5475f6b53d8ef9d30a9fa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 16:12:38 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 20:12:38 +0000 Subject: [issue35306] [Windows] OSError when testing whether pathlib.Path('*') exists In-Reply-To: <1543038959.25.0.788709270274.issue35306@psf.upfronthosting.co.za> Message-ID: <1619122358.89.0.261148187941.issue35306@roundup.psfhosted.org> Change by Steve Dower : ---------- assignee: -> steve.dower resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 16:25:17 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 20:25:17 +0000 Subject: [issue35306] [Windows] OSError when testing whether pathlib.Path('*') exists In-Reply-To: <1543038959.25.0.788709270274.issue35306@psf.upfronthosting.co.za> Message-ID: <1619123117.15.0.286027028265.issue35306@roundup.psfhosted.org> miss-islington added the comment: New changeset 1575ea01059b3ba836cdb62f01f0b6584d7756a7 by Miss Islington (bot) in branch '3.8': bpo-35306: Avoid raising OSError from pathlib.Path.exists when passed an invalid filename (GH-25529) https://github.com/python/cpython/commit/1575ea01059b3ba836cdb62f01f0b6584d7756a7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 16:30:43 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 20:30:43 +0000 Subject: [issue35306] [Windows] OSError when testing whether pathlib.Path('*') exists In-Reply-To: <1543038959.25.0.788709270274.issue35306@psf.upfronthosting.co.za> Message-ID: <1619123443.38.0.167979459545.issue35306@roundup.psfhosted.org> miss-islington added the comment: New changeset ab5d78ce4141a6b3cd55588cdbe3cd3bd5242d5b by Miss Islington (bot) in branch '3.9': bpo-35306: Avoid raising OSError from pathlib.Path.exists when passed an invalid filename (GH-25529) https://github.com/python/cpython/commit/ab5d78ce4141a6b3cd55588cdbe3cd3bd5242d5b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 16:30:44 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 22 Apr 2021 20:30:44 +0000 Subject: [issue38822] [Windows] Inconsistent os.stat behavior for directory with Access Denied In-Reply-To: <1573928094.88.0.209131085868.issue38822@roundup.psfhosted.org> Message-ID: <1619123444.88.0.871167645589.issue38822@roundup.psfhosted.org> Eryk Sun added the comment: Steve, your PR checks `filename[n] == L':'`. I think it should check for a drive name, i.e. `n == 1 && filename[1] == L':'`. For example, the VirtualBox shared-folder filesystem allows creating and accessing filenames that contain and end with colons (e.g. "spam:" or even "./X:"), and such names can be queried with FindFirstFileW(). As long as a filename can be queried, I think it should be supported by attributes_from_dir(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 16:33:09 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 22 Apr 2021 20:33:09 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1619123589.63.0.0903268272321.issue38820@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24256 pull_request: https://github.com/python/cpython/pull/25537 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 16:51:44 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 20:51:44 +0000 Subject: [issue35306] [Windows] OSError when testing whether pathlib.Path('*') exists In-Reply-To: <1543038959.25.0.788709270274.issue35306@psf.upfronthosting.co.za> Message-ID: <1619124704.83.0.595503615579.issue35306@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +24257 pull_request: https://github.com/python/cpython/pull/25538 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 16:52:50 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 20:52:50 +0000 Subject: [issue43538] [Windows] support args and cwd in os.startfile() In-Reply-To: <1616052233.51.0.171946221972.issue43538@roundup.psfhosted.org> Message-ID: <1619124770.55.0.730490929975.issue43538@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +24258 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25538 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 16:53:11 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 20:53:11 +0000 Subject: [issue35306] [Windows] OSError when testing whether pathlib.Path('*') exists In-Reply-To: <1543038959.25.0.788709270274.issue35306@psf.upfronthosting.co.za> Message-ID: <1619124791.4.0.281846895065.issue35306@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: -24257 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 16:56:44 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 20:56:44 +0000 Subject: [issue43538] [Windows] support args and cwd in os.startfile() In-Reply-To: <1616052233.51.0.171946221972.issue43538@roundup.psfhosted.org> Message-ID: <1619125004.62.0.00376105396593.issue43538@roundup.psfhosted.org> Steve Dower added the comment: Not rushing this one in, but this is a relatively straightforward addition that will definitely be handy in some situations. I didn't bother adding an enum for the SW_* constants, since I don't think they'll get anywhere near enough use to justify being in our public API. Kind of like error codes, which we already don't expose everywhere even though we use them ourselves as raw numbers. ---------- assignee: -> steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 17:31:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 22 Apr 2021 21:31:59 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised Message-ID: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : I'm creating this issue and marking it as a deferred blocker to make sure we don't forget to check this (adding tests) before the release. Check this message from Serhiy regarding heap typed concerns: https://bugs.python.org/msg391598 ---------- messages: 391634 nosy: pablogsal, serhiy.storchaka, vstinner priority: deferred blocker severity: normal status: open title: Check that new heap types cannot be created uninitialised type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 17:32:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 22 Apr 2021 21:32:34 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619127154.38.0.604206826872.issue43916@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Serhiy's comment for reference: Static type with tp_new = NULL does not have public constructor, but heap type inherits constructor from base class. As result, it allows to create instances without proper initialization, that can lead to crash. It was fixed for few standard heap types in issue23815, then reintroduced, then fixed again in issue42694. But it should be checked for every type without constructor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 17:40:51 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 21:40:51 +0000 Subject: [issue43607] urllib's request.pathname2url not compatible with extended-length Windows file paths In-Reply-To: <1616540209.08.0.34606490658.issue43607@roundup.psfhosted.org> Message-ID: <1619127651.61.0.52649344984.issue43607@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +24259 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25539 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 17:43:33 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 21:43:33 +0000 Subject: [issue43607] urllib's request.pathname2url not compatible with extended-length Windows file paths In-Reply-To: <1616540209.08.0.34606490658.issue43607@roundup.psfhosted.org> Message-ID: <1619127813.72.0.0802194730761.issue43607@roundup.psfhosted.org> Change by Steve Dower : ---------- assignee: -> steve.dower versions: +Python 3.10, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 18:18:58 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 22 Apr 2021 22:18:58 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619129938.52.0.0288163154336.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Victor, I've updated PR 25520 so PyType_Ready always sets Py_TPFLAGS_IMMUTABLE for static types. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 18:20:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 22 Apr 2021 22:20:29 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1619130029.58.0.399982884174.issue25782@roundup.psfhosted.org> Irit Katriel added the comment: I agree with Chris that the issue of not hanging is independent of the question what to do about the cycle. The ExitStack issue that brought this issue about is now fixed in ExitStack (see issue25786, issue27122). If we take a step back from that, the situation is this: SetObject's cycle detection loop is intended to prevent the creation of new cycles when adding a new context link. It hangs when the exception chain has a pre-existing cycle. That pre-existing cycle is arguably a bug, and I'm not sure it's SetObject's job to do anything about it. So I would suggest to: (1) Make it not hang, ASAP because this is a bug in SetObject. (2) Leave the cycle alone. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 18:38:31 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 22:38:31 +0000 Subject: [issue38222] pathlib Path objects should support __format__ In-Reply-To: <1568872865.53.0.090540874839.issue38222@roundup.psfhosted.org> Message-ID: <1619131111.4.0.745043326334.issue38222@roundup.psfhosted.org> Change by Steve Dower : ---------- nosy: +steve.dower nosy_count: 5.0 -> 6.0 pull_requests: +24260 pull_request: https://github.com/python/cpython/pull/25540 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 18:39:17 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 22:39:17 +0000 Subject: [issue38822] [Windows] Inconsistent os.stat behavior for directory with Access Denied In-Reply-To: <1573928094.88.0.209131085868.issue38822@roundup.psfhosted.org> Message-ID: <1619131157.44.0.894101429807.issue38822@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +24261 pull_request: https://github.com/python/cpython/pull/25540 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 18:39:38 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 22:39:38 +0000 Subject: [issue38222] pathlib Path objects should support __format__ In-Reply-To: <1568872865.53.0.090540874839.issue38222@roundup.psfhosted.org> Message-ID: <1619131178.74.0.338843901025.issue38222@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: -24260 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 18:46:38 2021 From: report at bugs.python.org (Egor) Date: Thu, 22 Apr 2021 22:46:38 +0000 Subject: [issue43917] An error in classmethod example in the documentation of descriptor Message-ID: <1619131598.14.0.103943523706.issue43917@roundup.psfhosted.org> New submission from Egor : In this section https://docs.python.org/3/howto/descriptor.html#class-methods in the example of python implementation of ClassMethod inside __get__ method I think that we should check hasattr(self.f, "__get__") instead of hasattr(obj, "__get__"). ---------- assignee: docs at python components: Documentation messages: 391638 nosy: docs at python, rhettinger, titanolodon priority: normal severity: normal status: open title: An error in classmethod example in the documentation of descriptor versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 19:01:12 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 22 Apr 2021 23:01:12 +0000 Subject: [issue43917] An error in classmethod example in the documentation of descriptor In-Reply-To: <1619131598.14.0.103943523706.issue43917@roundup.psfhosted.org> Message-ID: <1619132472.49.0.819536536087.issue43917@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 19:03:18 2021 From: report at bugs.python.org (Roundup Robot) Date: Thu, 22 Apr 2021 23:03:18 +0000 Subject: [issue43917] An error in classmethod example in the documentation of descriptor In-Reply-To: <1619131598.14.0.103943523706.issue43917@roundup.psfhosted.org> Message-ID: <1619132598.64.0.830061533741.issue43917@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 3.0 -> 4.0 pull_requests: +24262 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25541 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 19:20:24 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 22 Apr 2021 23:20:24 +0000 Subject: [issue43917] An error in classmethod example in the documentation of descriptor In-Reply-To: <1619131598.14.0.103943523706.issue43917@roundup.psfhosted.org> Message-ID: <1619133624.76.0.566623975454.issue43917@roundup.psfhosted.org> Raymond Hettinger added the comment: It looks like it should be: if hasattr(type(self.f), "__get__"): Here's the relevant C code: static PyObject * cm_descr_get(PyObject *self, PyObject *obj, PyObject *type) { classmethod *cm = (classmethod *)self; if (cm->cm_callable == NULL) { PyErr_SetString(PyExc_RuntimeError, "uninitialized classmethod object"); return NULL; } if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); if (Py_TYPE(cm->cm_callable)->tp_descr_get != NULL) { return Py_TYPE(cm->cm_callable)->tp_descr_get(cm->cm_callable, type, NULL); } return PyMethod_New(cm->cm_callable, type); } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 19:29:02 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 22 Apr 2021 23:29:02 +0000 Subject: [issue18744] doc: pathological performance using tarfile In-Reply-To: <1376544025.63.0.959353089302.issue18744@psf.upfronthosting.co.za> Message-ID: <1619134142.63.0.485129150458.issue18744@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy title: pathological performance using tarfile -> doc: pathological performance using tarfile versions: +Python 3.11 -Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 19:30:47 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 23:30:47 +0000 Subject: [issue38222] pathlib Path objects should support __format__ In-Reply-To: <1568872865.53.0.090540874839.issue38222@roundup.psfhosted.org> Message-ID: <1619134247.93.0.519145792103.issue38222@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24263 pull_request: https://github.com/python/cpython/pull/25542 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 19:30:45 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 23:30:45 +0000 Subject: [issue38222] pathlib Path objects should support __format__ In-Reply-To: <1568872865.53.0.090540874839.issue38222@roundup.psfhosted.org> Message-ID: <1619134245.22.0.671294145637.issue38222@roundup.psfhosted.org> Steve Dower added the comment: New changeset e07d8098892e85ecc56969d2c9a5afb3ea33ce8f by Steve Dower in branch 'master': bpo-38222: Check specifically for a drive, not just a colon (GH-25540) https://github.com/python/cpython/commit/e07d8098892e85ecc56969d2c9a5afb3ea33ce8f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 19:30:55 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 23:30:55 +0000 Subject: [issue38222] pathlib Path objects should support __format__ In-Reply-To: <1568872865.53.0.090540874839.issue38222@roundup.psfhosted.org> Message-ID: <1619134255.09.0.554897986846.issue38222@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24264 pull_request: https://github.com/python/cpython/pull/25543 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 19:34:17 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 23:34:17 +0000 Subject: [issue38822] [Windows] Inconsistent os.stat behavior for directory with Access Denied In-Reply-To: <1573928094.88.0.209131085868.issue38822@roundup.psfhosted.org> Message-ID: <1619134457.3.0.484179066474.issue38822@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24265 pull_request: https://github.com/python/cpython/pull/25543 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 19:34:25 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 23:34:25 +0000 Subject: [issue38822] [Windows] Inconsistent os.stat behavior for directory with Access Denied In-Reply-To: <1573928094.88.0.209131085868.issue38822@roundup.psfhosted.org> Message-ID: <1619134465.19.0.480011991194.issue38822@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24266 pull_request: https://github.com/python/cpython/pull/25542 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 19:35:17 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 23:35:17 +0000 Subject: [issue38222] pathlib Path objects should support __format__ In-Reply-To: <1568872865.53.0.090540874839.issue38222@roundup.psfhosted.org> Message-ID: <1619134517.82.0.883629743421.issue38222@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: -24263 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 19:35:18 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 23:35:18 +0000 Subject: [issue38222] pathlib Path objects should support __format__ In-Reply-To: <1568872865.53.0.090540874839.issue38222@roundup.psfhosted.org> Message-ID: <1619134518.68.0.397285805487.issue38222@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: -24264 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 19:36:31 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Apr 2021 23:36:31 +0000 Subject: [issue38222] pathlib Path objects should support __format__ In-Reply-To: <1568872865.53.0.090540874839.issue38222@roundup.psfhosted.org> Message-ID: <1619134591.49.0.533559180858.issue38222@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24267 pull_request: https://github.com/python/cpython/pull/25542 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 19:37:10 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 22 Apr 2021 23:37:10 +0000 Subject: [issue21352] improve documentation indexing In-Reply-To: <1398457661.12.0.679738685491.issue21352@psf.upfronthosting.co.za> Message-ID: <1619134630.19.0.2215984488.issue21352@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 19:37:42 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 22 Apr 2021 23:37:42 +0000 Subject: [issue43917] An error in classmethod example in the documentation of descriptor In-Reply-To: <1619131598.14.0.103943523706.issue43917@roundup.psfhosted.org> Message-ID: <1619134662.92.0.942284499794.issue43917@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +24268 pull_request: https://github.com/python/cpython/pull/25544 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 19:48:50 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 23:48:50 +0000 Subject: [issue38822] [Windows] Inconsistent os.stat behavior for directory with Access Denied In-Reply-To: <1573928094.88.0.209131085868.issue38822@roundup.psfhosted.org> Message-ID: <1619135330.44.0.176912075537.issue38822@roundup.psfhosted.org> Steve Dower added the comment: New changeset 9f0b3a9c8eedf694377d8638365fb9f385daa581 by Miss Islington (bot) in branch '3.8': bpo-38822: Check specifically for a drive, not just a colon (GH-25540) https://github.com/python/cpython/commit/9f0b3a9c8eedf694377d8638365fb9f385daa581 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 19:56:52 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 22 Apr 2021 23:56:52 +0000 Subject: [issue38822] [Windows] Inconsistent os.stat behavior for directory with Access Denied In-Reply-To: <1573928094.88.0.209131085868.issue38822@roundup.psfhosted.org> Message-ID: <1619135812.5.0.83570618145.issue38822@roundup.psfhosted.org> Steve Dower added the comment: New changeset 28575923a9ee40928a9d00a7ed997a6f6a09b8d1 by Miss Islington (bot) in branch '3.9': bpo-38822: Check specifically for a drive, not just a colon (GH-25540) https://github.com/python/cpython/commit/28575923a9ee40928a9d00a7ed997a6f6a09b8d1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 20:35:39 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Apr 2021 00:35:39 +0000 Subject: [issue39572] [typing] TypedDict's 'total' argument is undocumented In-Reply-To: <1581019680.46.0.628292741765.issue39572@roundup.psfhosted.org> Message-ID: <1619138139.48.0.303034806041.issue39572@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24269 pull_request: https://github.com/python/cpython/pull/25545 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 20:35:30 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Apr 2021 00:35:30 +0000 Subject: [issue39572] [typing] TypedDict's 'total' argument is undocumented In-Reply-To: <1581019680.46.0.628292741765.issue39572@roundup.psfhosted.org> Message-ID: <1619138130.13.0.644156589848.issue39572@roundup.psfhosted.org> miss-islington added the comment: New changeset 6afb0a8078ff3fc93adc4177565c56f820ca2880 by Simon Charette in branch 'master': bpo-39572: Address typo in CHANGELOG. (GH-24999) https://github.com/python/cpython/commit/6afb0a8078ff3fc93adc4177565c56f820ca2880 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 20:53:44 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 23 Apr 2021 00:53:44 +0000 Subject: [issue43917] An error in classmethod example in the documentation of descriptor In-Reply-To: <1619131598.14.0.103943523706.issue43917@roundup.psfhosted.org> Message-ID: <1619139224.1.0.383574902904.issue43917@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 14092b5a4ae4caf1c77f685450016a0d1ad0bd6c by Raymond Hettinger in branch 'master': bpo-43917: Fix pure python equivalent for classmethod (GH-25544) https://github.com/python/cpython/commit/14092b5a4ae4caf1c77f685450016a0d1ad0bd6c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 20:53:45 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Apr 2021 00:53:45 +0000 Subject: [issue43917] An error in classmethod example in the documentation of descriptor In-Reply-To: <1619131598.14.0.103943523706.issue43917@roundup.psfhosted.org> Message-ID: <1619139225.14.0.0659321636806.issue43917@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24270 pull_request: https://github.com/python/cpython/pull/25546 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 20:58:50 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Apr 2021 00:58:50 +0000 Subject: [issue39572] [typing] TypedDict's 'total' argument is undocumented In-Reply-To: <1581019680.46.0.628292741765.issue39572@roundup.psfhosted.org> Message-ID: <1619139530.03.0.473753148933.issue39572@roundup.psfhosted.org> miss-islington added the comment: New changeset bc5a1a7adf0d0154cb3f247da84146dd51997540 by Miss Islington (bot) in branch '3.9': bpo-39572: Address typo in CHANGELOG. (GH-24999) https://github.com/python/cpython/commit/bc5a1a7adf0d0154cb3f247da84146dd51997540 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 21:16:23 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 23 Apr 2021 01:16:23 +0000 Subject: [issue43917] An error in classmethod example in the documentation of descriptor In-Reply-To: <1619131598.14.0.103943523706.issue43917@roundup.psfhosted.org> Message-ID: <1619140583.69.0.264786928943.issue43917@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 34be48450f03b121be10a9f8e8989603478f0469 by Miss Islington (bot) in branch '3.9': bpo-43917: Fix pure python equivalent for classmethod (GH-25544) (GH-25546) https://github.com/python/cpython/commit/34be48450f03b121be10a9f8e8989603478f0469 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 21:17:06 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 23 Apr 2021 01:17:06 +0000 Subject: [issue43917] An error in classmethod example in the documentation of descriptor In-Reply-To: <1619131598.14.0.103943523706.issue43917@roundup.psfhosted.org> Message-ID: <1619140626.56.0.733727643284.issue43917@roundup.psfhosted.org> Raymond Hettinger added the comment: Okay, it's fixed. Thanks for the report. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 21:37:32 2021 From: report at bugs.python.org (akdor1154) Date: Fri, 23 Apr 2021 01:37:32 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1619141852.47.0.450343139284.issue37751@roundup.psfhosted.org> akdor1154 added the comment: If I understand the target of this issue, this is a breaking change in python 3.9 . E.g. see https://github.com/SAP/PyHDB/issues/149 Ideally if we did not intend to break libraries then can this be fixed? Or if it is acceptable to have such a breaking change, can it be documented as such? (maybe this is https://github.com/python/cpython/pull/23096 ? though I would not interpret that as a breaking change at first glance) ---------- nosy: +akdor1154 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 23:05:57 2021 From: report at bugs.python.org (Alexei Colin) Date: Fri, 23 Apr 2021 03:05:57 +0000 Subject: [issue43743] BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS. In-Reply-To: <1617697291.82.0.0904085621091.issue43743@roundup.psfhosted.org> Message-ID: <1619147157.83.0.799018898754.issue43743@roundup.psfhosted.org> Alexei Colin added the comment: Can confirm that this BlockingIOError happens on GPFS (alpine) on Summit supercomputer, tested with Python 3.8 and 3.10a7. I found that it happens only for file sizes above 65536. Minimal example: This filesize works: $ rm -f srcfile dstfile && truncate --size 65535 srcfile && python3.10 -c "import shutil; shutil.copyfile(b'srcfile', b'dstfile')" This file size (and larger) does not work: $ rm -f srcfile dstfile && truncate --size 65536 srcfile && python3.10 -c "import shutil; shutil.copyfile(b'srcfile', b'dstfile')" Traceback (most recent call last): File "", line 1, in File "/.../usr/lib/python3.10/shutil.py", line 265, in copyfile _fastcopy_sendfile(fsrc, fdst) File "/.../usr/lib/python3.10/shutil.py", line 162, in _fastcopy_sendfile raise err File "/.../usr/lib/python3.10/shutil.py", line 142, in _fastcopy_sendfile sent = os.sendfile(outfd, infd, offset, blocksize) BlockingIOError: [Errno 11] Resource temporarily unavailable: b'srcfile' -> b'dstfile' I tried patching shutil.py to retry the the call on this EAGAIN, but subsequent attempts fail with EAGAIN again indefinitely. I also use OP's workaround: set _USE_CP_SENDFILE = False in shutil.py ---------- nosy: +alexeicolin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 23:06:16 2021 From: report at bugs.python.org (Alexei Colin) Date: Fri, 23 Apr 2021 03:06:16 +0000 Subject: [issue43743] BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS. In-Reply-To: <1617697291.82.0.0904085621091.issue43743@roundup.psfhosted.org> Message-ID: <1619147176.81.0.794985865955.issue43743@roundup.psfhosted.org> Change by Alexei Colin : ---------- versions: +Python 3.10 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 23:06:34 2021 From: report at bugs.python.org (Alexei Colin) Date: Fri, 23 Apr 2021 03:06:34 +0000 Subject: [issue43743] BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS. In-Reply-To: <1617697291.82.0.0904085621091.issue43743@roundup.psfhosted.org> Message-ID: <1619147194.1.0.752293414643.issue43743@roundup.psfhosted.org> Change by Alexei Colin : ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 23:30:06 2021 From: report at bugs.python.org (Erik Welch) Date: Fri, 23 Apr 2021 03:30:06 +0000 Subject: [issue43918] anext builtin docstring has no signature text or info about default argument Message-ID: <1619148606.41.0.129428714687.issue43918@roundup.psfhosted.org> 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 signature as is typical for builtins. This means `help(anext)` in the Python REPL gives no indication how to call the function. It should. This is clearly an oversight. See comment here: https://github.com/python/cpython/pull/23847#commitcomment-45318696 Also, the "default" argument is not described in the docstring. Related issue: https://bugs.python.org/issue31861 (PR forthcoming) ---------- components: Interpreter Core messages: 391650 nosy: eriknw, pablogsal priority: normal severity: normal status: open title: anext builtin docstring has no signature text or info about default argument type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 22 23:41:05 2021 From: report at bugs.python.org (Erik Welch) Date: Fri, 23 Apr 2021 03:41:05 +0000 Subject: [issue43918] anext builtin docstring has no signature text or info about default argument In-Reply-To: <1619148606.41.0.129428714687.issue43918@roundup.psfhosted.org> Message-ID: <1619149265.64.0.57535667709.issue43918@roundup.psfhosted.org> Change by Erik Welch : ---------- keywords: +patch pull_requests: +24271 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25551 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 00:39:01 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Fri, 23 Apr 2021 04:39:01 +0000 Subject: [issue32891] Add 'Integer' as synonym for 'Integral' in numbers module. In-Reply-To: <1519191292.27.0.467229070634.issue32891@psf.upfronthosting.co.za> Message-ID: <1619152741.07.0.0538452020436.issue32891@roundup.psfhosted.org> Change by Sergey B Kirpichev : ---------- keywords: +patch pull_requests: +24272 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/25552 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 00:41:11 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 23 Apr 2021 04:41:11 +0000 Subject: [issue43877] Logging Cookbook ambiguity In-Reply-To: <1618622288.58.0.221543721652.issue43877@roundup.psfhosted.org> Message-ID: <1619152871.31.0.432095317643.issue43877@roundup.psfhosted.org> Raymond Hettinger added the comment: The queue isn't being used with a maxsize. ---------- nosy: -vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 00:55:39 2021 From: report at bugs.python.org (hai shi) Date: Fri, 23 Apr 2021 04:55:39 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1619153739.11.0.793898853286.issue37751@roundup.psfhosted.org> hai shi added the comment: >Ideally if we did not intend to break libraries then can this be fixed? Or if it is acceptable to have such a breaking change. Hi, akdor1154, thanks for your notice. It was a bugfix in fact:) https://bugs.python.org/issue37751#msg349448 > maybe this is https://github.com/python/cpython/pull/23096 ? though I would not interpret that as a breaking change at first glance @victor ping :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 01:47:33 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 23 Apr 2021 05:47:33 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1619156853.14.0.898620471079.issue37751@roundup.psfhosted.org> Inada Naoki added the comment: I think it is too late. Python 3.9 has been released already. Reverting the change is also breaking change. PEP 100 says: "Search functions are expected to take one argument, the encoding name in all lower case letters and with hyphens and spaces converted to underscores" https://www.python.org/dev/peps/pep-0100/#codecs-coder-decoders-lookup But codecs.register() says: "Search functions are expected to take one argument, being the encoding name in all lower case letters". I don't know historical reason why two document are inconsistent. https://docs.python.org/3/library/codecs.html#codecs.register ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 01:53:07 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 23 Apr 2021 05:53:07 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1619157187.36.0.954152076616.issue37751@roundup.psfhosted.org> Inada Naoki added the comment: codecs.register() was added in this commit. https://github.com/python/cpython/commit/e2d67f98d1aade1059b2ff3278672b2ffbaf180e And its docstring has been added in this commit. https://github.com/python/cpython/commit/0ae2981dec3de96a1f7d63b0535992cf1462ac92 Both commits doesn't describe why normalization was differ from PEP 100. ---------- nosy: +mark _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 02:03:48 2021 From: report at bugs.python.org (Jens) Date: Fri, 23 Apr 2021 06:03:48 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619157828.45.0.470366915459.issue43911@roundup.psfhosted.org> Jens added the comment: Hi, Thanks for your reply, so I've run same script with queue.PriorityQueue, queue.LifoQueue, queue.SimpleQueue, Asyncio.Queue as well as collections.dequeue 1. PriorityQueue >######### >del_after_puts False del_after_gets True n_puts 20000000 >before run >mem_pct 0.15% >------ put done ----- qsize 20000000 >mem_pct 37.49% >------ gets done ----- qsize 0 >mem_pct 0.16% >deleting queue after gets >mem_pct 0.16% 2. LifoQueue >######### >del_after_puts False del_after_gets True n_puts 20000000 >before run >mem_pct 0.15% >------ put done ----- qsize 20000000 >mem_pct 37.49% >------ gets done ----- qsize 0 >mem_pct 0.16% >deleting queue after gets >mem_pct 0.16% 3. SimpleQueue >######### >del_after_puts False del_after_gets True n_puts 20000000 >before run >mem_pct 0.15% >------ put done ----- qsize 20000000 >mem_pct 37.49% >------ gets done ----- qsize 0 >mem_pct 0.28% >deleting queue after gets <_queue.SimpleQueue object at 0x7f1da93d03b0> >mem_pct 0.28% 4. asyncio.Queue >######### >del_after_puts False del_after_gets True n_puts 20000000 >before run >mem_pct 0.23% >------ put done ----- qsize 20000000 >mem_pct 37.69% >------ gets done ----- qsize 0 >mem_pct 2.3% >deleting queue after gets >mem_pct 0.25% 5. collections.deque >######### >del_after_puts False del_after_gets True n_puts 20000000 >before run >mem_pct 0.15% >------ put done ----- qsize 20000000 >mem_pct 37.61% >------ gets done ----- qsize 0 >mem_pct 2.22% >deleting queue after gets deque([]) >mem_pct 0.16% So from the result it can be seen, that PriorityQueue and LifoQueue dont leak at all, and return to original memory after queues are emptied, so deleting the object reference has no effect. SimpleQueue seems to leak in the same way as Queue, but to a way lesser extent and deleting object does not return the memory. asyncio.Queue and collections.deque seem to leak to the same extent as Queue, but memory can be returned by deleting the object. As result, this got be to just trying to use Queue._put() and Queue._get() to populate the deque inside the Queue object and bypass all conditions/locks logic, which produces the following result: >######### >del_after_puts False del_after_gets True n_puts 20000000 >before run >mem_pct 0.15% >------ put done ----- qsize 20000000 >mem_pct 37.61% >------ gets done ----- qsize 0 >mem_pct 2.22% >deleting queue after gets >mem_pct 0.16% It can be seen that for a Queue where only _put() and _get() methods are used, the memory still leaks, but can be released by deleting the object reference. Perhaps that indicates a possible leak in the Condition class? I run a Queue with threads on my production applications that run for weeks straight, and the Queue leaks, and memory profiler always shows a leak at waiters_to_notify = _deque(_islice(all_waiters, n)) in Condition.notify() I dont want to make it more confusing by bringing it up here since it might be not the same kind of leak, because I dont simply populate up to 20million objects and then pop them out of the Queue in my application, but from the memory profiling results I see here this seems to be related. Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 02:16:25 2021 From: report at bugs.python.org (Jens) Date: Fri, 23 Apr 2021 06:16:25 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619158585.78.0.880961507684.issue43911@roundup.psfhosted.org> Jens added the comment: Just inspected the PriorityQueue and LifoQueue classes, they dont employ a deque at all but simply a list, but all other Queues tested do (except the native SimpleQueue). Since they don't leak, the leak itself seems to be coming from deque, and the fact that it does not get released after deletion only in a single case when Conditions are involved, makes me think the combination of two produces this unreleasable leak. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 02:26:56 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Fri, 23 Apr 2021 06:26:56 +0000 Subject: [issue43602] Include Decimal's in numbers.Real In-Reply-To: <1618803509.5.0.93952714102.issue43602@roundup.psfhosted.org> Message-ID: Sergey B Kirpichev added the comment: Well, probably everyone else agree with Raymond. Yet, I'll try to clarify few things. On Mon, Apr 19, 2021 at 03:38:29AM +0000, Raymond Hettinger wrote: > No strong use cases have emerged that would warrant overturning > the long-standing prior decisions on this topic. How about other multiprecision types in external libs, i.e. mpmath.mpf or gmpy2.mpfr? Probably, these shouldn't be Real's as well, isn't? In this way, the whole numbers tower above Rational class is more or less useless, as mentioned by Oscar: Real ABC is essentially reduced to float and Complex ABC - to complex... Raymond, I won't object your current decision for Decimal. But do you think - there is no documentation issues with the numbers module, related to Real/Complex? The module doesn't document, for example, that R1 + R2 is expected to work if R1 and R2 are both Reals (but different implementations). I'm not sure if this is a sane design decision (as this will restrict Real ABC just to float's), but if so - it must be documented. (comments are internal documentation, isn't?). It's not obvious. (The proof e.g. is that Decimal vs Real issue was questioned several times by different people.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 02:27:47 2021 From: report at bugs.python.org (edgj4718) Date: Fri, 23 Apr 2021 06:27:47 +0000 Subject: [issue43919] Potential bug in the "request" package. Message-ID: <1619159267.63.0.974142045431.issue43919@roundup.psfhosted.org> New submission from edgj4718 : Hello there, I am creating a client application with python. This application consists in extracting some data from an API and doing something with it. Anyway, I added a space in the end of the URL where I am supposed to have the data, and the API did not send any data as it probably the new URL with the added space was the issue. I think this is a bug and the URL should be checked from any possible empty strings, especially in the end and in the start of the URL. ---------- components: Extension Modules files: bug.PNG messages: 391658 nosy: edgj4718 priority: normal severity: normal status: open title: Potential bug in the "request" package. type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file49972/bug.PNG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 02:29:12 2021 From: report at bugs.python.org (Jens) Date: Fri, 23 Apr 2021 06:29:12 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619159352.53.0.0860423295937.issue43911@roundup.psfhosted.org> Jens added the comment: Results for queue._PySimpleQueue: >######### >del_after_puts False del_after_gets True n_puts 20000000 >before run >mem_pct 0.15% >------ put done ----- qsize 20000000 >mem_pct 37.61% >------ gets done ----- qsize 0 >mem_pct 2.22% >deleting queue after gets >mem_pct 2.22% The leak occurs and not getting released after deletion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 02:45:11 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 23 Apr 2021 06:45:11 +0000 Subject: [issue43919] Potential bug in the "request" package. In-Reply-To: <1619159267.63.0.974142045431.issue43919@roundup.psfhosted.org> Message-ID: <1619160311.13.0.926748420221.issue43919@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: The tracker is for issues related to CPython. requests is not part of stdlib so I am closing this as a third party issue. It seems this was already raised in requests repo https://github.com/psf/requests/issues/3017 . ---------- nosy: +xtreak resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 02:46:24 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 23 Apr 2021 06:46:24 +0000 Subject: [issue43856] Docs for importlib.metadata should mention Python version In-Reply-To: <1618502050.6.0.847154133714.issue43856@roundup.psfhosted.org> Message-ID: <1619160384.6.0.429185124009.issue43856@roundup.psfhosted.org> Inada Naoki added the comment: New changeset d4fff1f580aed5d26b9b501d0e626f50da9f7bb7 by Jason R. Coombs in branch '3.9': bpo-43856: Add a versionadded directive to the importlib.metadata docs (GH-25445) https://github.com/python/cpython/commit/d4fff1f580aed5d26b9b501d0e626f50da9f7bb7 ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 02:47:03 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 23 Apr 2021 06:47:03 +0000 Subject: [issue43856] Docs for importlib.metadata should mention Python version In-Reply-To: <1618502050.6.0.847154133714.issue43856@roundup.psfhosted.org> Message-ID: <1619160423.9.0.636557494508.issue43856@roundup.psfhosted.org> Inada Naoki added the comment: New changeset faad2bd87f9e1c24837dd772f0597f4ab9416c66 by Jason R. Coombs in branch '3.8': bpo-43856: Add a versionadded directive to the importlib.metadata docs (GH-25445) https://github.com/python/cpython/commit/faad2bd87f9e1c24837dd772f0597f4ab9416c66 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 03:36:40 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 23 Apr 2021 07:36:40 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619163400.78.0.271834283033.issue43911@roundup.psfhosted.org> Raymond Hettinger added the comment: For a large amount of data, a list uses a single large contiguous block of memory while a deque uses many small discontiguous blocks. In your demo, I that suspect that some of the memory pages for deque's blocks are also being used for other small bits of data. If any of the those small bits survive (either in active use or held for future use by the small memory allocator), then the page cannot be reclaimed. When memory fragments like this, it manifests as an increasing amount of process memory. Also, the interaction between the C library allocation functions and the O/S isn't under our control. Even when our code correctly calls PyMem_Free(), it isn't assured that total process memory goes goes back down. As an experiment, try to recreate the effect by building a list of lists: class Queue(list): def put(self, x): if not self or len(self[-1]) >= 66: self.append([]) self[-1].append(x) def get(self): if not self: raise IndexError block = self[0] x = block.pop(0) if not block: self.pop(0) return x ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 03:45:16 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 23 Apr 2021 07:45:16 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1619141852.47.0.450343139284.issue37751@roundup.psfhosted.org> Message-ID: Marc-Andre Lemburg added the comment: On 23.04.2021 03:37, akdor1154 wrote: > > akdor1154 added the comment: > > If I understand the target of this issue, this is a breaking change in python 3.9 . > > E.g. see https://github.com/SAP/PyHDB/issues/149 > > Ideally if we did not intend to break libraries then can this be fixed? > Or if it is acceptable to have such a breaking change, can it be documented as such? (maybe this is https://github.com/python/cpython/pull/23096 ? though I would not interpret that as a breaking change at first glance) This patch only restored the behavior we had before (and for many many years). It's not breaking, it's in fact resolving a break which was caused by earlier: https://bugs.python.org/issue37751#msg349448 Please note that search functions determine how to map codec names to codec implementations. The codec search function in the encodings package uses one way to do this (and depends on how the package is structured). The approach taken by the encodings search function is listed here: https://github.com/python/cpython/blob/master/Lib/encodings/__init__.py#L43 Other search functions can work in different ways. Now, unfortunately, parts of this kind of normalization have also made its way into the codecs module itself and into the Unicode implementation and perhaps not always in a way which allows search functions to use a different approach or which is consistent. As I mentioned before, the safest way to go about this is to use alnum only names for codecs, with the addition of underscores to separate important parts. The Python implementation should make sure that such names continue to work when passed through any codec name normalization. ---------- title: In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. -> In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 03:57:15 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 23 Apr 2021 07:57:15 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619164635.76.0.07381366033.issue43911@roundup.psfhosted.org> Raymond Hettinger added the comment: Also, when running deque measurements, run the following before getting the starting process memory: deque(range(2000)).clear() # fill the deque freelist That will give a cleaner before/after comparison. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 04:00:59 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Fri, 23 Apr 2021 08:00:59 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1619156853.14.0.898620471079.issue37751@roundup.psfhosted.org> Message-ID: <07f2cd8f-21ef-25a1-8d8d-c68fe4f56476@egenix.com> Marc-Andre Lemburg added the comment: On 23.04.2021 07:47, Inada Naoki wrote: > > Inada Naoki added the comment: > > I think it is too late. Python 3.9 has been released already. Reverting the change is also breaking change. > > PEP 100 says: > "Search functions are expected to take one argument, the encoding name in all lower case letters and with hyphens and spaces converted to underscores" > https://www.python.org/dev/peps/pep-0100/#codecs-coder-decoders-lookup > > But codecs.register() says: > "Search functions are expected to take one argument, being the encoding name in all lower case letters". > > I don't know historical reason why two document are inconsistent. > https://docs.python.org/3/library/codecs.html#codecs.register I guess just an oversight on my part. PEP 100 is certainly what I meant and implemented. I should have also made it clear in PEP 100 that I meant lower case ASCII letters. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 04:04:25 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 23 Apr 2021 08:04:25 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1619165065.84.0.590478728691.issue37751@roundup.psfhosted.org> Change by Miro Hron?ok : ---------- nosy: -hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 04:12:48 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 23 Apr 2021 08:12:48 +0000 Subject: [issue43804] "Building C and C++ Extensions on Windows" docs are very out-of-date In-Reply-To: <1618138301.06.0.442096626289.issue43804@roundup.psfhosted.org> Message-ID: <1619165568.66.0.966196189056.issue43804@roundup.psfhosted.org> Shreyan Avigyan added the comment: I'm attaching a patch for improving "Building C and C++ Extensions on Windows" and "Building C and C++ Extensions" docs. ---------- Added file: https://bugs.python.org/file49973/patch.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 04:41:09 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Fri, 23 Apr 2021 08:41:09 +0000 Subject: [issue32133] documentation: numbers module nitpick In-Reply-To: <1511634703.59.0.213398074469.issue32133@psf.upfronthosting.co.za> Message-ID: <1619167269.45.0.223044508442.issue32133@roundup.psfhosted.org> Change by Sergey B Kirpichev : ---------- nosy: +Sergey.Kirpichev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 04:41:30 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Fri, 23 Apr 2021 08:41:30 +0000 Subject: [issue30094] PDB enhancement In-Reply-To: <1492540356.16.0.824353037867.issue30094@psf.upfronthosting.co.za> Message-ID: <1619167290.12.0.0382526211405.issue30094@roundup.psfhosted.org> Change by Sergey B Kirpichev : ---------- nosy: +Sergey.Kirpichev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 04:41:52 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Fri, 23 Apr 2021 08:41:52 +0000 Subject: [issue23602] Implement __format__ for Fraction In-Reply-To: <1425747969.33.0.749439080082.issue23602@psf.upfronthosting.co.za> Message-ID: <1619167312.39.0.322809019812.issue23602@roundup.psfhosted.org> Change by Sergey B Kirpichev : ---------- nosy: +Sergey.Kirpichev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 04:42:19 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Fri, 23 Apr 2021 08:42:19 +0000 Subject: [issue11977] Document int.conjugate, .denominator, ... In-Reply-To: <1304281527.31.0.490855544057.issue11977@psf.upfronthosting.co.za> Message-ID: <1619167339.39.0.825729817953.issue11977@roundup.psfhosted.org> Change by Sergey B Kirpichev : ---------- nosy: +Sergey.Kirpichev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 04:42:05 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Fri, 23 Apr 2021 08:42:05 +0000 Subject: [issue23975] numbers.Rational implements __float__ incorrectly In-Reply-To: <1429214817.83.0.816258978912.issue23975@psf.upfronthosting.co.za> Message-ID: <1619167325.87.0.72031729778.issue23975@roundup.psfhosted.org> Change by Sergey B Kirpichev : ---------- nosy: +Sergey.Kirpichev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 05:06:18 2021 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 23 Apr 2021 09:06:18 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619168778.4.0.272088417938.issue43892@roundup.psfhosted.org> Nick Coghlan added the comment: I've removed the "?" from the end attributes for pattern nodes. The draft PR branch now compiles, but I've clearly made a mistake somewhere as it segfaults when trying to compile test_patma.py. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 05:09:30 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 09:09:30 +0000 Subject: [issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning In-Reply-To: <1560803734.85.0.206698450732.issue37322@roundup.psfhosted.org> Message-ID: <1619168970.4.0.836893620557.issue37322@roundup.psfhosted.org> Christian Heimes added the comment: I wasn't aware of this bpo and created bpo-43885 a couple of days ago. tl;dr I do not understand test changes in fb7e7505ed1337bf40fa7b8b68317d1e86675a86 at all. I think that these changes are broken, too. ThreadedEchoServer and ConnectionHandler must not raise unhandled exceptions. An unhandled exception can break tests and sometimes causes threaded tests to hang indefinitely. ---------- nosy: +christian.heimes priority: normal -> high versions: +Python 3.10, Python 3.11, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 05:10:15 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 09:10:15 +0000 Subject: [issue43885] ResourceWarning: unclosed test_pha_required_nocert In-Reply-To: <1618819666.42.0.85346092092.issue43885@roundup.psfhosted.org> Message-ID: <1619169015.61.0.376315432116.issue43885@roundup.psfhosted.org> Christian Heimes added the comment: Thanks Victor, let's handle the issue in bpo-37322 instead. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> test_ssl: test_pha_required_nocert() emits a ResourceWarning _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 05:10:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 23 Apr 2021 09:10:51 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1619169051.1.0.573911289231.issue37751@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 32980fb669a6857276da18895fcc0cb6f6fbb544 by Hai Shi in branch 'master': bpo-37751: Document codecs.lookup() change in What's New in Python 3.9 (GH-23096) https://github.com/python/cpython/commit/32980fb669a6857276da18895fcc0cb6f6fbb544 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 05:11:48 2021 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 23 Apr 2021 09:11:48 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619169108.35.0.517037744189.issue43892@roundup.psfhosted.org> Nick Coghlan added the comment: My proposed MatchConstant node name was bothering me, as most constants are actually matched by equality in MatchValue, the same way variables are. So I'm switching my proposed name for that node to be MatchSingleton, since that better reflects the key difference with MatchValue (i.e. comparing by identity rather than by value, and specifically comparing with the builtin singletons). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 05:26:49 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 09:26:49 +0000 Subject: [issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning In-Reply-To: <1560803734.85.0.206698450732.issue37322@roundup.psfhosted.org> Message-ID: <1619170009.45.0.425196927244.issue37322@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24273 pull_request: https://github.com/python/cpython/pull/25553 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 05:31:23 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Fri, 23 Apr 2021 09:31:23 +0000 Subject: [issue37363] Additional PEP578 hooks In-Reply-To: <1561131749.05.0.996884755083.issue37363@roundup.psfhosted.org> Message-ID: <1619170283.71.0.141853307774.issue37363@roundup.psfhosted.org> Change by St?phane Wirtel : ---------- versions: +Python 3.10 -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 05:52:47 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 09:52:47 +0000 Subject: [issue43920] OpenSSL 3.0.0: handle empty cadata consistently Message-ID: <1619171567.45.0.941398900473.issue43920@roundup.psfhosted.org> New submission from Christian Heimes : OpenSSL 3.0.0-alpha15 handles empty data input to d2i_X509_bio() and PEM_read_bio_X509() differently. This causes cadata test for invalid data to fail with inconsistent error message. Let's handle 0 result case more consistent and raise an error message that is more understandable than "no start line" or "not enough data". ---------- assignee: christian.heimes components: SSL messages: 391673 nosy: christian.heimes priority: normal severity: normal status: open title: OpenSSL 3.0.0: handle empty cadata consistently type: behavior versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 05:56:12 2021 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 23 Apr 2021 09:56:12 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619171772.92.0.273874841615.issue43892@roundup.psfhosted.org> Nick Coghlan added the comment: Segfaults are fixed (I had a couple of cases where I wasn't checking for NULL, and another where I was looking up MatchMapping attributes on a MatchClass node). test_patma passes except for test cases 240, 241, and 242, which look like genuine regressions - the logic to reject illegal MatchValue nodes is missing from the code generator side, and these particular values make it through the parser OK. I'll need to add back some of the code I took out so these still get rejected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 06:03:27 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 10:03:27 +0000 Subject: [issue43920] OpenSSL 3.0.0: handle empty cadata consistently In-Reply-To: <1619171567.45.0.941398900473.issue43920@roundup.psfhosted.org> Message-ID: <1619172207.0.0.0526151913503.issue43920@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +24274 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25554 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 06:19:27 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Fri, 23 Apr 2021 10:19:27 +0000 Subject: [issue37363] Additional PEP578 hooks In-Reply-To: <1561131749.05.0.996884755083.issue37363@roundup.psfhosted.org> Message-ID: <1619173167.5.0.0382647998088.issue37363@roundup.psfhosted.org> St?phane Wirtel added the comment: New changeset 927b841c215a1ca36c9b3203eadc67ce05b1ed07 by Saiyang Gou in branch 'master': bpo-37363: Add audit events to the `http.client` module (GH-21321) https://github.com/python/cpython/commit/927b841c215a1ca36c9b3203eadc67ce05b1ed07 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 06:21:35 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Fri, 23 Apr 2021 10:21:35 +0000 Subject: [issue37363] Additional PEP578 hooks In-Reply-To: <1561131749.05.0.996884755083.issue37363@roundup.psfhosted.org> Message-ID: <1619173295.24.0.546309012377.issue37363@roundup.psfhosted.org> St?phane Wirtel added the comment: the http module is covered by the audit events ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 06:56:18 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 23 Apr 2021 10:56:18 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots Message-ID: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : https://buildbot.python.org/all/#/builders/405/builds/9 Extract from the logs: The Buildbot has detected a new failure on builder AMD64 Windows8.1 Non-Debug 3.x while building python/cpython. Full details are available at: https://buildbot.python.org/all/#builders/405/builds/9 Buildbot URL: https://buildbot.python.org/all/ Worker for this Build: ware-win81-release Build Reason: Blamelist: E-Paine <63801254+E-Paine at users.noreply.github.com>, Raymond Hettinger , Simon Charette , Steve Dower BUILD FAILED: failed test (failure) Summary of the results of the build (if available): =================================================== == Tests result: FAILURE then FAILURE == 395 tests OK. 10 slowest tests: - test_multiprocessing_spawn: 2 min 43 sec - test_concurrent_futures: 2 min 25 sec - test_io: 1 min 43 sec - test_largefile: 1 min 41 sec - test_peg_generator: 1 min 39 sec - test_mmap: 1 min 19 sec - test_asyncio: 58.8 sec - test_regrtest: 45.3 sec - test_unparse: 44.1 sec - test_tokenize: 41.1 sec 1 test failed: test_ssl 30 tests skipped: test_curses test_dbm_gnu test_dbm_ndbm test_devpoll test_epoll test_fcntl test_fork1 test_gdb test_grp test_ioctl test_kqueue test_multiprocessing_fork test_multiprocessing_forkserver test_nis test_openpty test_ossaudiodev test_pipes test_poll test_posix test_pty test_pwd test_readline test_resource test_spwd test_syslog test_threadsignals test_wait3 test_wait4 test_xxtestfuzz test_zipfile64 1 re-run test: test_ssl Total duration: 9 min 15 sec Captured traceback ================== Traceback (most recent call last): File "D:\buildarea\3.x.ware-win81-release.nondebug\build\lib\test\test_ssl.py", line 2333, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "D:\buildarea\3.x.ware-win81-release.nondebug\build\lib\ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "D:\buildarea\3.x.ware-win81-release.nondebug\build\lib\ssl.py", line 1070, in _create self.do_handshake() File "D:\buildarea\3.x.ware-win81-release.nondebug\build\lib\ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:969) Traceback (most recent call last): File "D:\buildarea\3.x.ware-win81-release.nondebug\build\lib\test\test_ssl.py", line 255, in wrapper return func(*args, **kw) File "D:\buildarea\3.x.ware-win81-release.nondebug\build\lib\test\test_ssl.py", line 3171, in test_wrong_cert_tls13 self.fail("Use of invalid cert should have failed!") AssertionError: Use of invalid cert should have failed! Test report =========== Failed tests: - test_ssl Failed subtests: - test_wrong_cert_tls13 - test.test_ssl.ThreadedTests Sincerely, -The Buildbot ---------- assignee: christian.heimes messages: 391677 nosy: christian.heimes, pablogsal priority: normal severity: normal status: open title: test_ssl fails on Windows buildbots versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 06:57:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 23 Apr 2021 10:57:51 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619175471.34.0.383035722444.issue38659@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Gentle ping ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 07:13:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 23 Apr 2021 11:13:58 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619176438.48.0.51143947434.issue38659@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Commenting out the enum tests reveals that test_socket has additional problems: ? ./python.exe -m test test_socket -R 3:3 0:00:00 load avg: 2.32 Run tests sequentially 0:00:00 load avg: 2.32 [1/1] test_socket beginning 6 repetitions 123456 /Users/pgalindo3/github/python/master/Lib/test/test_socket.py:2701: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg(bufsize, *args) /Users/pgalindo3/github/python/master/Lib/test/test_socket.py:2792: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg_into([buf], *args) ./Users/pgalindo3/github/python/master/Lib/test/test_socket.py:2701: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg(bufsize, *args) /Users/pgalindo3/github/python/master/Lib/test/test_socket.py:2792: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg_into([buf], *args) ./Users/pgalindo3/github/python/master/Lib/test/test_socket.py:2701: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg(bufsize, *args) /Users/pgalindo3/github/python/master/Lib/test/test_socket.py:2792: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg_into([buf], *args) ./Users/pgalindo3/github/python/master/Lib/test/test_socket.py:2701: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg(bufsize, *args) /Users/pgalindo3/github/python/master/Lib/test/test_socket.py:2792: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg_into([buf], *args) ./Users/pgalindo3/github/python/master/Lib/test/test_socket.py:2701: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg(bufsize, *args) /Users/pgalindo3/github/python/master/Lib/test/test_socket.py:2792: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg_into([buf], *args) ./Users/pgalindo3/github/python/master/Lib/test/test_socket.py:2701: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg(bufsize, *args) /Users/pgalindo3/github/python/master/Lib/test/test_socket.py:2792: RuntimeWarning: received malformed or improperly-truncated ancillary data result = sock.recvmsg_into([buf], *args) . test_socket leaked [20, 20, 20] file descriptors, sum=60 test_socket failed in 2 min 25 sec == Tests result: FAILURE == 1 test failed: test_socket Total duration: 2 min 25 sec Tests result: FAILURE ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 07:18:15 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 11:18:15 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1619176695.49.0.141191420649.issue43921@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 07:21:20 2021 From: report at bugs.python.org (Berker Peksag) Date: Fri, 23 Apr 2021 11:21:20 +0000 Subject: [issue43852] [sqlite3] Improve tuple creation In-Reply-To: <1618478615.92.0.752682980963.issue43852@roundup.psfhosted.org> Message-ID: <1619176880.8.0.381246040098.issue43852@roundup.psfhosted.org> Berker Peksag added the comment: New changeset e9194ea6eaa18299d6ccbd3555ce150fab0c6184 by Erlend Egeberg Aasland in branch 'master': bpo-43852: Improve tuple creation in sqlite3 (GH-25421) https://github.com/python/cpython/commit/e9194ea6eaa18299d6ccbd3555ce150fab0c6184 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 07:21:54 2021 From: report at bugs.python.org (Berker Peksag) Date: Fri, 23 Apr 2021 11:21:54 +0000 Subject: [issue43852] [sqlite3] Improve tuple creation In-Reply-To: <1618478615.92.0.752682980963.issue43852@roundup.psfhosted.org> Message-ID: <1619176914.19.0.631569158916.issue43852@roundup.psfhosted.org> Change by Berker Peksag : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 07:44:32 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 11:44:32 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1619178272.33.0.354694297378.issue38820@roundup.psfhosted.org> Change by Christian Heimes : ---------- dependencies: +OpenSSL 3.0.0: handle empty cadata consistently _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 07:51:17 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 23 Apr 2021 11:51:17 +0000 Subject: [issue32891] Add 'Integer' as synonym for 'Integral' in numbers module. In-Reply-To: <1519191292.27.0.467229070634.issue32891@psf.upfronthosting.co.za> Message-ID: <1619178677.92.0.74801613229.issue32891@roundup.psfhosted.org> Mark Dickinson added the comment: For the record, here's the python-ideas thread: https://mail.python.org/archives/list/python-ideas at python.org/thread/AWNTQZ3HHAQ42O2ZHRA3U2US4HGKC2TF/ I'm no longer convinced that this is a good idea. It's the usual difference between "Would it have been better if we'd called it 'Integer' rather than 'Integral'?", and "Given where we are, is it worth changing the name now?". The name "Integral" isn't actually _wrong_ as such; it's just perhaps not the name that we would have chosen if we were inventing the numbers ABC right now. If we add "Integer", we have to choose between - maintaining both names indefinitely, or - deprecating and eventually removing the "Integral" name Neither option seems appealing: the first is a violation of "one obvious way"; the second causes unnecessary work for third-party projects already using Integral. ---------- nosy: +rhettinger, tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 07:51:44 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 11:51:44 +0000 Subject: [issue43920] OpenSSL 3.0.0: handle empty cadata consistently In-Reply-To: <1619171567.45.0.941398900473.issue43920@roundup.psfhosted.org> Message-ID: <1619178704.25.0.0939953843247.issue43920@roundup.psfhosted.org> Christian Heimes added the comment: New changeset b9ad88be0304136c3fe5959c65a5d2c75490cd80 by Christian Heimes in branch 'master': bpo-43920: Make load_verify_locations(cadata) error message consistent (GH-25554) https://github.com/python/cpython/commit/b9ad88be0304136c3fe5959c65a5d2c75490cd80 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 07:53:57 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 11:53:57 +0000 Subject: [issue43920] OpenSSL 3.0.0: handle empty cadata consistently In-Reply-To: <1619171567.45.0.941398900473.issue43920@roundup.psfhosted.org> Message-ID: <1619178837.06.0.120412196148.issue43920@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24275 pull_request: https://github.com/python/cpython/pull/25555 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 07:54:52 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 11:54:52 +0000 Subject: [issue43920] OpenSSL 3.0.0: handle empty cadata consistently In-Reply-To: <1619171567.45.0.941398900473.issue43920@roundup.psfhosted.org> Message-ID: <1619178892.4.0.749110715496.issue43920@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24276 pull_request: https://github.com/python/cpython/pull/25556 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 08:02:47 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 23 Apr 2021 12:02:47 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1619179367.69.0.0277037868314.issue41282@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 90d02e5e63e2cb8f66a2c0dd2ea8d7d4f45f4ebf by Lum?r 'Frenzy' Balhar in branch 'master': bpo-41282: (PEP 632) Deprecate distutils.sysconfig (partial implementation of the PEP) (GH-23142) https://github.com/python/cpython/commit/90d02e5e63e2cb8f66a2c0dd2ea8d7d4f45f4ebf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 08:14:07 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 23 Apr 2021 12:14:07 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1619180047.66.0.791798996962.issue43795@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset e7cc64e297001cc79b9afab80f71d9e6d1267cb7 by Petr Viktorin in branch 'master': bpo-43795: PEP-652: Simplify headers for easier static analysis (GH-25483) https://github.com/python/cpython/commit/e7cc64e297001cc79b9afab80f71d9e6d1267cb7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 08:15:39 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Fri, 23 Apr 2021 12:15:39 +0000 Subject: [issue32891] Add 'Integer' as synonym for 'Integral' in numbers module. In-Reply-To: <1619178677.92.0.74801613229.issue32891@roundup.psfhosted.org> Message-ID: Sergey B Kirpichev added the comment: On Fri, Apr 23, 2021 at 11:51:17AM +0000, Mark Dickinson wrote: > The name "Integral" isn't actually _wrong_ as such; it's just perhaps > not the name that we would have chosen if we were inventing the > numbers ABC right now. > > If we add "Integer", we have to choose between > > - maintaining both names indefinitely, or > - deprecating and eventually removing the "Integral" name > > Neither option seems appealing: the first is a violation of "one > obvious way"; the second causes unnecessary work for third-party > projects already using Integral. The second option require very small part of work (oneline patch, to be precise). The one of the best parts of the Python is that it's a live language. I.e. wrong decisions could be corrected. The current one is not wrong, in a strict sense, but if the C standard, wikipedia pages, etc (include the Scheme numbers tower) reference integer types and CPython docs call this "integral" - I'm not sure if the later is a good name. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 08:18:02 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 23 Apr 2021 12:18:02 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1619180282.84.0.982922728073.issue43795@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 9d6a2d0ee7e55402656e1dec46400591b62db331 by Petr Viktorin in branch 'master': bpo-43795: PEP-652: Clean up the stable ABI/limited API (GH-25482) https://github.com/python/cpython/commit/9d6a2d0ee7e55402656e1dec46400591b62db331 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 08:18:32 2021 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 23 Apr 2021 12:18:32 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619180312.54.0.929516855383.issue43892@roundup.psfhosted.org> Nick Coghlan added the comment: To get the "0+0" matching case rejected again I had to flesh out a bit more of the AST validator. This initial piece of the validator replaces the previously pattern-matching-specific AST optimisation code that refused to fold BinOp expressions that weren't complex numbers, allowing the compiler to reject them. I also added two new tests (240b and 241b) to ensure that 0+0 & f"" were also rejected as mapping keys. 241b passes with the current PR, as f"" gets rejected by both the check in the AST validator *and* by the "constant or attribute lookup" restriction in the compiler, so the latter check covers for the leaky validator. 240b is disabled for now, as it won't pass until the AST validator checks all the subexpressions being used as keys in a mapping pattern (because it gets constant folded to "0", the check in the compiler accepts it). That leaves fixing the unparser tests as the key thing to do before I create the main PR. Before that, though, I'll look at potentially simplifying the MatchMapping code by changing the signature as Brandt suggested. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 08:19:24 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 12:19:24 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1619180364.46.0.576732288135.issue38820@roundup.psfhosted.org> Christian Heimes added the comment: New changeset dcf658157df11de198a98e3db2a3050dd4f6b973 by Christian Heimes in branch 'master': bpo-38820: Test with OpenSSL 3.0.0-alpha15 (GH-25537) https://github.com/python/cpython/commit/dcf658157df11de198a98e3db2a3050dd4f6b973 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 08:23:40 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 12:23:40 +0000 Subject: [issue43920] OpenSSL 3.0.0: handle empty cadata consistently In-Reply-To: <1619171567.45.0.941398900473.issue43920@roundup.psfhosted.org> Message-ID: <1619180620.53.0.512444488518.issue43920@roundup.psfhosted.org> Christian Heimes added the comment: New changeset e259a77f21bdfc7d4195913b379cbd6daee45d0d by Christian Heimes in branch '3.9': [3.9] bpo-43920: Make load_verify_locations(cadata) error message consistent (GH-25554) (GH-25555) https://github.com/python/cpython/commit/e259a77f21bdfc7d4195913b379cbd6daee45d0d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 08:23:41 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 23 Apr 2021 12:23:41 +0000 Subject: [issue43868] Remove PyOS_ReadlineFunctionPointer from the stable ABI list In-Reply-To: <1618584508.44.0.195246221039.issue43868@roundup.psfhosted.org> Message-ID: <1619180621.8.0.232593419851.issue43868@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 91b69b77cf5f78de6d35dea23098df34b6fd9e53 by Petr Viktorin in branch 'master': bpo-43868: Remove PyOS_ReadlineFunctionPointer from the stable ABI list (GH-25442) https://github.com/python/cpython/commit/91b69b77cf5f78de6d35dea23098df34b6fd9e53 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 08:24:00 2021 From: report at bugs.python.org (Jens) Date: Fri, 23 Apr 2021 12:24:00 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619180640.61.0.560633050856.issue43911@roundup.psfhosted.org> Jens added the comment: Thanks for your input. So i've run the tests with the List of Lists Queue class, there seems to be a resulting difference depending on what qsize() method I define, that is called my script. For an instance where qsize just return None, class QueueLists(list): def put(self, x): if not self or len(self[-1]) >= 66: self.append([]) self[-1].append(x) def get(self): if not self: raise IndexError block = self[0] x = block.pop(0) if not block: self.pop(0) return x # def qsize(self): # tot = 0 # for elem in self: # tot += len(elem) # return tot def qsize(self): return None The results are: >######### >del_after_puts False del_after_gets True n_puts 20000000 >before run >mem_pct 0.15% >------ put done ----- qsize None >mem_pct 38.06% >------ gets done ----- qsize None >mem_pct 2.35% >deleting queue after gets [] >mem_pct 2.35% >time elapsed 0:01:04.703969 For a Queue instance, where qsize() returns the actual size class QueueLists(list): def put(self, x): if not self or len(self[-1]) >= 66: self.append([]) self[-1].append(x) def get(self): if not self: raise IndexError block = self[0] x = block.pop(0) if not block: self.pop(0) return x def qsize(self): tot = 0 for elem in self: tot += len(elem) return tot the results are: >######### >del_after_puts False del_after_gets True n_puts 20000000 >before run >mem_pct 0.15% >------ put done ----- qsize 20000000 >mem_pct 38.05% >------ gets done ----- qsize 0 >mem_pct 2.35% >deleting queue after gets [] >mem_pct 0.18% >time elapsed 0:00:53.347746 So both instances leak as you've indicated, but the one that returns None as queue size does not get it's leak released after the instance is deleted which is a weird difference. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 08:27:39 2021 From: report at bugs.python.org (Jens) Date: Fri, 23 Apr 2021 12:27:39 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619180859.68.0.525126922049.issue43911@roundup.psfhosted.org> Jens added the comment: Regarding deque, the leak indeed does not seem to be releasable after it is inited to up the size of the number of elements that are going to put into the queue, as: qmem = collections.deque(range(n_puts)) qmem.clear() The results are: >######### >del_after_puts False del_after_gets True n_puts 20000000 >before run >mem_pct 0.14% >------ put done ----- qsize 20000000 >mem_pct 37.61% >------ gets done ----- qsize 0 >mem_pct 2.22% >deleting queue after gets deque([]) >mem_pct 2.22% >time elapsed 0:00:16.800156 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 08:36:19 2021 From: report at bugs.python.org (Jens) Date: Fri, 23 Apr 2021 12:36:19 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619181379.99.0.551572207368.issue43911@roundup.psfhosted.org> Jens added the comment: So this got me thinking of trying to use some other linked list implementations. I've used a llist library - https://github.com/ajakubek/python-llist Using their doubly linked list implementation: class DllistQueue(queue.Queue): def _init(self, maxsize): self.queue = dllist() Results are: >del_after_puts False del_after_gets True n_puts 20000000 >before run >mem_pct 0.15% >------ put done ----- qsize 20000000 >mem_pct 55.34% >------ gets done ----- qsize 0 >mem_pct 0.15% >deleting queue after gets <__main__.DllistQueue object at 0x7f494ba91450> >mem_pct 0.15% >time elapsed 0:02:17.642700 Using their singly listed list implementation: class SllistQueue(queue.Queue): def _init(self, maxsize): self.queue = sllist() results are: >del_after_puts False del_after_gets True n_puts 20000000 >before run >mem_pct 0.15% >puting 0 qsize 0 >------ put done ----- qsize 20000000 >mem_pct 55.34% >------ gets done ----- qsize 0 >mem_pct 0.15% >deleting queue after gets <__main__.SllistQueue object at 0x7ff07bf484d0> >mem_pct 0.15% >time elapsed 0:02:03.495047 I have not dived in how their C implementations differ from deque, but it seems to use more memory and it's slower, but it does not seem to leak at all. Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 09:16:29 2021 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 23 Apr 2021 13:16:29 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619183789.24.0.970499832124.issue43892@roundup.psfhosted.org> Nick Coghlan added the comment: https://github.com/ncoghlan/cpython/pull/9/commits/54940a3817df3046da3f9c51d4d426a73b2ec786 implements Brandt's suggestion of disallowing NULL keys in MatchMapping and instead passing in an explicit "rest" identifier to capture the extra keys. This did require moving to a multi-branch pattern definition in the grammar, similar to class patterns, in order to enforce the separating comma when both ordinary key:pattern pairs and a double-star target are present. I think it's a nice ergonomic improvement on the AST node itself though, as it makes it trivial to check if a mapping patterns captures extra keys or not (vs the relatively non-obvious check to see if the last key is NULL/None). That just leaves updating the unparser to handle the new node types. Capturing the latest node definitions from the draft PR: pattern = MatchAlways | MatchValue(expr value) | MatchSingleton(constant value) | MatchSequence(pattern* patterns) | MatchMapping(expr* keys, pattern* patterns, identifier? rest) | MatchClass(expr cls, pattern* patterns, identifier* kwd_attrs, pattern* kwd_patterns) | MatchStar(identifier? target) -- The optional "rest" MatchMapping parameter handles capturing extra mapping keys | MatchAs(pattern? pattern, identifier target) | MatchOr(pattern* patterns) attributes (int lineno, int col_offset, int end_lineno, int end_col_offset) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 09:19:05 2021 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 23 Apr 2021 13:19:05 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619183945.28.0.508289444236.issue43892@roundup.psfhosted.org> Nick Coghlan added the comment: Setting clear timing expectations, given beta is so close: I'm not expecting to have time to finish the unparser work over the weekend, but I do expect to have time to finish it on Monday evening my time (UTC+10). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 09:21:37 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 23 Apr 2021 13:21:37 +0000 Subject: [issue43856] Docs for importlib.metadata should mention Python version In-Reply-To: <1618502050.6.0.847154133714.issue43856@roundup.psfhosted.org> Message-ID: <1619184097.81.0.0137883791915.issue43856@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 09:26:27 2021 From: report at bugs.python.org (Jens) Date: Fri, 23 Apr 2021 13:26:27 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619184387.26.0.991424933043.issue43911@roundup.psfhosted.org> Jens added the comment: Also compared this library to deque, and Queues based on this: https://github.com/kata198/python-cllist It seems to be as fast as deque, uses a bit more memory at the top usage, but does not leak at all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 09:27:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 23 Apr 2021 13:27:25 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1619184445.18.0.0199328660015.issue43914@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset a77aac4fca9723b8fd52a832f3e9df13beb25113 by Pablo Galindo in branch 'master': bpo-43914: Highlight invalid ranges in SyntaxErrors (#25525) https://github.com/python/cpython/commit/a77aac4fca9723b8fd52a832f3e9df13beb25113 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 10:36:50 2021 From: report at bugs.python.org (Julien Castiaux) Date: Fri, 23 Apr 2021 14:36:50 +0000 Subject: [issue43922] Double dots in quopri transported emails Message-ID: <1619188610.43.0.088106557205.issue43922@roundup.psfhosted.org> New submission from Julien Castiaux : Hello, We received multiple bug reports about broken links in rich html emails. Sometime, in some emails, a link like would become _______________________________________ From report at bugs.python.org Fri Apr 23 10:37:16 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 14:37:16 +0000 Subject: [issue43920] OpenSSL 3.0.0: handle empty cadata consistently In-Reply-To: <1619171567.45.0.941398900473.issue43920@roundup.psfhosted.org> Message-ID: <1619188636.55.0.360850435728.issue43920@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 82b6c0909aae423d9c8f4ff7d0e8df16106dbe28 by Christian Heimes in branch '3.8': [3.8] bpo-43920: Make load_verify_locations(cadata) error message consistent (GH-25554) (GH-25556) https://github.com/python/cpython/commit/82b6c0909aae423d9c8f4ff7d0e8df16106dbe28 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 10:37:43 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 14:37:43 +0000 Subject: [issue43920] OpenSSL 3.0.0: handle empty cadata consistently In-Reply-To: <1619171567.45.0.941398900473.issue43920@roundup.psfhosted.org> Message-ID: <1619188663.15.0.893321338966.issue43920@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 10:42:00 2021 From: report at bugs.python.org (=?utf-8?b?SsOpcsO0bWUgVmFuaGF1ZGVuYXJk?=) Date: Fri, 23 Apr 2021 14:42:00 +0000 Subject: [issue43922] Double dots in quopri transported emails In-Reply-To: <1619188610.43.0.088106557205.issue43922@roundup.psfhosted.org> Message-ID: <1619188920.97.0.332441594061.issue43922@roundup.psfhosted.org> Change by J?r?me Vanhaudenard : ---------- nosy: +jev2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 11:24:04 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 23 Apr 2021 15:24:04 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1619191444.27.0.712108101405.issue38605@roundup.psfhosted.org> Guido van Rossum added the comment: I haven't followed this precisely, but I recall that when we first made PEP 563 the default, we had to fix a number of bugs in various library modules (e.g. inspect) that were only apparent when `from __future__ import annotations` was used. I hope we're not throwing away those bugfixes. Hopefully Batuhan has a recollection of what I am thinking of, there was some significant delay while we figured out what to do about some of these. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 11:25:48 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 23 Apr 2021 15:25:48 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619191548.06.0.193140331863.issue43908@roundup.psfhosted.org> Guido van Rossum added the comment: Is there going to be a separate PR to actually *set* the IMMUTABLE flag on all built-in type objects? There are many of those. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 12:08:16 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 16:08:16 +0000 Subject: [issue35114] ssl.RAND_status docs describe it as returning True/False; actually returns 1/0 In-Reply-To: <1540906817.06.0.788709270274.issue35114@psf.upfronthosting.co.za> Message-ID: <1619194096.34.0.557491712466.issue35114@roundup.psfhosted.org> Christian Heimes added the comment: Thanks Zackery! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 12:08:02 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 16:08:02 +0000 Subject: [issue35114] ssl.RAND_status docs describe it as returning True/False; actually returns 1/0 In-Reply-To: <1540906817.06.0.788709270274.issue35114@psf.upfronthosting.co.za> Message-ID: <1619194082.43.0.35911895651.issue35114@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 7d37b86ad48368cf93440ca220b758696730d0e5 by Zackery Spytz in branch 'master': bpo-35114: Make ssl.RAND_status() return a bool (GH-20063) https://github.com/python/cpython/commit/7d37b86ad48368cf93440ca220b758696730d0e5 ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 12:15:13 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 23 Apr 2021 16:15:13 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619194513.01.0.608156249345.issue43911@roundup.psfhosted.org> Raymond Hettinger added the comment: FWIW, when running your code on my Intel Mac with 16 Gb of RAM, the "after return" result is 0.1%. So getting up to 2.2% seems to be specific to your build. Also, I just ran your code with a deque instrumented to count the number of mallocs and frees. At the end of the run, there were 312506 blocks allocated and 312490 freed. The difference of 16 is expected. That is the number of blocks kept in the freelist to reduce allocator calls for common use cases. So we're not seeing a "leak" in the traditional sense of more calls to malloc() than to free(). Instead, there is just an indirect measurement of total process memory which is something we can't directly control. That you observed similar a result with a list of lists corroborates that there isn't an issue specific to Queue or deques. Instead, it is just an artifact of this particular pattern of exercising the memory allocators. I conclude that what you're seeing isn't a bug. The effect is due to a mix of: 1) the interaction between the C library and the O/S memory management routines 2) normally occurring fragmentation 3) freelists which are intentionally reserved. Thank you for the report, but we've spent enough time on it. Trying to account for total process memory is like chasing rainbows, mostly elusive and there is not pot of gold at the end :-) ---------- keywords: +patch resolution: -> not a bug stage: -> resolved status: open -> closed Added file: https://bugs.python.org/file49974/instrument_deque.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 12:15:22 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 23 Apr 2021 16:15:22 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619194522.61.0.470733151169.issue43911@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 12:22:56 2021 From: report at bugs.python.org (FHTMitchell) Date: Fri, 23 Apr 2021 16:22:56 +0000 Subject: [issue43923] Can't create generic NamedTuple as of py3.9 Message-ID: <1619194976.58.0.205362589455.issue43923@roundup.psfhosted.org> New submission from FHTMitchell : As of python 3.9, you now can't have multiple inheritance with `typing.NamedTuple` subclasses. This seems sensible, until you realise that `typing.Generic` works via inheritance. This fails whether or not `from __future__ import annotations` is enabled. example: ``` class Group(NamedTuple, Generic[T]): key: T group: List[T] --------------------------------------------------------------------------- TypeError Traceback (most recent call last) in ----> 1 class Group(NamedTuple, Generic[T]): 2 key: T 3 group: List[T] 4 ~/.conda/envs/py39/lib/python3.9/typing.py in _namedtuple_mro_entries(bases) 1818 def _namedtuple_mro_entries(bases): 1819 if len(bases) > 1: -> 1820 raise TypeError("Multiple inheritance with NamedTuple is not supported") 1821 assert bases[0] is NamedTuple 1822 return (_NamedTuple,) TypeError: Multiple inheritance with NamedTuple is not supported ``` This worked fine in python 3.7 and 3.8 and as I understand it was one of the motivating cases for pep 560. The change was made as part of bpo-40185: Refactor typing.NamedTuple. Whilst the obvious alternative is "use dataclasses", they don't have the same runtime properties or implications as namedtuples. ---------- messages: 391705 nosy: FHTMitchell priority: normal severity: normal status: open title: Can't create generic NamedTuple as of py3.9 versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 12:23:07 2021 From: report at bugs.python.org (FHTMitchell) Date: Fri, 23 Apr 2021 16:23:07 +0000 Subject: [issue43923] Can't create generic NamedTuple as of py3.9 In-Reply-To: <1619194976.58.0.205362589455.issue43923@roundup.psfhosted.org> Message-ID: <1619194987.3.0.889702214938.issue43923@roundup.psfhosted.org> Change by FHTMitchell : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 12:27:00 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 23 Apr 2021 16:27:00 +0000 Subject: [issue43923] Can't create generic NamedTuple as of py3.9 In-Reply-To: <1619194976.58.0.205362589455.issue43923@roundup.psfhosted.org> Message-ID: <1619195220.22.0.0520669214991.issue43923@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +levkivskyi, rhettinger, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 12:45:51 2021 From: report at bugs.python.org (Rafi Hassan Chowdhury) Date: Fri, 23 Apr 2021 16:45:51 +0000 Subject: [issue43924] print unexpected values in infinite loop Message-ID: <1619196351.8.0.784934535356.issue43924@roundup.psfhosted.org> Change by Rafi Hassan Chowdhury : ---------- files: main.py nosy: rafihassan190041234 priority: normal severity: normal status: open title: print unexpected values in infinite loop type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file49975/main.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 12:46:17 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 23 Apr 2021 16:46:17 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1619196377.98.0.830810943853.issue43284@roundup.psfhosted.org> Shreyan Avigyan added the comment: @steve.dower Would you mind merging the backport of the PR to the 3.9 branch manually? Apparently there seems to a test failure. I'm not sure why. But it reports that test has been failing recently. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 12:51:07 2021 From: report at bugs.python.org (R. David Murray) Date: Fri, 23 Apr 2021 16:51:07 +0000 Subject: [issue43922] Double dots in quopri transported emails In-Reply-To: <1619188610.43.0.088106557205.issue43922@roundup.psfhosted.org> Message-ID: <1619196667.61.0.600141169116.issue43922@roundup.psfhosted.org> R. David Murray added the comment: Since python is doing the right thing here, I don't see a particularly good reason to put a hack into the stdlib to fix the failure of third party software to adhere to standards. (On the output side. We do follow Postel's rule on input and try hard to handle broken but recoverable input.) I don't actually *object* to it, though, as long as it follows the standard on output, and is a *simple* change. Please note that you can fix this locally by implementing and using a custom content manager. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 12:55:16 2021 From: report at bugs.python.org (Rafi Hassan Chowdhury) Date: Fri, 23 Apr 2021 16:55:16 +0000 Subject: [issue43924] print unexpected values in infinite loop Message-ID: <1619196916.08.0.312135498895.issue43924@roundup.psfhosted.org> Change by Rafi Hassan Chowdhury : ---------- type: behavior -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 12:57:20 2021 From: report at bugs.python.org (Rafi Hassan Chowdhury) Date: Fri, 23 Apr 2021 16:57:20 +0000 Subject: [issue43924] print unexpected values in infinite loop Message-ID: <1619197040.91.0.198266767469.issue43924@roundup.psfhosted.org> Change by Rafi Hassan Chowdhury : Removed file: https://bugs.python.org/file49975/main.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:02:53 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Apr 2021 17:02:53 +0000 Subject: [issue43607] urllib's request.pathname2url not compatible with extended-length Windows file paths In-Reply-To: <1616540209.08.0.34606490658.issue43607@roundup.psfhosted.org> Message-ID: <1619197373.59.0.524344718607.issue43607@roundup.psfhosted.org> Steve Dower added the comment: New changeset 3513d55a617012002c3f82dbf3cec7ec1abd7090 by Steve Dower in branch 'master': bpo-43607: Fix urllib handling of Windows paths with \\?\ prefix (GH-25539) https://github.com/python/cpython/commit/3513d55a617012002c3f82dbf3cec7ec1abd7090 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:02:59 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Apr 2021 17:02:59 +0000 Subject: [issue43607] urllib's request.pathname2url not compatible with extended-length Windows file paths In-Reply-To: <1616540209.08.0.34606490658.issue43607@roundup.psfhosted.org> Message-ID: <1619197379.53.0.64772160226.issue43607@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24277 pull_request: https://github.com/python/cpython/pull/25558 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:03:21 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Apr 2021 17:03:21 +0000 Subject: [issue43538] [Windows] support args and cwd in os.startfile() In-Reply-To: <1616052233.51.0.171946221972.issue43538@roundup.psfhosted.org> Message-ID: <1619197401.7.0.127827601969.issue43538@roundup.psfhosted.org> Steve Dower added the comment: New changeset 019e9e816882f5c43c4b833f81844b8299e815fd by Steve Dower in branch 'master': bpo-43538: Add extra arguments to os.startfile (GH-25538) https://github.com/python/cpython/commit/019e9e816882f5c43c4b833f81844b8299e815fd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:03:06 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Apr 2021 17:03:06 +0000 Subject: [issue43607] urllib's request.pathname2url not compatible with extended-length Windows file paths In-Reply-To: <1616540209.08.0.34606490658.issue43607@roundup.psfhosted.org> Message-ID: <1619197386.18.0.209363840431.issue43607@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24278 pull_request: https://github.com/python/cpython/pull/25559 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:04:20 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Apr 2021 17:04:20 +0000 Subject: [issue43538] [Windows] support args and cwd in os.startfile() In-Reply-To: <1616052233.51.0.171946221972.issue43538@roundup.psfhosted.org> Message-ID: <1619197460.9.0.808003082255.issue43538@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:04:46 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Apr 2021 17:04:46 +0000 Subject: [issue43607] urllib's request.pathname2url not compatible with extended-length Windows file paths In-Reply-To: <1616540209.08.0.34606490658.issue43607@roundup.psfhosted.org> Message-ID: <1619197486.65.0.074687793721.issue43607@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:07:15 2021 From: report at bugs.python.org (Jens) Date: Fri, 23 Apr 2021 17:07:15 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619197635.7.0.340924927583.issue43911@roundup.psfhosted.org> Jens added the comment: Ok, I see, thanks Raymond. Queue based logging leaks seem to hang my deployed applications atm, so this seemed like a possible reason for it. I use locally 8GB Ubuntu, and it gets to 2.2% after return with 20million puts, and on a remote 1GB Ubuntu instance, it gets to 3.79% up from 1.24% with 3 million puts after return. So I don't think this is necessarily specific to my local build and seems like a genuine issue. I understand where are you coming from stating that it's not a bug, but the alternative deque implementations don't seem to suffer from the same issue, at least to such a big extent, as I have shown. I will continue and try to adapt alternate deque implementations and see if it solves Queues leaking and hanging my instances. Thanks for your time and involvement in this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:07:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 23 Apr 2021 17:07:37 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619197657.36.0.814869815808.issue38659@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24279 pull_request: https://github.com/python/cpython/pull/25560 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:08:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 23 Apr 2021 17:08:53 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619197733.1.0.0509479942115.issue38659@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately, I am being forced to revert commit a02cb474f9c097c83cd444a47e9fb5f99b4aaf45 due to have it failing of all refleak buildbots for more than two days. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:15:46 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 23 Apr 2021 17:15:46 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619198146.36.0.92423607221.issue43892@roundup.psfhosted.org> Brandt Bucher added the comment: I can probably find time to take a pass at the unparser, if you want. > cls needs to be an expression node to allow for attribute lookups That's why I suggested "identifier*"! Each identifier in the list would be one part of the dotted name, so we wouldn't need to worry about having arbitrary expressions: Foo() -> MatchClass(["Foo"], [], [], []) foo.bar.Baz() -> MatchClass(["foo", "bar", "Baz"], [], [], []) Not a big deal, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:24:54 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 23 Apr 2021 17:24:54 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619198694.2.0.0646344430425.issue38659@roundup.psfhosted.org> Ethan Furman added the comment: My apologies, I was having hardware issues. Checking it out now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:26:43 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 17:26:43 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1619198803.3.0.80259735677.issue43921@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +24280 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25561 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:27:55 2021 From: report at bugs.python.org (Rafi Hassan Chowdhury) Date: Fri, 23 Apr 2021 17:27:55 +0000 Subject: [issue43924] print unexpected values in infinite loop Message-ID: <1619198875.41.0.133933332395.issue43924@roundup.psfhosted.org> Change by Rafi Hassan Chowdhury : Added file: https://bugs.python.org/file49976/main.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:28:09 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Apr 2021 17:28:09 +0000 Subject: [issue43607] urllib's request.pathname2url not compatible with extended-length Windows file paths In-Reply-To: <1616540209.08.0.34606490658.issue43607@roundup.psfhosted.org> Message-ID: <1619198889.31.0.889880568867.issue43607@roundup.psfhosted.org> miss-islington added the comment: New changeset 04bcfe001cdf6290cb78fa4884002e5301e14c93 by Miss Islington (bot) in branch '3.9': bpo-43607: Fix urllib handling of Windows paths with \\?\ prefix (GH-25539) https://github.com/python/cpython/commit/04bcfe001cdf6290cb78fa4884002e5301e14c93 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:28:48 2021 From: report at bugs.python.org (Rafi Hassan Chowdhury) Date: Fri, 23 Apr 2021 17:28:48 +0000 Subject: [issue43924] print unexpected values in infinite loop Message-ID: <1619198928.14.0.0328205504921.issue43924@roundup.psfhosted.org> Change by Rafi Hassan Chowdhury : Added file: https://bugs.python.org/file49977/main.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:29:05 2021 From: report at bugs.python.org (Rafi Hassan Chowdhury) Date: Fri, 23 Apr 2021 17:29:05 +0000 Subject: [issue43924] print unexpected values in infinite loop Message-ID: <1619198945.38.0.0919669409534.issue43924@roundup.psfhosted.org> Change by Rafi Hassan Chowdhury : Removed file: https://bugs.python.org/file49976/main.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:28:55 2021 From: report at bugs.python.org (Rafi Hassan Chowdhury) Date: Fri, 23 Apr 2021 17:28:55 +0000 Subject: [issue43924] print unexpected values in infinite loop Message-ID: <1619198935.12.0.817724712282.issue43924@roundup.psfhosted.org> Change by Rafi Hassan Chowdhury : Removed file: https://bugs.python.org/file49977/main.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:29:10 2021 From: report at bugs.python.org (Rafi Hassan Chowdhury) Date: Fri, 23 Apr 2021 17:29:10 +0000 Subject: [issue43924] print unexpected values in infinite loop Message-ID: <1619198950.59.0.336568511981.issue43924@roundup.psfhosted.org> Change by Rafi Hassan Chowdhury : Added file: https://bugs.python.org/file49978/main.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:37:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 23 Apr 2021 17:37:13 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1619199433.27.0.489957782954.issue43921@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: normal -> deferred blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:39:30 2021 From: report at bugs.python.org (=?utf-8?b?RnLDqWTDqXJpYyBHcm9zc2hhbnMtQW5kcsOp?=) Date: Fri, 23 Apr 2021 17:39:30 +0000 Subject: [issue43925] Add hangul syllables to unicodedata.decomposititon Message-ID: <1619199570.5.0.82333265185.issue43925@roundup.psfhosted.org> New submission from Fr?d?ric Grosshans-Andr? : Currently (python 3.8.6, unidata_version 12.1.0) unicodedata.decomposition outputs an empty string for hangul syllable (codepoints in the AC00..D7A3 range) while the decomposition is not empty: it is always two characters (either a LV syllable and a T Jamo or a L jamo and a V jamo). This decomposition is dedicible algorithmically (se ?3.12 of Unicode Standard). A python version of the algorithm is below (I don?t know C, so I can?t propose a patch). For each hangul syllable hs, I have used unicodedata.noramize to check that the NFC of the decomposition is indeed hs, that the decomposition is two codepoints long, that the NFD of both hs and the decompotsition coincide def hangulsyllabledecomposition(c): if not 0xAC00 <= ord(c) <= 0xD7A3 : raise ValueError('only Hangul syllables allowed') dLV, T = divmod(ord(c) - 0xAC00, 28) if T!=0 : #it is a LVT syllable, decomposed into LV:=dLV*19 and T return f'{0xAC00+dLV*28:04X} {0x11A7+T:04X}' else : #it is a LVT syllable, decomposed into L , V L, V = divmod(dLV,21) return f'{0x1100+L:04X} {0x1161+V:04X}' # Constants used: # ============== # 0xAC00 : first syllable == 1st LV syllable # NB: there is one LV syllable every 28 codepoints # 0xD7A3 : last Hangul syllable # 0x1100 : first L jamo # 0x1161 : first V jamo # 0x11A7 : one before the 1st T jamo (0x1148), since T=0 means no trailing # # (all number below restricted for modern jamos where this algorithm is relevant) # 19 : Number of L jamos (not used here) # 21 : Number of V jamos # 28 : Number of T jamos plus one (since no T jamo for LV syllable) ---------- components: Unicode messages: 391715 nosy: ezio.melotti, frederic.grosshans, vstinner priority: normal severity: normal status: open title: Add hangul syllables to unicodedata.decomposititon versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 13:57:39 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 23 Apr 2021 17:57:39 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619200659.71.0.955800649662.issue38659@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks a lot Ethan. I will wait then for the investigation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 14:03:33 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 18:03:33 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1619201013.66.0.523478282601.issue43921@roundup.psfhosted.org> Christian Heimes added the comment: New changeset e047239eafefe8b19725efffe7756443495cf78b by Christian Heimes in branch 'master': bpo-43921: ignore failing test_wrong_cert_tls13 on Windows (GH-25561) https://github.com/python/cpython/commit/e047239eafefe8b19725efffe7756443495cf78b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 14:05:18 2021 From: report at bugs.python.org (Julien Castiaux) Date: Fri, 23 Apr 2021 18:05:18 +0000 Subject: [issue43922] Double dots in quopri transported emails In-Reply-To: <1619188610.43.0.088106557205.issue43922@roundup.psfhosted.org> Message-ID: <1619201118.85.0.565429408976.issue43922@roundup.psfhosted.org> Change by Julien Castiaux : ---------- keywords: +patch pull_requests: +24281 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25562 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 14:08:02 2021 From: report at bugs.python.org (Julien Castiaux) Date: Fri, 23 Apr 2021 18:08:02 +0000 Subject: [issue43922] Double dots in quopri transported emails In-Reply-To: <1619188610.43.0.088106557205.issue43922@roundup.psfhosted.org> Message-ID: <1619201282.51.0.187813836654.issue43922@roundup.psfhosted.org> Julien Castiaux added the comment: Hello David, thank you for your quick answer. I tried to keep it minimal with some unittests. Could you point me some resources to learn how to properly write a custom content manager ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 14:09:24 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Apr 2021 18:09:24 +0000 Subject: [issue43284] sys.getwindowsversion().platform_version is incorrect In-Reply-To: <1613904146.72.0.850542213327.issue43284@roundup.psfhosted.org> Message-ID: <1619201364.7.0.00557903484376.issue43284@roundup.psfhosted.org> Steve Dower added the comment: New changeset 52e9031fbd23c10668badc2a72ee5c203d6902c7 by Miss Islington (bot) in branch '3.9': bpo-43284: Update platform.win32_ver to use _syscmd_ver instead of sys.getwindowsversion() (GH-25500) https://github.com/python/cpython/commit/52e9031fbd23c10668badc2a72ee5c203d6902c7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 14:12:51 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 23 Apr 2021 18:12:51 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619201571.34.0.327481413989.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Guido, I?ll prepare a separate PR for all converted built-in types, and you can decide what to do with it when consensus is reached :) There are approx. ~90 of these types. Not all of them are added to their respective module dicts though, but I would add the flag nonetheless, as it simplifies creating and reviewing the patch, and it does not have any performance impact. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 14:19:43 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 23 Apr 2021 18:19:43 +0000 Subject: [issue43924] print unexpected values in infinite loop Message-ID: <1619201983.54.0.995459222805.issue43924@roundup.psfhosted.org> New submission from Zachary Ware : Without a description, it is impossible to tell what you're trying to report. You'll need to provide some details, such as what you're trying to do, what you expected to happen, what actually happened, and how you ran the code to get that result. As is, I don't see anything wrong here. ---------- nosy: +zach.ware type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 14:21:54 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Apr 2021 18:21:54 +0000 Subject: [issue43607] urllib's request.pathname2url not compatible with extended-length Windows file paths In-Reply-To: <1616540209.08.0.34606490658.issue43607@roundup.psfhosted.org> Message-ID: <1619202114.02.0.519583294803.issue43607@roundup.psfhosted.org> Steve Dower added the comment: New changeset e92d1106291e5a7d4970372478f2882056b7eb3a by Miss Islington (bot) in branch '3.8': bpo-43607: Fix urllib handling of Windows paths with \\?\ prefix (GH-25539) https://github.com/python/cpython/commit/e92d1106291e5a7d4970372478f2882056b7eb3a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 14:27:25 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 23 Apr 2021 18:27:25 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1619202445.46.0.795091468994.issue42725@roundup.psfhosted.org> Batuhan Taskaya added the comment: I've posted an entry on python-dev to collect comments about how we should act (whether just act them as strings on the symbol table or just forbid them completely): https://mail.python.org/archives/list/python-dev at python.org/thread/5NQH5GURAYW6XINPBO6VSF45CWLQOHUQ/ Since we are almost days away from the cut, I will probably just submit a proper patch this weekend where we can debate more through reviews but first I need to know what kind of action we intend to take. (this all assumes PR 23952 is goes in). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 14:30:22 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 23 Apr 2021 18:30:22 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619202622.34.0.369350035385.issue43911@roundup.psfhosted.org> Raymond Hettinger added the comment: > I don't think this is necessarily specific to my local build Replace "local" with "specific to a particular combination of C compiler and operating system". On my Mac, the effect mostly doesn't occur as all, 0.05% before the run and 0.10% after the run. This shows that Python source isn't at fault. Also, since the same effect arises with a list of lists, we know that this isn't deque specific. It isn't even Python specific. For your OS and C compiler, it would happen to any C program that made the same pattern of calls to malloc() and free(). Memory allocators vary greatly in quality and in their response to particular load patterns. Fragmentation is a perpetual nuisance. > the alternative deque implementations don't seem > to suffer from the same issue This is unsurprising. Different patterns of memory access produce different random fragmentation artifacts. > I will continue and try to adapt alternate deque > implementations and see if it solves Queues leaking For your own project, consider: 1) Use a PriorityQueue adding elements with a counter or timestamp: mem.put((time(), msg)) ... _, msg = mem.get() 2) Build against a different memory allocator such dlmalloc. 3) Subclass Queue with some alternate structure that doesn't tickle the fragmentation issues on your O/S. Here's one to start with: class MyQueue(Queue): def _init(self, maxsize=0): assert not maxsize self.start = self.end = 0 self.q = {} def _qsize(self): return self.end - self.start def _put(self, x): self.q[self.end] = x self.end += 1 def _get(self): x = self.q.pop(self.start) self.start += 1 return x > and hanging my instances. I suspect that hanging is completely unrelated. The fragments we've studied don't hang. They just have the undesirable property that the process holds more memory blocks than expected. Those blocks are still available to Python for reuse. They just aren't available to other processes. Side note: While Python supports large queues, for most applications if the queue depth gets to 20 million, it is indicative of some other design flaw. > Thanks for your time and involvement in this. You're welcome. I wish the best for you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 14:47:42 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 23 Apr 2021 18:47:42 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1619203662.44.0.0486823625623.issue43921@roundup.psfhosted.org> Christian Heimes added the comment: Another TLS 1.3 client cert auth test is flaky, too. https://buildbot.python.org/all/#/builders/577/builds/14/steps/4/logs/stdio ====================================================================== FAIL: test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\pull_request.bolen-windows10\build\lib\test\test_ssl.py", line 4412, in test_pha_required_nocert s.recv(1024) AssertionError: SSLError not raised ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 14:53:46 2021 From: report at bugs.python.org (R. David Murray) Date: Fri, 23 Apr 2021 18:53:46 +0000 Subject: [issue43922] Double dots in quopri transported emails In-Reply-To: <1619188610.43.0.088106557205.issue43922@roundup.psfhosted.org> Message-ID: <1619204026.49.0.782459814916.issue43922@roundup.psfhosted.org> R. David Murray added the comment: As far as I know the only resources are the context manager docs and the source code. The stdlib content manager can serve as a model. I have to admit that it was long enough ago that I wrote that code that I'd have to re-read the docs and code myself to figure it out :) I'm afraid I don't really have time to do a complete review, but at a quick glance your patch doesn't look too complicated to me. Quick observation: the comment should explain why the dot check is done, and that it isn't needed for rfc compliance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 15:04:17 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 23 Apr 2021 19:04:17 +0000 Subject: [issue43894] IDLE editor file minor refactoring In-Reply-To: <1618935323.45.0.384862638375.issue43894@roundup.psfhosted.org> Message-ID: <1619204657.76.0.4507649406.issue43894@roundup.psfhosted.org> ?ric Araujo added the comment: Hello and thanks for wanting to contribute to Python! In the CPython project, stylistic changes are not made by themselves as a matter of course (accross the whole codebase or in a specific module): among reasons, these obfuscate file history, need reviewer time that takes away from other changes, and can introduce subtle bugs. Or in short: if it?s not broken, don?t fix it! This is different from other projects, especially those that have a smaller codebase, much less history than Python, and can agree on using some automated tool for trivial formatting changes. So if the changes here are not motivated by a bugfix or a new features, I think they should not be accepted. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 15:04:54 2021 From: report at bugs.python.org (Ian H) Date: Fri, 23 Apr 2021 19:04:54 +0000 Subject: [issue43895] Unnecessary Cache of Shared Object Handles In-Reply-To: <1618938051.55.0.304648722652.issue43895@roundup.psfhosted.org> Message-ID: <1619204694.55.0.992770142142.issue43895@roundup.psfhosted.org> Change by Ian H : ---------- keywords: +patch pull_requests: +24282 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25487 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 15:05:52 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 23 Apr 2021 19:05:52 +0000 Subject: [issue43895] Unnecessary Cache of Shared Object Handles In-Reply-To: <1618938051.55.0.304648722652.issue43895@roundup.psfhosted.org> Message-ID: <1619204752.62.0.886060502494.issue43895@roundup.psfhosted.org> Change by ?ric Araujo : ---------- nosy: +brett.cannon, eric.snow, ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 15:12:50 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 23 Apr 2021 19:12:50 +0000 Subject: [issue43923] Can't create generic NamedTuple as of py3.9 In-Reply-To: <1619194976.58.0.205362589455.issue43923@roundup.psfhosted.org> Message-ID: <1619205170.91.0.49292198367.issue43923@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 15:25:46 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 23 Apr 2021 19:25:46 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619205946.5.0.952981738428.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: BTW, slightly related, AFAICT: - https://github.com/python/cpython/blob/e047239eafefe8b19725efffe7756443495cf78b/Objects/typeobject.c#L4620-L4668 - bpo-24912 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 15:32:02 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 23 Apr 2021 19:32:02 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1619206322.35.0.266523086712.issue43914@roundup.psfhosted.org> ?ric Araujo added the comment: What a great, useful change! ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 15:36:58 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 23 Apr 2021 19:36:58 +0000 Subject: [issue30713] Reject newline character (U+000A) in URLs in urllib.parse In-Reply-To: <1497972033.13.0.439611221466.issue30713@psf.upfronthosting.co.za> Message-ID: <1619206618.34.0.879549705301.issue30713@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 15:38:04 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 23 Apr 2021 19:38:04 +0000 Subject: [issue43883] Making urlparse WHATWG conformant In-Reply-To: <1618775017.08.0.625993552954.issue43883@roundup.psfhosted.org> Message-ID: <1619206684.81.0.524407492596.issue43883@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 15:45:04 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 23 Apr 2021 19:45:04 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619207104.65.0.0551919788295.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: I've prepared a diff using grep & sed (see attached patch). Let me know if you want it converted to a PR. I've excluded the test and the _xx extension modules. ---------- Added file: https://bugs.python.org/file49979/apply-to-all.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 15:49:28 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 23 Apr 2021 19:49:28 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619207368.37.0.274657400067.issue43908@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : Added file: https://bugs.python.org/file49980/apply-to-all.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 15:49:19 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 23 Apr 2021 19:49:19 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619207359.03.0.492881537518.issue43908@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : Removed file: https://bugs.python.org/file49979/apply-to-all.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 15:57:26 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 23 Apr 2021 19:57:26 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619207846.59.0.227200154878.issue43911@roundup.psfhosted.org> Raymond Hettinger added the comment: Here's a more compact version of the variant with an underlying dict: class MyQueue(Queue): def _init(self, maxsize): self.end = 0 self.q = {} def _qsize(self): return len(self.q) def _put(self, x): self.q[self.end] = x self.end += 1 def _get(self): i = self.end - len(self.q) return self.q.pop(i) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 16:35:29 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 23 Apr 2021 20:35:29 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1619210129.53.0.547573692203.issue38605@roundup.psfhosted.org> Batuhan Taskaya added the comment: > Hopefully Batuhan has a recollection of what I am thinking of, there was some significant delay while we figured out what to do about some of these. The major one that I'd recall is that inspect.signature() just uses whatever is in __annotations__ instead of resolving those. Now that __future__.annotations is not the default one, we can add a new option named 'resolve_annotations' and call typing.get_type_hints when activated. Here is a quick demo; from __future__ import annotations import inspect def foo(a: int, b: int) -> str: ... def _get_annotations(func, **signature_opts): signature = inspect.signature(func, **signature_opts) return { param.name: param.annotation for param in signature.parameters.values() } print('bare: ', _get_annotations(foo)) print('annotations resolved: ', _get_annotations(foo, resolve_annotations=True)) bare: {'a': 'int', 'b': 'int'} annotations resolved: {'a': , 'b': } This would be a clear feature for both PEP 563 users + people who are still using string annotations mixed with normal ones. What do you think Guido? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 16:45:44 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 23 Apr 2021 20:45:44 +0000 Subject: [issue43926] Clean metadata (importlib_metadata 4.0) Message-ID: <1619210744.46.0.218619498947.issue43926@roundup.psfhosted.org> New submission from Jason R. Coombs : [importlib_metadata 4.0](https://importlib-metadata.readthedocs.io/en/latest/history.html#v4-0-0) introduced these important changes to the `metadata` function: ``PackageMetadata`` as returned by ``metadata()`` and ``Distribution.metadata()`` now provides normalized metadata honoring PEP 566: - If a long description is provided in the payload of the RFC 822 value, it can be retrieved as the ``Description`` field. - Any multi-line values in the metadata will be returned as such. - For any multi-line values, line continuation characters are removed. This backward-incompatible change means that any projects relying on the RFC 822 line continuation characters being present must be tolerant to them having been removed. - Add a ``json`` property that provides the metadata converted to a JSON-compatible form per PEP 566. These changes would be a nice addition to Python 3.10. ---------- assignee: jaraco components: Library (Lib) messages: 391733 nosy: jaraco priority: normal severity: normal status: open title: Clean metadata (importlib_metadata 4.0) type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 16:48:59 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Apr 2021 20:48:59 +0000 Subject: [issue39950] Add pathlib.Path.hardlink_to() In-Reply-To: <1584060605.38.0.95953512485.issue39950@roundup.psfhosted.org> Message-ID: <1619210939.87.0.416009438468.issue39950@roundup.psfhosted.org> miss-islington added the comment: New changeset f24e2e5464ba6498e7b8d73c3f9b417d59fd1b26 by Barney Gale in branch 'master': bpo-39950: add `pathlib.Path.hardlink_to()` method that supersedes `link_to()` (GH-18909) https://github.com/python/cpython/commit/f24e2e5464ba6498e7b8d73c3f9b417d59fd1b26 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 17:06:39 2021 From: report at bugs.python.org (Brett Cannon) Date: Fri, 23 Apr 2021 21:06:39 +0000 Subject: [issue43864] [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead In-Reply-To: <1618578775.46.0.785924432695.issue43864@roundup.psfhosted.org> Message-ID: <1619211999.57.0.0734538795877.issue43864@roundup.psfhosted.org> Change by Brett Cannon : ---------- keywords: +patch pull_requests: +24283 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25563 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 17:18:45 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 23 Apr 2021 21:18:45 +0000 Subject: [issue43894] IDLE editor file minor refactoring In-Reply-To: <1618935323.45.0.384862638375.issue43894@roundup.psfhosted.org> Message-ID: <1619212725.22.0.535116156845.issue43894@roundup.psfhosted.org> Terry J. Reedy added the comment: This started as an extraction and revision of changes in Tal's PR, one of which appeared to be an intended behavior change, that I requested there. Paine may have expanded the scope more than I intended. Will look soon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 17:23:39 2021 From: report at bugs.python.org (E. Paine) Date: Fri, 23 Apr 2021 21:23:39 +0000 Subject: [issue43894] IDLE editor file minor refactoring In-Reply-To: <1618935323.45.0.384862638375.issue43894@roundup.psfhosted.org> Message-ID: <1619213019.54.0.0245054971843.issue43894@roundup.psfhosted.org> E. Paine added the comment: I agree with your points and understand that there is good reason for the PR to be rejected. If Terry decides it's too big (I did do a lot more than what was originally in PR-22682), I am more than happy to close this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 17:27:31 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 23 Apr 2021 21:27:31 +0000 Subject: [issue43907] pickle.py bytearray memoization bug with protocol 5 In-Reply-To: <1619028495.22.0.0031927289703.issue43907@roundup.psfhosted.org> Message-ID: <1619213251.82.0.733671110869.issue43907@roundup.psfhosted.org> Antoine Pitrou added the comment: New changeset 1e9f0933095403b215c2c4a0be7915d034ff7026 by Carl Friedrich Bolz-Tereick in branch 'master': bpo-43907: add missing memoize call in pure python pickling of bytearray (GH-25501) https://github.com/python/cpython/commit/1e9f0933095403b215c2c4a0be7915d034ff7026 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 17:28:19 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 23 Apr 2021 21:28:19 +0000 Subject: [issue43907] pickle.py bytearray memoization bug with protocol 5 In-Reply-To: <1619028495.22.0.0031927289703.issue43907@roundup.psfhosted.org> Message-ID: <1619213299.07.0.15519002754.issue43907@roundup.psfhosted.org> Antoine Pitrou added the comment: Thanks for the report and fix! ---------- components: +Library (Lib) resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 17:36:05 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Apr 2021 21:36:05 +0000 Subject: [issue40432] Pegen regenerate project for Windows not working In-Reply-To: <1588127830.15.0.595745305392.issue40432@roundup.psfhosted.org> Message-ID: <1619213765.52.0.0118168755131.issue40432@roundup.psfhosted.org> Steve Dower added the comment: Thanks for the PR, kj! Left a suggestion for you, but otherwise it should solve the problem nicely. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 17:36:33 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Apr 2021 21:36:33 +0000 Subject: [issue43762] Add audit events for loading of sqlite3 extensions In-Reply-To: <1617792679.62.0.407303342016.issue43762@roundup.psfhosted.org> Message-ID: <1619213793.19.0.568479363478.issue43762@roundup.psfhosted.org> Steve Dower added the comment: Left some minor suggestions on the PR, but wanted to copy this comment here as well: I wonder if it's worth returning the connection object when it's created (through a new event in module.c) and then reference it in these events? That can then correlate these (and other) events with the file - we do this already for sockets. After some thought, I think it's probably not worth it for these ones. The important information is in the extension being loaded, and it doesn't really relate to the connection at all. However, if we wanted to add it later, we couldn't. So might be worth doing now? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 17:41:34 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Apr 2021 21:41:34 +0000 Subject: [issue43652] Upgrade Windows tcl/tk to 8.6.11 In-Reply-To: <1617001631.71.0.115330422511.issue43652@roundup.psfhosted.org> Message-ID: <1619214094.7.0.0942451206675.issue43652@roundup.psfhosted.org> Steve Dower added the comment: Thanks for finishing up that patch. And yes, we add a ".0" in case we need to patch the sources ourselves. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 17:44:58 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 23 Apr 2021 21:44:58 +0000 Subject: [issue43926] Clean metadata (importlib_metadata 4.0) In-Reply-To: <1619210744.46.0.218619498947.issue43926@roundup.psfhosted.org> Message-ID: <1619214298.45.0.476691738647.issue43926@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- keywords: +patch pull_requests: +24284 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25565 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 17:48:50 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 23 Apr 2021 21:48:50 +0000 Subject: [issue42361] Use Tcl/Tk 8.6.10 in build-installer.py when building on recent macOS In-Reply-To: <1605443356.85.0.637246166587.issue42361@roundup.psfhosted.org> Message-ID: <1619214530.68.0.788311219509.issue42361@roundup.psfhosted.org> Terry J. Reedy added the comment: Close this? Upgrade done, twice. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 17:51:17 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Apr 2021 21:51:17 +0000 Subject: =?utf-8?b?W2lzc3VlNDM2NDldIHRpbWUuc3RyZnRpbWUoJyV6JykgZG9lc24ndCByZXR1?= =?utf-8?q?rn_UTC_offset_in_the_form_=C2=B1HHMM?= In-Reply-To: <1616955797.13.0.901128004161.issue43649@roundup.psfhosted.org> Message-ID: <1619214677.23.0.275434357732.issue43649@roundup.psfhosted.org> Steve Dower added the comment: I agree with Eryk, this is not an issue with the supported C runtime. mingw-w64 has supposedly been working on UCRT support (it may even be working already?), and that is what will be necessary. We certainly aren't going to try and runtime detect this and reimplement it in the stdlib. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 17:51:05 2021 From: report at bugs.python.org (Tim Huegerich) Date: Fri, 23 Apr 2021 21:51:05 +0000 Subject: [issue43927] Remove IOError references from the tutorial Message-ID: <1619214665.17.0.886781359628.issue43927@roundup.psfhosted.org> New submission from Tim Huegerich : Although IOError has been merged into OSError since version 3.3, Section 8.5 of the Tutorial still uses it in examples. The Python 9.4 version of the tutorial features an example raising an IOError, which is then output as OSError, raising potential confusion unnecessarily. The Python 3.10 documentation has partially resolved this issue but still retains a third instance of IOError. In this case, the IOError Exception is not actually raised, so the potentially confusing output is not present. Still, it seems preferable to remove it entirely. ---------- assignee: docs at python components: Documentation messages: 391743 nosy: docs at python, hugetim priority: normal severity: normal status: open title: Remove IOError references from the tutorial type: enhancement versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 18:00:37 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Apr 2021 22:00:37 +0000 Subject: [issue30555] _io._WindowsConsoleIO breaks in the face of fd redirection In-Reply-To: <1496422613.2.0.0803212432553.issue30555@psf.upfronthosting.co.za> Message-ID: <1619215237.38.0.235852363299.issue30555@roundup.psfhosted.org> Steve Dower added the comment: New changeset 5e437fb872279960992c9a07f1a4c051b4948c53 by Segev Finer in branch 'master': bpo-30555: Fix WindowsConsoleIO fails in the presence of fd redirection (GH-1927) https://github.com/python/cpython/commit/5e437fb872279960992c9a07f1a4c051b4948c53 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 18:04:03 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 23 Apr 2021 22:04:03 +0000 Subject: [issue30555] _io._WindowsConsoleIO breaks in the face of fd redirection In-Reply-To: <1496422613.2.0.0803212432553.issue30555@psf.upfronthosting.co.za> Message-ID: <1619215443.03.0.170801190966.issue30555@roundup.psfhosted.org> Steve Dower added the comment: Thanks for persisting with this change. Looks like backports will have to be manual, and I'm not going to get to them today myself, but if someone else wants to do it then feel free. I'm pretty sure this won't have any (negative) visible impact, but just in case, let's let a 3.10 release go out with it before merging the backports. I'd rather have no change in earlier versions than a regression. ---------- stage: patch review -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 18:06:48 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 23 Apr 2021 22:06:48 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1619215608.19.0.7793659668.issue42725@roundup.psfhosted.org> Larry Hastings added the comment: I think stringized annotations should prohibit the same things PEP 649 prohibits: walrus, yield / yield from, and await. This was easy in my 649 branch; walrus adds locals, and yield / yield from make it a generator. So the code raises an error if the generated annotations code object has locals or is a generator. I don't think I had to do anything special to prohibit await, because that's only valid in a function declared "async def", which annotations code objects are not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 18:08:40 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 23 Apr 2021 22:08:40 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1619215720.43.0.163469310683.issue42725@roundup.psfhosted.org> Batuhan Taskaya added the comment: > This was easy in my 649 branch; walrus adds locals, and yield / yield from make it a generator. So the code raises an error if the generated annotations code object has locals or is a generator. I don't think I had to do anything special to prohibit await, because that's only valid in a function declared "async def", which annotations code objects are not. The implementation I have right now just adds a new state to the symbol table, and raises error in the visitors (like switch Yield, YieldFrom etc). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 18:08:51 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 23 Apr 2021 22:08:51 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619215731.24.0.72544051348.issue38659@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +24285 pull_request: https://github.com/python/cpython/pull/25566 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 18:45:27 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 23 Apr 2021 22:45:27 +0000 Subject: [issue43652] Upgrade Windows tcl/tk to 8.6.11 In-Reply-To: <1617001631.71.0.115330422511.issue43652@roundup.psfhosted.org> Message-ID: <1619217927.98.0.814098488495.issue43652@roundup.psfhosted.org> Terry J. Reedy added the comment: Previous issue, which I mistyped, was #39107. Release notes at https://sourceforge.net/projects/tcl/files/Tcl/8.6.11/tcltk-release-notes-8.6.11.txt/view ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 18:56:45 2021 From: report at bugs.python.org (Zackery Spytz) Date: Fri, 23 Apr 2021 22:56:45 +0000 Subject: [issue41277] documentation: os.setxattr() errno EEXIST and ENODATA In-Reply-To: <1594446359.56.0.57719330174.issue41277@roundup.psfhosted.org> Message-ID: <1619218605.3.0.695060239923.issue41277@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 2.0 -> 3.0 pull_requests: +24286 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25567 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 19:23:25 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 23 Apr 2021 23:23:25 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1619220205.21.0.409265490599.issue42725@roundup.psfhosted.org> Larry Hastings added the comment: Wouldn't it be easier to just throw an exception in the stringizing code? I note that there are dedicated functions to generate walrus, yield, yield from, and await in Python/ast_unparse.c. In theory this is a general-purpose facility, but in practice it's not part of the limited API, and it's called from literally one place, the "stringize this annotation" call site inside compile.c. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 21:29:33 2021 From: report at bugs.python.org (mkocher) Date: Sat, 24 Apr 2021 01:29:33 +0000 Subject: [issue43776] Popen with shell=True yield mangled repr output In-Reply-To: <1617907343.84.0.247878991461.issue43776@roundup.psfhosted.org> Message-ID: <1619227773.57.0.546540465076.issue43776@roundup.psfhosted.org> mkocher added the comment: There's a PR up with removed `list` call as well as improved test coverage for the case where args is passed into Popen as a string. Hopefully this can get merged before things starting getting crazy with the 3.10 release crunch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 21:29:54 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 24 Apr 2021 01:29:54 +0000 Subject: [issue43924] print unexpected values in infinite loop In-Reply-To: <1619201983.54.0.995459222805.issue43924@roundup.psfhosted.org> Message-ID: <1619227794.98.0.0558999817998.issue43924@roundup.psfhosted.org> Steven D'Aprano added the comment: I'm closing this as "Works for me". rafihassan190041234, if you still think it is a bug in the language, rather than a bug in your code or a mistake in your understanding, you can re-open this with more details. As Zach already commented, you need to give us an explanation of: - what you expected the code to do; - why you expected that; - what it actually did instead; - your environment (did you run this in an IDE, the plain Python interactive interpreter, from a script, something else?); - and your operating system. ---------- nosy: +steven.daprano resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 22:08:40 2021 From: report at bugs.python.org (Ethan Furman) Date: Sat, 24 Apr 2021 02:08:40 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619230120.3.0.839669175324.issue38659@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 6c681e1a4aa2dbca61be9a26c9257d7d25fa29a7 by Ethan Furman in branch 'master': bpo-38659: [Enum] do not check '_inverted_' during simple test (GH-25566) https://github.com/python/cpython/commit/6c681e1a4aa2dbca61be9a26c9257d7d25fa29a7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 22:21:41 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 24 Apr 2021 02:21:41 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1619230901.54.0.238952923514.issue42725@roundup.psfhosted.org> Guido van Rossum added the comment: So shouldn't we just rule out some specific bits of syntax in annotations? That can be done after the PEG grammar has accepted them, otherwise we'd end up having a whole new expression-like grammar section that excludes them. I think this is the list we should exclude, right? - yield [from] - walrus - await (?) I agree await technically doesn't need to be in this list, so maybe we shouldn't explicitly exclude it -- it's no different than writing def f(x: open(filename).read()): ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 23:38:51 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 24 Apr 2021 03:38:51 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1619235531.52.0.87019021661.issue38605@roundup.psfhosted.org> Guido van Rossum added the comment: I don't like adding a flag. In the PEP-563-by-default world we didn't need a flag. Perhaps once Larry implements inspect.get_annotations() (issue43817) we can make inspect.signature() always call that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 23:51:30 2021 From: report at bugs.python.org (Jeffrey Tse) Date: Sat, 24 Apr 2021 03:51:30 +0000 Subject: [issue43928] Fix the typo in documentation Message-ID: <1619236290.61.0.108206322719.issue43928@roundup.psfhosted.org> Change by Jeffrey Tse : ---------- assignee: docs at python components: Documentation nosy: docs at python, jeffreytse.mail priority: normal severity: normal status: open title: Fix the typo in documentation versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 23 23:56:43 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 24 Apr 2021 03:56:43 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619236603.04.0.255133393641.issue43908@roundup.psfhosted.org> Guido van Rossum added the comment: Does the test suite pass for apply-to-all.diff? Also, quite a hornet's nest you've uncovered (about __class__ assignment). Would that be fixed better with the IMMUTABLE flag? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 00:05:53 2021 From: report at bugs.python.org (Roundup Robot) Date: Sat, 24 Apr 2021 04:05:53 +0000 Subject: [issue43928] Fix the typo in documentation Message-ID: <1619237153.19.0.188411336019.issue43928@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +24287 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25568 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 00:26:54 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 24 Apr 2021 04:26:54 +0000 Subject: [issue43928] Fix the typo in documentation Message-ID: <1619238414.45.0.3876600418.issue43928@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 00:38:00 2021 From: report at bugs.python.org (mkocher) Date: Sat, 24 Apr 2021 04:38:00 +0000 Subject: [issue43776] Popen with shell=True yield mangled repr output In-Reply-To: <1617907343.84.0.247878991461.issue43776@roundup.psfhosted.org> Message-ID: <1619239080.61.0.902216297165.issue43776@roundup.psfhosted.org> mkocher added the comment: There also appears to be an issue when args are provided as a `pathlib.Path` instance. Python 3.9.2 | packaged by conda-forge | (default, Feb 21 2021, 05:02:20) Type 'copyright', 'credits' or 'license' for more information IPython 7.22.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: from subprocess import Popen In [2]: from pathlib import Path In [3]: p = Path('/usr/local/bin/gtrue') In [4]: x = Popen(p) In [5]: repr(x) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) in ----> 1 repr(x) ~/opt/miniconda3/envs/core/lib/python3.9/subprocess.py in __repr__(self) 990 obj_repr = ( 991 f"<{self.__class__.__name__}: " --> 992 f"returncode: {self.returncode} args: {list(self.args)!r}>" 993 ) 994 if len(obj_repr) > 80: TypeError: 'PosixPath' object is not iterable ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 00:46:08 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 24 Apr 2021 04:46:08 +0000 Subject: [issue31870] add timeout parameter for get_server_certificate in ssl.py In-Reply-To: <1508991085.56.0.213398074469.issue31870@psf.upfronthosting.co.za> Message-ID: <1619239568.66.0.621282206856.issue31870@roundup.psfhosted.org> miss-islington added the comment: New changeset b2fac1afaa7c0d41a263781fcf94d8a92dc31b48 by Zackery Spytz in branch 'master': bpo-31870: Add a timeout parameter to ssl.get_server_certificate() (GH-22270) https://github.com/python/cpython/commit/b2fac1afaa7c0d41a263781fcf94d8a92dc31b48 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 00:49:33 2021 From: report at bugs.python.org (Jeffrey Tse) Date: Sat, 24 Apr 2021 04:49:33 +0000 Subject: [issue43928] Fix the typo in documentation Message-ID: <1619239773.83.0.90886420829.issue43928@roundup.psfhosted.org> Change by Jeffrey Tse : ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 00:53:43 2021 From: report at bugs.python.org (Larry Hastings) Date: Sat, 24 Apr 2021 04:53:43 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619240023.24.0.329083531045.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: Time runs short for Python 3.10b1. Can I get a review from anybody here, say over the weekend? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 00:57:49 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 24 Apr 2021 04:57:49 +0000 Subject: [issue31870] add timeout parameter for get_server_certificate in ssl.py In-Reply-To: <1508991085.56.0.213398074469.issue31870@psf.upfronthosting.co.za> Message-ID: <1619240269.33.0.0970459825073.issue31870@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 01:02:41 2021 From: report at bugs.python.org (Jeffrey Tse) Date: Sat, 24 Apr 2021 05:02:41 +0000 Subject: [issue43928] Fix the typo in documentation Message-ID: <1619240561.12.0.560211686846.issue43928@roundup.psfhosted.org> Change by Jeffrey Tse : ---------- pull_requests: +24288 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/25569 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 01:24:54 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 24 Apr 2021 05:24:54 +0000 Subject: [issue31870] add timeout parameter for get_server_certificate in ssl.py In-Reply-To: <1508991085.56.0.213398074469.issue31870@psf.upfronthosting.co.za> Message-ID: <1619241894.37.0.194139424114.issue31870@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24289 pull_request: https://github.com/python/cpython/pull/25570 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 01:54:11 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 24 Apr 2021 05:54:11 +0000 Subject: [issue31870] add timeout parameter for get_server_certificate in ssl.py In-Reply-To: <1508991085.56.0.213398074469.issue31870@psf.upfronthosting.co.za> Message-ID: <1619243651.23.0.521700344563.issue31870@roundup.psfhosted.org> Christian Heimes added the comment: New changeset f05c2aed7e25087122613b51f152919c79641f66 by Christian Heimes in branch 'master': bpo-31870: Fix test_get_server_certificate_timeout on Windows (GH-25570) https://github.com/python/cpython/commit/f05c2aed7e25087122613b51f152919c79641f66 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 03:17:59 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 24 Apr 2021 07:17:59 +0000 Subject: [issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning In-Reply-To: <1560803734.85.0.206698450732.issue37322@roundup.psfhosted.org> Message-ID: <1619248679.67.0.810239714261.issue37322@roundup.psfhosted.org> Christian Heimes added the comment: New changeset c8666cfa7cdc48915a14cd16095a69029720736a by Christian Heimes in branch 'master': bpo-37322: Fix ResourceWarning and exception handling in test (GH-25553) https://github.com/python/cpython/commit/c8666cfa7cdc48915a14cd16095a69029720736a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 03:22:30 2021 From: report at bugs.python.org (Larry Hastings) Date: Sat, 24 Apr 2021 07:22:30 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619248950.68.0.867743678973.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: > I?d say that best practices for 3.9+ are more useful. My point in writing this up was that the best practices change as of 3.10. So, I could add a section to the Python 3.10 documentation giving best practices for 3.10+ and 3.9-. But 3.9 and 3.10 have different best practices. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 03:25:12 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 24 Apr 2021 07:25:12 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1619249112.82.0.0145679851686.issue41282@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24290 pull_request: https://github.com/python/cpython/pull/25571 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 03:27:28 2021 From: report at bugs.python.org (Inada Naoki) Date: Sat, 24 Apr 2021 07:27:28 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619249248.35.0.0493393632863.issue43817@roundup.psfhosted.org> Inada Naoki added the comment: I'm not sure `ONLY_IF_ALL_STR` is worth enough. Will anyone use it after Python 3.10? inspect.signature()? Pydantic? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 03:40:04 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 24 Apr 2021 07:40:04 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1619250004.8.0.00365813905687.issue42725@roundup.psfhosted.org> Batuhan Taskaya added the comment: > That can be done after the PEG grammar has accepted them But wouldn't we still end up with maintaining a custom flag to see if we are in annotation (e.g a: Something((yield) + 2)) and act upon that which would seem to do a bit messy in the grammar actions rather than just throwing syntax errors from switch/cases inside of symbol table? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 03:41:23 2021 From: report at bugs.python.org (Larry Hastings) Date: Sat, 24 Apr 2021 07:41:23 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619250083.83.0.296250642789.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: For what it's worth: I changed the name to ONLY_IF_STRINGIZED in the PR. Since I propose that it be the default, everyone who called inspect.get_annotations(), and inspect.signature(), would use it. I think Pydantic would prefer it, because Pydantic wants to see the real objects at runtime, rather than the stringized annotations. If stringized annotations were deprecated in the future, then eval_str should be deprecated at the same time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 03:47:26 2021 From: report at bugs.python.org (Inada Naoki) Date: Sat, 24 Apr 2021 07:47:26 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619250446.33.0.481220364089.issue43817@roundup.psfhosted.org> Inada Naoki added the comment: > I think Pydantic would prefer it, because Pydantic wants to see the real objects at runtime, rather than the stringized annotations. If so, why don't they use `eval_str=True`? I can not find any use cases where `eval_str= ONLY_IF_ALL_STR` is better than `eval_str=True`. On the other hand, I think "return string annotation instead of raising error when eval failed" option is useful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 03:51:34 2021 From: report at bugs.python.org (Larry Hastings) Date: Sat, 24 Apr 2021 07:51:34 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619250694.69.0.882534696114.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: The difference between eval_str=True and eval_str=ONLY_IF_STRINGIZED: def foo(a:int, b:"howdy howdy"): ... inspect.get_annotations(foo, eval_str=True) throws an exception. inspect.get_annotations(foo, eval_str=ONLY_IF_STRINGIZED) returns {'a': int, b: 'howdy howdy'} Type hints have a convention that string annotations are a "forward declaration" and should be eval()uated. Annotations don't have such a convention--a string is a legal annotation, and is not required to be valid Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 03:55:40 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 24 Apr 2021 07:55:40 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1619250940.84.0.541839463728.issue41282@roundup.psfhosted.org> Christian Heimes added the comment: New changeset a460ab3134cd5cf3932c2125aec012851268f0cc by Christian Heimes in branch 'master': bpo-41282: Consistent message and filter warning in setup.py (GH-25571) https://github.com/python/cpython/commit/a460ab3134cd5cf3932c2125aec012851268f0cc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 03:56:55 2021 From: report at bugs.python.org (Inada Naoki) Date: Sat, 24 Apr 2021 07:56:55 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1619250694.69.0.882534696114.issue43817@roundup.psfhosted.org> Message-ID: Inada Naoki added the comment: > > The difference between eval_str=True and eval_str=ONLY_IF_STRINGIZED: > > def foo(a:int, b:"howdy howdy"): ... > > inspect.get_annotations(foo, eval_str=True) throws an exception. > inspect.get_annotations(foo, eval_str=ONLY_IF_STRINGIZED) returns {'a': int, b: 'howdy howdy'} > > Type hints have a convention that string annotations are a "forward declaration" and should be eval()uated. Annotations don't have such a convention--a string is a legal annotation, and is not required to be valid Python. > For such use case, ONLY_IF_STRINGIZED thorows an exception for `def foo(a: "howdy howdy")` anyway. In such cases, they should use `eval_str=False`, or `eval_str=True` *and* `return_str_when_eval_failed=True` option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 04:03:33 2021 From: report at bugs.python.org (Larry Hastings) Date: Sat, 24 Apr 2021 08:03:33 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619251413.16.0.58656680463.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: Perhaps eval_str=ONLY_IF_STRINGIZED should also add the semantics "if evaluating any string fails, behave as if eval_str=false". I would *not* propose adding that for eval_str=true. But people keep asking for this. Hmm. The heuristic is a tricky thing. That's why in my "PEP 1212" idea I proposed a way that a function like get_annotations() could determine unambiguously whether or not the annotations for an object were stringized. (And, if we did do something like that in a future Python version, this would also change the "if evaluating any string fails" behavior I just proposed.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 04:36:11 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 24 Apr 2021 08:36:11 +0000 Subject: [issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning In-Reply-To: <1560803734.85.0.206698450732.issue37322@roundup.psfhosted.org> Message-ID: <1619253371.27.0.143132817034.issue37322@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24292 pull_request: https://github.com/python/cpython/pull/25573 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 04:36:01 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 24 Apr 2021 08:36:01 +0000 Subject: [issue37322] test_ssl: test_pha_required_nocert() emits a ResourceWarning In-Reply-To: <1560803734.85.0.206698450732.issue37322@roundup.psfhosted.org> Message-ID: <1619253361.39.0.499008108858.issue37322@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24291 pull_request: https://github.com/python/cpython/pull/25572 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 06:22:33 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 24 Apr 2021 10:22:33 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1619259753.12.0.435208117291.issue43921@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24293 pull_request: https://github.com/python/cpython/pull/25574 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 06:39:43 2021 From: report at bugs.python.org (Aritn Sarraf) Date: Sat, 24 Apr 2021 10:39:43 +0000 Subject: [issue43929] Raise on threading.Event.__bool__ due to ambiguous nature Message-ID: <1619260783.59.0.920057566197.issue43929@roundup.psfhosted.org> New submission from Aritn Sarraf : I'll sometimes find myself accidentally doing something like this (especially after a long break from using the threading module): ``` stop_thread = threading.Event() ... while not stop_thread: # bug - bool(stop_thread) will always evaluate to True ... ``` Since the intention behind bool(event) is ambiguous and most likely often used improperly, I think that it would be a good idea to protect against this easy to produce bug, by overriding __bool__ to raise. There is precedent for this behavior in the popular numpy library, see here: https://github.com/numpy/numpy/blob/623bc1fae1d47df24e7f1e29321d0c0ba2771ce0/numpy/core/src/multiarray/number.c#L829 Expanding on my thoughts: 1) Most operations on a threading.Event are associated with checking the truthiness of the underlying state of the Event. Meaning that there are many opportunities for bool(event) to be called improperly. 2) I can't think of any cases where you would want to evaluate truthiness on anything other than the underlying "set" state of the Event. The one exception I can think of being the following (however, I believe this is generally accepted to be an anti-pattern, which I don't think should be considered a redeeming case for allowing bool(event)): ``` def my_func(event=None): event = event or threading.Event() ... ``` 3) It is an easy addition to protect against this. Simply by raising in __bool__ 4) The only backwards incompatibilities this could create are in cases where the event is being evaluated for truthiness incorrectly, and in the anti-pattern case described in point 2. ---------- components: Library (Lib) messages: 391771 nosy: asarraf priority: normal severity: normal status: open title: Raise on threading.Event.__bool__ due to ambiguous nature type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 06:43:07 2021 From: report at bugs.python.org (artin sarraf) Date: Sat, 24 Apr 2021 10:43:07 +0000 Subject: [issue43929] Raise on threading.Event.__bool__ due to ambiguous nature In-Reply-To: <1619260783.59.0.920057566197.issue43929@roundup.psfhosted.org> Message-ID: <1619260987.51.0.772540332403.issue43929@roundup.psfhosted.org> Change by artin sarraf : ---------- keywords: +patch nosy: +sarf nosy_count: 1.0 -> 2.0 pull_requests: +24294 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25575 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 06:50:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 24 Apr 2021 10:50:25 +0000 Subject: [issue27521] Misleading compress level header on files created with gzip In-Reply-To: <1468603610.22.0.92461778532.issue27521@psf.upfronthosting.co.za> Message-ID: <1619261425.57.0.812966807764.issue27521@roundup.psfhosted.org> Irit Katriel added the comment: I believe this was fixed here: https://github.com/python/cpython/pull/18077 ---------- nosy: +iritkatriel resolution: -> duplicate status: open -> pending superseder: -> gzip metadata fails to reflect compresslevel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 07:06:24 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 24 Apr 2021 11:06:24 +0000 Subject: [issue16386] imp.find_module does not specify registry key it searches on windows In-Reply-To: <1351859767.89.0.815277454803.issue16386@psf.upfronthosting.co.za> Message-ID: <1619262384.57.0.984550089268.issue16386@roundup.psfhosted.org> Irit Katriel added the comment: Both http://docs.python.org/3/library/importlib.html#importlib.machinery.WindowsRegistryFinder and http://docs.python.org/3/library/imp.html#imp.find_module: are now deprecated. Is this issue still relevant? ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 08:20:39 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 24 Apr 2021 12:20:39 +0000 Subject: [issue43929] Raise on threading.Event.__bool__ due to ambiguous nature In-Reply-To: <1619260783.59.0.920057566197.issue43929@roundup.psfhosted.org> Message-ID: <1619266839.85.0.64906515796.issue43929@roundup.psfhosted.org> Steven D'Aprano added the comment: This is not a bug fix, it is a change of behaviour ("enhancement"). All of 3.6 through 3.9 are in feature freeze. 3.10 is probably in feature freeze, but if not it is extremely close to it. So this can only go into 3.11 and (maybe) 3.10. But I don't think this is a good enhancement. I am sorry that you keep making the mistake of wrongly assuming that you can use threading Events that way, but your mistake is not necessarily a flaw in the object. Is there anything in the documentation that leads you to believe that Events are intended to be used that way? The basic object model of Python is that all objects can be duck-typed as bools, that is they are either truthy or falsey. Values which represent "nothing" in some sense (empty containers, zero numbers, None) should evaluate as False; values which represent "something" (non-empty containers, non-zero numbers, arbitrary objects) should evaluate as True. This model goes back to the earliest days of Python 1.x before we even had a bool type or True and False singletons, and 1 and 0 where used instead. `bool(obj)` is a fundamental operation, like `print(obj)`, which should never fail. You say: "the intention behind bool(event) is ambiguous" but I don't believe that is correct. Unless documented differently, the intention behind bool(event) is: - events are not containers; - or numbers; - but they are "things" (objects); - and so they should evaluate as True. So unless you can provide evidence for this ambiguity, or evidence that many other people make this same mistake, I will recommend this issue be closed. ---------- nosy: +steven.daprano type: behavior -> enhancement versions: -Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 09:08:16 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 24 Apr 2021 13:08:16 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1619269696.46.0.895648333124.issue43921@roundup.psfhosted.org> Christian Heimes added the comment: New changeset ce9a0643496ba802ea97a3da20eace3a1117ea48 by Christian Heimes in branch 'master': bpo-43921: also accept EOF in post-handshake auth test (GH-25574) https://github.com/python/cpython/commit/ce9a0643496ba802ea97a3da20eace3a1117ea48 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 09:09:34 2021 From: report at bugs.python.org (=?utf-8?b?RnLDqWTDqXJpYyBHcm9zc2hhbnMtQW5kcsOp?=) Date: Sat, 24 Apr 2021 13:09:34 +0000 Subject: [issue43520] Make Fraction(string) handle non-ascii slashes In-Reply-To: <1615918144.03.0.939769511159.issue43520@roundup.psfhosted.org> Message-ID: <1619269774.39.0.444772408084.issue43520@roundup.psfhosted.org> Fr?d?ric Grosshans-Andr? added the comment: @Gregory P. Smith unicodedata.numeric, in the sdandard library, already handles non-Ascii fractions in many scripts. The current ?problem? is it outputs a float (even for integers): >>> unicodedata.numeric('?') 0.6666666666666666 The UnicodeData.txt file from the Unicode standard it takes its data from, however, contains the corresponding ?ascii fractions?. For example, below are two lines of this file for two (very) different ways of encoding two thirds 2154;VULGAR FRACTION TWO THIRDS;No;0;ON; 0032 2044 0033;;;2/3;N;FRACTION TWO THIRDS;;;; 1245B;CUNEIFORM NUMERIC SIGN TWO THIRDS DISH;Nl;0;L;;;;2/3;N;;;;; Adding an exact value extraction to unicodedata should be doable, either via an function or an extra keyword to the unicodedata.numeric function. The only information that would be lost (but which is unavailable now anyway) would be for the few codepoints which encode reducible fractions. As of unicode 13.0, these codepoints are * ? U+2189 VULGAR FRACTION ZERO THIRDS * ? U+109F7 MEROITIC CURSIVE FRACTION TWO TWELFTHS * ? U+109F8 MEROITIC CURSIVE FRACTION THREE TWELFTHS * ? U+109F9 MEROITIC CURSIVE FRACTION FOUR TWELFTHS * ? U+109FB MEROITIC CURSIVE FRACTION SIX TWELFTHS * ? U+109FD MEROITIC CURSIVE FRACTION EIGHT TWELFTHS * ? U+109FE MEROITIC CURSIVE FRACTION NINE TWELFTHS * ? U+109FF MEROITIC CURSIVE FRACTION TEN TWELFTHS ---------- nosy: +frederic.grosshans _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 10:13:55 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Sat, 24 Apr 2021 14:13:55 +0000 Subject: [issue43930] Update bundled pip to 21.1 and setuptools to 56.0.0 Message-ID: <1619273635.66.0.622596591495.issue43930@roundup.psfhosted.org> New submission from St?phane Bidoul : I've just released pip 21.1, so this is to update the bundled copy (as well as updating setuptools). ---------- components: Library (Lib) messages: 391777 nosy: sbidoul priority: normal severity: normal status: open title: Update bundled pip to 21.1 and setuptools to 56.0.0 versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 10:14:13 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 24 Apr 2021 14:14:13 +0000 Subject: [issue43780] Sync importlib_metadata enhancements through 3.10. In-Reply-To: <1617925916.07.0.133652663909.issue43780@roundup.psfhosted.org> Message-ID: <1619273653.54.0.169976582051.issue43780@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset c6ca368867bd68d44f333df840aa85d425a51410 by Jason R. Coombs in branch 'master': bpo-43780: Sync with importlib_metadata 3.10 (GH-25297) https://github.com/python/cpython/commit/c6ca368867bd68d44f333df840aa85d425a51410 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 10:14:42 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Sat, 24 Apr 2021 14:14:42 +0000 Subject: [issue43930] Update bundled pip to 21.1 and setuptools to 56.0.0 In-Reply-To: <1619273635.66.0.622596591495.issue43930@roundup.psfhosted.org> Message-ID: <1619273682.58.0.678741345075.issue43930@roundup.psfhosted.org> Change by St?phane Bidoul : ---------- nosy: +dstufft, ncoghlan, paul.moore, pradyunsg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 10:18:42 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Sat, 24 Apr 2021 14:18:42 +0000 Subject: [issue43930] Update bundled pip to 21.1 and setuptools to 56.0.0 In-Reply-To: <1619273635.66.0.622596591495.issue43930@roundup.psfhosted.org> Message-ID: <1619273922.47.0.890256023576.issue43930@roundup.psfhosted.org> Change by St?phane Bidoul : ---------- keywords: +patch pull_requests: +24296 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25576 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 10:26:11 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Sat, 24 Apr 2021 14:26:11 +0000 Subject: [issue43930] Update bundled pip to 21.1 and setuptools to 56.0.0 In-Reply-To: <1619273635.66.0.622596591495.issue43930@roundup.psfhosted.org> Message-ID: <1619274371.25.0.653594166993.issue43930@roundup.psfhosted.org> Change by St?phane Bidoul : ---------- nosy: +Marcus.Smith -sbidoul _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 10:37:54 2021 From: report at bugs.python.org (Gabriele N Tornetta) Date: Sat, 24 Apr 2021 14:37:54 +0000 Subject: [issue43931] Add the Python version to the API data. Message-ID: <1619275074.12.0.00901483534926.issue43931@roundup.psfhosted.org> New submission from Gabriele N Tornetta : When Python is embedded in other applications, it is not easy to determine which version of Python is being used. This change exposes the Python version as part of the API data. Tools like Austin (https://github.com/P403n1x87/austin) can benefit from this data when targeting applications like uWSGI, as the Python version can then be inferred systematically by looking at the exported symbols rather than relying on unreliable pattern matching or other hacks (like remote code execution etc...). ---------- components: C API messages: 391779 nosy: Gabriele Tornetta priority: normal severity: normal status: open title: Add the Python version to the API data. type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 10:40:43 2021 From: report at bugs.python.org (Gabriele N Tornetta) Date: Sat, 24 Apr 2021 14:40:43 +0000 Subject: [issue43931] Add the Python version to the API data. In-Reply-To: <1619275074.12.0.00901483534926.issue43931@roundup.psfhosted.org> Message-ID: <1619275243.0.0.184488032596.issue43931@roundup.psfhosted.org> Change by Gabriele N Tornetta : ---------- keywords: +patch pull_requests: +24297 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25577 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 10:55:12 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 24 Apr 2021 14:55:12 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1619276112.43.0.213651858664.issue42725@roundup.psfhosted.org> Guido van Rossum added the comment: I don?t really care how you do it, I just thought having a whole ?expr-without-walrus-or-yield? subgrammar would be tedious. If there is a way to have the ?in-an-annotation? flag set during parsing that may be better, I don?t know. Maybe Lysandros has an idea? ---------- nosy: +Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 10:59:58 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 24 Apr 2021 14:59:58 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619276398.31.0.551012829203.issue43901@roundup.psfhosted.org> Guido van Rossum added the comment: And that?s a problem. There needs to be a recommendation on what to do for code that spans 3.9 and 3.10. What should users do otherwise? Drop 3.9 as soon as they introduce 3.10 support? Withhold 3.10 support until 3.9 reaches EOL? IOW you can?t just break backward compatibility. (That?s why PEP 563 was rolled back in the first place.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 11:02:06 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 24 Apr 2021 15:02:06 +0000 Subject: [issue43780] Sync importlib_metadata enhancements through 3.10. In-Reply-To: <1617925916.07.0.133652663909.issue43780@roundup.psfhosted.org> Message-ID: <1619276526.33.0.418439098514.issue43780@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 11:49:53 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 24 Apr 2021 15:49:53 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1619279393.38.0.307546588597.issue42725@roundup.psfhosted.org> Serhiy Storchaka added the comment: There is no ?expr-without-await-or-async-for? subgrammar, but "await" and asynchronous comprehensions are invalid in synchronous functions. There should be similar flag for annotations in symtable.c. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 12:12:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Apr 2021 16:12:12 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1619280732.43.0.419783786772.issue42725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I just thought having a whole ?expr-without-walrus-or-yield? subgrammar would be tedious. Yeah I have experimented with something similar in the past and this becomes out of hand super quickly and leafs to a lot of duplication. Similarly, a flag that conditionally accept some rules can be quite tricky to hey right with the backtracking and those require some extra metagrammar so adding the flag is not super unreadable. In my humble opinion, I think is far simpler to reject this after the parsing is done, either in the compiler or the symbol table. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 12:21:53 2021 From: report at bugs.python.org (Paul Moore) Date: Sat, 24 Apr 2021 16:21:53 +0000 Subject: [issue43930] Update bundled pip to 21.1 and setuptools to 56.0.0 In-Reply-To: <1619273635.66.0.622596591495.issue43930@roundup.psfhosted.org> Message-ID: <1619281313.5.0.951841365121.issue43930@roundup.psfhosted.org> Paul Moore added the comment: New changeset 196983563d05e32d2dcf217e955a919f9e0c25e1 by St?phane Bidoul in branch 'master': bpo-43930: Update bundled pip to 21.1 and setuptools to 56.0.0 (GH-25576) https://github.com/python/cpython/commit/196983563d05e32d2dcf217e955a919f9e0c25e1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 12:55:03 2021 From: report at bugs.python.org (hai shi) Date: Sat, 24 Apr 2021 16:55:03 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1619283303.91.0.11807337625.issue37751@roundup.psfhosted.org> hai shi added the comment: Thanks Marc-Andre for your supplement of PEP-100. Thanks Inada, victor for your review and merge. After PR-23096 merged, I suggest to close this bpo. If there have any other questions, we can reopen it again. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 13:41:04 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 24 Apr 2021 17:41:04 +0000 Subject: [issue41350] Use of zipfile.Path causes attempt to write after ZipFile is closed In-Reply-To: <1595261389.35.0.991424986164.issue41350@roundup.psfhosted.org> Message-ID: <1619286064.96.0.65173420829.issue41350@roundup.psfhosted.org> Andrei Kulakov added the comment: Looks like a duplicate of https://bugs.python.org/issue40564 , which was fixed and closed so this can also be closed. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 13:46:25 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Sat, 24 Apr 2021 17:46:25 +0000 Subject: [issue43930] Update bundled pip to 21.1 and setuptools to 56.0.0 In-Reply-To: <1619273635.66.0.622596591495.issue43930@roundup.psfhosted.org> Message-ID: <1619286385.81.0.644733967536.issue43930@roundup.psfhosted.org> Change by St?phane Bidoul : ---------- nosy: +sbidoul nosy_count: 5.0 -> 6.0 pull_requests: +24298 pull_request: https://github.com/python/cpython/pull/25578 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 13:53:05 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Sat, 24 Apr 2021 17:53:05 +0000 Subject: [issue43930] Update bundled pip to 21.1 and setuptools to 56.0.0 In-Reply-To: <1619273635.66.0.622596591495.issue43930@roundup.psfhosted.org> Message-ID: <1619286785.26.0.480876283809.issue43930@roundup.psfhosted.org> Change by St?phane Bidoul : ---------- pull_requests: +24299 pull_request: https://github.com/python/cpython/pull/25579 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 14:02:07 2021 From: report at bugs.python.org (Ethan Furman) Date: Sat, 24 Apr 2021 18:02:07 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619287327.57.0.965104325206.issue38659@roundup.psfhosted.org> Ethan Furman added the comment: Pablo, did my latest patch resolved the errors? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 14:28:32 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sat, 24 Apr 2021 18:28:32 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619288912.03.0.478857344575.issue43492@roundup.psfhosted.org> Change by St?phane Wirtel : ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 14:34:11 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 24 Apr 2021 18:34:11 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619289251.28.0.488254033809.issue43492@roundup.psfhosted.org> Shreyan Avigyan added the comment: Do anyone notice any bug in SQLite 3.35.5? If not then I think it's time to upgrade to SQLite 3.35.5. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 14:37:54 2021 From: report at bugs.python.org (Akshay K) Date: Sat, 24 Apr 2021 18:37:54 +0000 Subject: [issue43932] f-string decimal has leading space Message-ID: <1619289474.8.0.486564567214.issue43932@roundup.psfhosted.org> New submission from Akshay K : When using a f-string to print a number with a certain number of decimal places, the number is printed with a leading space. ---------- components: Interpreter Core files: fstringdemo.py messages: 391789 nosy: Axeinator, eric.smith priority: normal severity: normal status: open title: f-string decimal has leading space type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file49981/fstringdemo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 14:47:40 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sat, 24 Apr 2021 18:47:40 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619290060.18.0.226996805135.issue43492@roundup.psfhosted.org> St?phane Wirtel added the comment: Hi Shreyan Avigyan, For that, you need to follow the forum of SQLite. https://www.sqlite.org/forum/forum ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 14:48:28 2021 From: report at bugs.python.org (Muhammad Hussein Ammari) Date: Sat, 24 Apr 2021 18:48:28 +0000 Subject: [issue25166] Windows All Users installation places uninstaller in user profile In-Reply-To: <1442575090.58.0.314641407957.issue25166@psf.upfronthosting.co.za> Message-ID: <1619290108.53.0.233790634722.issue25166@roundup.psfhosted.org> Change by Muhammad Hussein Ammari : ---------- title: Windows AllUsers installation places uninstaller in user profile -> Windows All Users installation places uninstaller in user profile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 14:50:29 2021 From: report at bugs.python.org (Muhammad Hussein Ammari) Date: Sat, 24 Apr 2021 18:50:29 +0000 Subject: [issue43193] Installer for All users In-Reply-To: <1612953691.92.0.275565504526.issue43193@roundup.psfhosted.org> Message-ID: <1619290229.26.0.953132524709.issue43193@roundup.psfhosted.org> Muhammad Hussein Ammari added the comment: Duplicate: https://bugs.python.org/issue25166 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 14:50:35 2021 From: report at bugs.python.org (Muhammad Hussein Ammari) Date: Sat, 24 Apr 2021 18:50:35 +0000 Subject: [issue43193] Installer for All users In-Reply-To: <1612953691.92.0.275565504526.issue43193@roundup.psfhosted.org> Message-ID: <1619290235.18.0.929506997212.issue43193@roundup.psfhosted.org> Change by Muhammad Hussein Ammari : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 15:09:29 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 24 Apr 2021 19:09:29 +0000 Subject: [issue41350] Use of zipfile.Path causes attempt to write after ZipFile is closed In-Reply-To: <1595261389.35.0.991424986164.issue41350@roundup.psfhosted.org> Message-ID: <1619291369.9.0.749504952072.issue41350@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Using zipfile.Path with several files prematurely closes zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 15:09:45 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 24 Apr 2021 19:09:45 +0000 Subject: [issue41350] Use of zipfile.Path causes attempt to write after ZipFile is closed In-Reply-To: <1595261389.35.0.991424986164.issue41350@roundup.psfhosted.org> Message-ID: <1619291385.01.0.19360548388.issue41350@roundup.psfhosted.org> Jason R. Coombs added the comment: Thanks Andrei ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 15:14:44 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 24 Apr 2021 19:14:44 +0000 Subject: [issue43932] f-string decimal has leading space In-Reply-To: <1619289474.8.0.486564567214.issue43932@roundup.psfhosted.org> Message-ID: <1619291684.29.0.682370089739.issue43932@roundup.psfhosted.org> Mark Dickinson added the comment: This is by design, and documented under the "sign" section here: https://docs.python.org/3/library/string.html#format-specification-mini-language The space before ".2f" is an instruction to leave space for a sign, "-" for a negative number and " " for a positive number. To avoid that space, use a format of ".2f" instead of " .2f". >>> format(15, ".2f") '15.00' >>> format(15, " .2f") ' 15.00' >>> format(15, "+.2f") '+15.00' ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 15:15:16 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 24 Apr 2021 19:15:16 +0000 Subject: [issue43932] f-string decimal has leading space In-Reply-To: <1619289474.8.0.486564567214.issue43932@roundup.psfhosted.org> Message-ID: <1619291716.09.0.89135289555.issue43932@roundup.psfhosted.org> Change by Mark Dickinson : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 15:27:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 24 Apr 2021 19:27:10 +0000 Subject: [issue43874] argparse crashes on subparsers with no dest/metava In-Reply-To: <1618600066.88.0.240618154113.issue43874@roundup.psfhosted.org> Message-ID: <1619292430.55.0.220742073879.issue43874@roundup.psfhosted.org> Terry J. Reedy added the comment: Terence, a 'crash' for this tracker is a core dump or equivalent with no exception/traceback. ---------- nosy: +terry.reedy stage: -> patch review type: crash -> behavior versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 15:56:33 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 24 Apr 2021 19:56:33 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 Message-ID: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> New submission from Anthony Sottile : This is breaking pytest for failed assertions: https://github.com/pytest-dev/pytest/pull/8227 It also breaks the traceback in the output below Here's a minimal example: ```python class Boom: def __enter__(self): return self def __exit__(self, *_): raise AssertionError('boom!') def main() -> int: with Boom(): raise AssertionError('hi') if __name__ == '__main__': exit(main()) ``` On python3.9 you get this: ``` Traceback (most recent call last): File "/home/asottile/workspace/cpython/t.py", line 10, in main raise AssertionError('hi') AssertionError: hi During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/asottile/workspace/cpython/t.py", line 14, in exit(main()) File "/home/asottile/workspace/cpython/t.py", line 10, in main raise AssertionError('hi') File "/home/asottile/workspace/cpython/t.py", line 5, in __exit__ raise AssertionError('boom!') AssertionError: boom! ``` output in python3.10: ``` Traceback (most recent call last): File "/home/asottile/workspace/cpython/t.py", line 10, in main raise AssertionError('hi') AssertionError: hi During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/asottile/workspace/cpython/t.py", line 14, in exit(main()) File "/home/asottile/workspace/cpython/t.py", line -1, in main File "/home/asottile/workspace/cpython/t.py", line 5, in __exit__ raise AssertionError('boom!') AssertionError: boom! ``` Notice the second to last frame is now missing and invalid (line -1) I bisected this and found this is the culprit: https://github.com/python/cpython/commit/3bd6035b6baf1a7d51b7cc2c6bb2c81886236b67 https://github.com/python/cpython/pull/24202 ``` 3bd6035b6baf1a7d51b7cc2c6bb2c81886236b67 is the first bad commit commit 3bd6035b6baf1a7d51b7cc2c6bb2c81886236b67 Author: Mark Shannon Date: Wed Jan 13 12:05:43 2021 +0000 bpo-42908: Mark cleanup code at end of try-except and with artificial (#24202) * Mark bytecodes at end of try-except as artificial. * Make sure that the CFG is consistent throughout optimiization. * Extend line-number propagation logic so that implicit returns after 'try-except' or 'with' have the correct line numbers. * Update importlib Lib/test/test_dis.py | 2 +- Lib/test/test_sys_settrace.py | 40 + Python/compile.c | 135 +- Python/importlib.h | 3153 ++++++++++++++--------------- Python/importlib_external.h | 4489 ++++++++++++++++++++--------------------- Python/importlib_zipimport.h | 1013 +++++----- 6 files changed, 4473 insertions(+), 4359 deletions(-) bisect run success ``` which appears to be due to bpo-42908 ---------- messages: 391795 nosy: Anthony Sottile, Mark.Shannon, pablogsal priority: normal severity: normal status: open title: Regression in python3.10 with traceback frame having lineno of -1 versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 16:12:04 2021 From: report at bugs.python.org (Aritn Sarraf) Date: Sat, 24 Apr 2021 20:12:04 +0000 Subject: [issue43929] Raise on threading.Event.__bool__ due to ambiguous nature In-Reply-To: <1619260783.59.0.920057566197.issue43929@roundup.psfhosted.org> Message-ID: <1619295124.57.0.805993830367.issue43929@roundup.psfhosted.org> Aritn Sarraf added the comment: Hi Steve, a couple things to preface my following comment. (1) Didn't mean to suggest that the current behavior is a bug. I don't think it is a bug, rather that it can easily lead to bugs. (2) Sorry for tagging the previous versions, I'm not familiar with the ticket system and didn't realize I was asking for (nor do I want) this to be changed in previous versions as well. I thought it just means what versions was this ticket relevant to. I do realize and appreciate the basic object model regarding `bool(obj)`, and there is nothing in the threading documentation or the language as a whole that would lead me to believe that Events should be evaluated for their truthiness directly. However, I would like to expand on my case further before closing the ticket. I believe there is a fundamental difference in the "perception" of what an Event object represents vs most other objects, *with respect to how bool should be evaluated on it*. It undeniably draws very clear parallels to a true boolean flag, and is often used as a surrogate for such. I realize it is more than that, that it's used for synchronization as well as other things, but the fact that Event is so often assigned to a variable called "flag" or a variable that implies a discrete boolean state (like my original stop_thread example), rather than a variable name that encompasses the full concept of an event, is a good indication that this is how people view/use the object. Given that the concept of Event and a boolean flag are so closely intertwined, I think that (but am *not* suggesting the following) it could even be considered appropriate for `bool(not_set_event)` to evaluate to False. Again, I am not suggesting this, as I realize that an Event is more than just it's underlying "set" state. But, this is why I think that more often than not it is Ambiguous what a developer actually intended by directly evaluating such. Now, in terms of what the current behavior enables us to do, in other words, by adopting this change, what abilities in the language/threading framework are we losing. The only thing I can think of is the ability to do this: `event = event or Event()`. I don't have statistics on this but I would make the assumption, and I believe it's a safe one, that the vast majority of situations where Event shows up in a boolean evaluated statement (e.g. if, while, not, and/or) is as `event.is_set()`. So much so, that I would even go so far as to make the assumption that there is a decently high probability that if someone does write `event or/and other_variable` it was done so in error. However, this is nothing but an assumption, with no evidence to back it up, so really the point I want to get across here is that there is not much utility in `bool(event)` and I don't think we're hindering the language in any way by forbidding it. With respect to backwards compatibility, while it is not backwards compatible, it is very refactor friendly. First of all, there will not be many properly used cases (e.g. `event = event or Event()`) where this would show up in the first place. And second, since we're raising an exception rather than returning a different value, we won't introduce unexpected behavior to any existing use cases. All this said, any bugs that this behavior can lead to, are most likely easily caught and resolved. But, I think that this change would be, and only be, a benefit to developing threaded applications in Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 16:20:48 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sat, 24 Apr 2021 20:20:48 +0000 Subject: [issue43934] Minimal version of SQLite3 - 3.26 ? Message-ID: <1619295648.28.0.879018174347.issue43934@roundup.psfhosted.org> New submission from St?phane Wirtel : After reading this issue: https://bugs.python.org/msg370266, I think SQLite 3.26.0 could be the minimal version for Python 3.10. I have checked the following distributions CentOS 8: stable : 8.3.2011: 3.26.0 Debian 10: stable : 10 : 3.27.2 Ubuntu 20.04: stable : 20.04: 3.31.1 CentOS 7: oldstable : 7.9.2009: 3.7.17 Debian 9: oldstable : 9.13: 3.16.2 ---------- messages: 391797 nosy: matrixise priority: normal severity: normal status: open title: Minimal version of SQLite3 - 3.26 ? versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 16:24:59 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sat, 24 Apr 2021 20:24:59 +0000 Subject: [issue43934] Minimal version of SQLite3 - 3.26 ? In-Reply-To: <1619295648.28.0.879018174347.issue43934@roundup.psfhosted.org> Message-ID: <1619295899.92.0.948491849024.issue43934@roundup.psfhosted.org> Change by St?phane Wirtel : ---------- keywords: +patch pull_requests: +24300 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25580 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 16:25:27 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Apr 2021 20:25:27 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619295927.21.0.412763955074.issue43933@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- assignee: -> Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 16:25:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Apr 2021 20:25:55 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619295955.6.0.0267530800248.issue43933@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Marking as release blocker since is breaking pytest ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 16:26:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Apr 2021 20:26:43 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619296003.16.0.434609548417.issue43933@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks for the bisection, Anthony ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 16:34:45 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 24 Apr 2021 20:34:45 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1619296485.88.0.682153078673.issue43913@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- stage: -> needs patch versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 16:34:29 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 24 Apr 2021 20:34:29 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1619296469.28.0.698262156642.issue43913@roundup.psfhosted.org> Terry J. Reedy added the comment: import unittest #def setUpModule(): raise Exception() #def tearDownModule(): print('module teardown') unittest.addModuleCleanup(print, 'module cleanup') class Dummy(unittest.TestCase): def test_dummy(self): self.addCleanup(print, 'test cleanup') self.addClassCleanup(print, 'class cleanup') unittest.main() ---------------------------------------------- Above verifies the claim in 3.10.0a7. Only 'test cleanup' and 'class cleanup' print. Uncomment either function and 'module cleanup' is also printed. https://docs.python.org/3/library/unittest.html#unittest.addModuleCleanu """ unittest.addModuleCleanup(function, /, *args, **kwargs) Add a function to be called after tearDownModule() to cleanup resources used during the test class. Functions will be called in reverse order to the order they are added (LIFO). They are called with any arguments and keyword arguments passed into addModuleCleanup() when they are added. If setUpModule() fails, meaning that tearDownModule() is not called, then any cleanup functions added will still be called. """ This seems slightly ambiguous as to behavior when no tearDownModule. However, the doc for addClassCleanup is exactly parallel. https://docs.python.org/3/library/unittest.html#unittest.TestCase.addClassCleanup """ classmethod addClassCleanup(function, /, *args, **kwargs) Add a function to be called after tearDownClass() to cleanup resources used during the test class. Functions will be called in reverse order to the order they are added (LIFO). They are called with any arguments and keyword arguments passed into addClassCleanup() when they are added. If setUpClass() fails, meaning that tearDownClass() is not called, then any cleanup functions added will still be called. """ The doc for addCleanup is also parallel. The behavior difference therefore seems like a bug and calling in any case seems more correct. Ryan, can you prepare a PR? ---------- nosy: +ezio.melotti, michael.foord, rbcollins, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 16:35:56 2021 From: report at bugs.python.org (=?utf-8?q?Tarjei_B=C3=A6rland?=) Date: Sat, 24 Apr 2021 20:35:56 +0000 Subject: [issue43935] Fix typo in Turtle.back docstring Message-ID: <1619296556.86.0.24657998959.issue43935@roundup.psfhosted.org> Change by Tarjei B?rland : ---------- assignee: docs at python components: Documentation nosy: docs at python, tarjeiba priority: normal severity: normal status: open title: Fix typo in Turtle.back docstring versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 16:36:31 2021 From: report at bugs.python.org (=?utf-8?q?Tarjei_B=C3=A6rland?=) Date: Sat, 24 Apr 2021 20:36:31 +0000 Subject: [issue43935] Fix typo in Turtle.back docstring Message-ID: <1619296591.01.0.884280952147.issue43935@roundup.psfhosted.org> Change by Tarjei B?rland : ---------- keywords: +patch pull_requests: +24301 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25581 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 16:43:46 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sat, 24 Apr 2021 20:43:46 +0000 Subject: [issue43935] Fix typo in Turtle.back docstring Message-ID: <1619297026.13.0.601314823522.issue43935@roundup.psfhosted.org> New submission from St?phane Wirtel : Thank you for your contribution but as you know, you have to sign the CLA. https://github.com/python/cpython/pull/25581#issuecomment-826150064 ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 17:10:23 2021 From: report at bugs.python.org (Larry Hastings) Date: Sat, 24 Apr 2021 21:10:23 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619298623.95.0.742555774132.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: I'm not breaking backwards compatibility--that's the point of all this. But I'm improving the experience. And if you don't care about 3.9 and before, you can stick to the new improved experience. Looking in the class dict for annotations is terrible, but that's best practice for 3.9 and earlier because of the flawed design of annotations. For 3.10+, best practice to look at annotations is inspect.get_annotations() for all objects. But this isn't best practice for 3.9, because the function didn't exist in 3.9. Also, the paragraph might go on to say, if you have a good reason why you can't call inspect.get_annotations(), best practice no longer requires you to look in the class dict, because of this very issue/PR that is behavior we are changing for 3.10. So, best practices changed in 3.10. And I plan to add a section to the docs somewhere that says "Here are best practices for accessing annotations in 3.10+". As I said, if you think the Python 3.10 docs should have a section about "here are best practices in 3.9", I can add that too, but it'll be a different paragraph. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 17:19:49 2021 From: report at bugs.python.org (Berker Peksag) Date: Sat, 24 Apr 2021 21:19:49 +0000 Subject: [issue43934] Minimal version of SQLite3 - 3.26 ? In-Reply-To: <1619295648.28.0.879018174347.issue43934@roundup.psfhosted.org> Message-ID: <1619299189.17.0.0931733240273.issue43934@roundup.psfhosted.org> Berker Peksag added the comment: This would make sqlite3 module unusable for many users. We have already increased the minimal required version in 3.10 and am opposed to do this change. I also don't understand what part of msg370266 made you think that this is a reasonable change. The gist of the previous version increase was a failed test in older SQLite versions. As far as I'm aware, there is no such an issue to warrant such a step increase for minimum version requirement (from 3.7.15 to 3.26.0) ---------- nosy: +berker.peksag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 17:22:06 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 24 Apr 2021 21:22:06 +0000 Subject: [issue43936] os.path.realpath() normalizes paths before resolving links on Windows Message-ID: <1619299325.99.0.263866939052.issue43936@roundup.psfhosted.org> New submission from Barney Gale : Capturing a write-up by eryksun on GitHub into a new bug. Link: https://github.com/python/cpython/pull/25264#pullrequestreview-631787754 > `nt._getfinalpathname()` opens a handle to a file/directory with `CreateFileW()` and calls `GetFinalPathNameByHandleW()`. The latter makes a few system calls to get the final opened path in the filesystem (e.g. "\Windows\explorer.exe") and the canonical DOS name of the volume device on which the filesystem is mounted (e.g. "\Device\HarddiskVolume2" -> "\\?\C:") in order to return a canonical DOS path (e.g. "\\?\C:\Windows\explorer.exe"). > > Opening a handle with `CreateFileW()` entails first getting a fully-qualified and normalized NT path, which, among other things, entails resolving ".." components naively in the path string. This does not take reparse points such as symlinks and mountpoints into account. The only time Windows parses ".." components in an opened path the way POSIX does is in the kernel when they're in the target path of a relative symlink. > > `nt.readlink()` opens a handle to the file with the flag `FILE_FLAG_OPEN_REPARSE_POINT`. If the final path component is a reparse point, it opens it instead of traversing it. Then the reparse point is read with the filesystem control request, `FSCTL_GET_REPARSE_POINT`. System symlinks and mountpoints (`IO_REPARSE_TAG_SYMLINK` and `IO_REPARSE_TAG_MOUNT_POINT`) are the only supported name-surrogate reparse-point types, though `os.stat()` and `os.lstat()` handle all name-surrogate types as 'links'. Moreover, only symlinks get the `S_IFLNK` mode flag in a stat result, because they're the only ones we can create with `os.symlink()` to satisfy the usage `if os.path.islink(src): os.symlink(os.readlink(src), dst)`. > > > What would it take to do a POSIX-style "normalize as we resolve", > > and would we want to? I guess we'd need to call nt._getfinalpathname() > > on each path component in turn (C:, C:\Users, C:\Users\Barney etc), > > which from my pretty basic Windows knowledge might be rather slow if > > that involves file handles. > > You asked, so I decided to write up an outline of what implementing a POSIX-style `realpath()` might look like in Windows. At its core, it's similar to POSIX: lstat(), and, for a symlink, readlink() and recur. The equivalent calls in Windows are the following: > > * `CreateFileW()` (open a handle) > > * `GetFileInformationByHandleEx()`: `FileAttributeTagInfo` > > * `DeviceIoControl()`: `FSCTL_GET_REPARSE_POINT` > > > A symlink has the reparse tag `IO_REPARSE_TAG_SYMLINK`. > > Filesystem mountpoints (aka junctions, which are like Unix bind mountpoints) must be retained in the resolved path in order to correctly resolve relative symlinks such as "\spam" (relative to the resolved device) and "..\..\spam". Anyway, this is consistent with the UNC case, since mountpoints on a remote server can never be resolved (i.e. a final UNC path never resolves mountpoints). > > Here are some of the notable differences compared to POSIX: > > * If the source path is not a "\\?\" verbatim path, `GetFullPathNameW()` must be called initially. However, ".." components in the target path of a relative symlink must be resolved the POSIX way, else symlinks in the target path may be removed incorrectly before their target is resolved (e.g. "foo\symlink\..\bar" incorrectly resolved as "foo\bar"). The opened path is initially normalized as follows: > > * replace forward slashes with backslashes > * collapse repeated backslashes (except the UNC root must have exactly two backslashes) > * resolve a relative path (e.g. "spam"), drive-relative path (e.g. "Z:spam"), or rooted path (e.g. "\spam") as a fully-qualified path (e.g. "Z:\eggs\spam") > * resolve "." and ".." components in the opened path (naive to symlinks) > * strip trailing spaces and dots from the final component (e.g. "C:\spam. . ." -> "C:\spam") > * resolve reserved device names in the final component of a non-UNC path (e.g. "C:\nul" -> "\\.\nul") > > * Substitute drives (e.g. created by "subst.exe", or `DefineDosDeviceW`) and mapped drives (e.g. created by "net.exe", or `WNetAddConnection2W`) must be resolved, respectively via `QueryDosDeviceW()` and `WNetGetUniversalNameW()`. Like all DOS 'devices', these drives are implemented as object symlinks (i.e. symlinks in the object namespace, not to be confused with filesystem symlinks). The target path of these drives, however, is not a Device object, but rather a filesystem path on a device that can include any number of path components, some of which may be filesystem symlinks that need to be resolved. Normally when a path is opened, the system object manager reparses all DOS 'devices' to the path of an actual Device object, or a path on a Device object, before the I/O manager's parse routine ever sees the path. Such drives need to be resolved whenever parsing starts or restarts at a drive, but the result can be cached in case multiple filesystem symlinks target the same drive. > > * Substitute drives can target paths on other substitute drives, so `QueryDosDeviceW()` has to be called in a loop that accumulates the tail path components until it reaches a real device (i.e. a target path that doesn't begin with "\??\"). > * `WNetGetUniversalNameW()` has to be called after resolving substitute drives. It resolves the underlying UNC path of a mapped drive. The target path of the object symlink that implements a mapped drive is of the form "\Device\\;\server\share\some\filesystem\path". The "redirector device name" component is usually (post Windows Vista) an object symlink to a path on the system's Multiple UNC Provider (MUP) device, "\Device\Mup". The mapped-drive target path ultimately resolves to a redirected filesystem that's mounted in the MUP device namespace at the "share" name. This is an implementation detail of the filesystem redirector and MUP device, which the Multiple Provider Router (MPR) WNet API encapsulates. For example, for the mapped drive path "Z:\spam\eggs", it returns a UNC path of the form "\\server\share\some\filesystem\path\spam\eggs". > > * A join that tries to resolve ".." against the drive or share root path must fail, whereas this is ignored for the root path in POSIX. For example, `symlink_join("C:\\", "..\\spam")` must fail, since the system would fail an open that tried to reparse that symlink target. > > * At the end, the resolved path should be tested to try to remove "\\?\" if the source path didn't have this prefix. Call `GetFullPathNameW()` to check for a reserved name in the final component and `PathCchCanonicalizeEx()` to check for long-path support. (The latter calls the system runtime library function `RtlAreLongPathsEnabled`, but that's an undocumented implementation detail.) > > > `GetFinalPathNameByHandleW()` is not required. Optionally, it can be called for the last valid component if the caller wants a final path with all mountpoints resolved, i.e. add a `final_path=False` option. Of course, a final UNC path must retain mountpoints, so there's nothing we can do in that case. It's fine that this `realpath()` implementation would return a path that contains mountpoints in Windows (as the current implementation also does for UNC paths). They are not symlinks, and this matches the behavior of POSIX. > > I'd include a warning in the documentation that getting a final path via `GetFinalPathNameByHandleW()` in the non-strict case may be dysfunctional. The unresolved tail end of the path may become valid again if a server or device comes back online. If the unresolved part contains symlinks with relative targets such as "\spam" and "..\..\spam", and the `realpath()` call resolved away mountpoints, the reminaing path may not resolve correctly against the final path, as compared to how it would resolve against the original path. It definitely will not resolve the same for a rooted target path such as "\spam" if the last resolved reparse point in the original path was a mountpoint, since it will reparse to the root path of the mountpoint device instead of the original opened device, or instead of the last resolved device of a symlink in the path. ---------- components: Library (Lib) messages: 391804 nosy: barneygale priority: normal severity: normal status: open title: os.path.realpath() normalizes paths before resolving links on Windows versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 17:34:58 2021 From: report at bugs.python.org (Terence Honles) Date: Sat, 24 Apr 2021 21:34:58 +0000 Subject: [issue43874] argparse crashes on subparsers with no dest/metava In-Reply-To: <1618600066.88.0.240618154113.issue43874@roundup.psfhosted.org> Message-ID: <1619300098.82.0.121522510288.issue43874@roundup.psfhosted.org> Terence Honles added the comment: Sorry I didn't know what to put, and now that you changed it I understand what behavior means. Thanks for changing it. Should I do anything further? Not sure how to proceed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 17:38:02 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sat, 24 Apr 2021 21:38:02 +0000 Subject: [issue43934] Minimal version of SQLite3 - 3.26 ? In-Reply-To: <1619295648.28.0.879018174347.issue43934@roundup.psfhosted.org> Message-ID: <1619300282.67.0.372864665212.issue43934@roundup.psfhosted.org> Change by St?phane Wirtel : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 17:37:50 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sat, 24 Apr 2021 21:37:50 +0000 Subject: [issue43934] Minimal version of SQLite3 - 3.26 ? In-Reply-To: <1619295648.28.0.879018174347.issue43934@roundup.psfhosted.org> Message-ID: <1619300270.28.0.172922369064.issue43934@roundup.psfhosted.org> St?phane Wirtel added the comment: Hi Berker, No problem, that was just a question/suggestion, and I fully understand your remarks. Thanks for your feedback. St?phane ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 17:43:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Apr 2021 21:43:38 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619300618.46.0.291871917607.issue38659@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 17:43:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Apr 2021 21:43:26 +0000 Subject: [issue38659] enum classes cause slow startup time In-Reply-To: <1572570768.69.0.355804772721.issue38659@roundup.psfhosted.org> Message-ID: <1619300606.32.0.592691008555.issue38659@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Seems that the buildbots are going back to green so I will close the revert PR. THanks a lot, Ethan for the fix and the investigation! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 17:46:00 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 24 Apr 2021 21:46:00 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1619300760.63.0.784828170074.issue43914@roundup.psfhosted.org> Terry J. Reedy added the comment: Great!!! I also tried >>> try: compile("a xyzjdkjfk", '', 'single') except SyntaxError as e: print(e, e.msg, e.lineno, e.offset, e.end_lineno, e.end_offset) invalid syntax. Perhaps you forgot a comma? (, line 1) invalid syntax. Perhaps you forgot a comma? 1 1 1 12 The language change that enables the display change is the addition of end_lineno and end_offset attributes. I will look into using these in IDLE. I will submit a PR to augment the What's New entry, so others can also improve their error marking. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 17:49:21 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 24 Apr 2021 21:49:21 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619300961.94.0.479307290921.issue43901@roundup.psfhosted.org> Eric V. Smith added the comment: It's find to have advice of "do X in 3.9", and "do Y in 3.10+". I think the issue is: if you have code that needs to run in 3.9 and 3.10+, what should you do? There needs to be some advice for that case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 17:55:37 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 24 Apr 2021 21:55:37 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619301337.82.0.685301685491.issue43901@roundup.psfhosted.org> Eric V. Smith added the comment: "It's fine to have advice ..." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 18:10:57 2021 From: report at bugs.python.org (Berker Peksag) Date: Sat, 24 Apr 2021 22:10:57 +0000 Subject: [issue43934] Minimal version of SQLite3 - 3.26 ? In-Reply-To: <1619295648.28.0.879018174347.issue43934@roundup.psfhosted.org> Message-ID: <1619302257.48.0.536197112927.issue43934@roundup.psfhosted.org> Berker Peksag added the comment: Thank you for taking your time to improve the sqlite3 module! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 18:26:42 2021 From: report at bugs.python.org (Larry Hastings) Date: Sat, 24 Apr 2021 22:26:42 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619303202.6.0.216249208116.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: I'm please you folks are as supportive as you are of what I'm doing here, given that you seem a little unsure of the details. I concede that there's a lot going on and it can be hard to keep it all in your head. The point of this issue / PR is to improve the best practices for 3.10 without breaking the best practices for 3.9 and before. Best practice in 3.10 is to use inspect.get_annotations(), and failing that, three-argument getattr(), for all annotated objects. This issue / PR permits that to happen. Best practices for 3.9 differed between different objects. For classes, you had no choice but to look in the class dict because of the inheritance problem. (Either that, or, the elaborate scheme 'attrs' used.) That code will emphatically _still work_ in 3.10. We are not breaking backwards compatibility. So, the best practices in 3.9 and before will still work in 3.10. But the best practices for 3.10+ are improved because of the work we're doing here and in other places. My intent was to document the best practices for 3.10+. If folks think it would be helpful, this same section in the 3.10 docs can also describe best practices for 3.9 and before. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 18:27:47 2021 From: report at bugs.python.org (Paul Moore) Date: Sat, 24 Apr 2021 22:27:47 +0000 Subject: [issue43930] Update bundled pip to 21.1 and setuptools to 56.0.0 In-Reply-To: <1619273635.66.0.622596591495.issue43930@roundup.psfhosted.org> Message-ID: <1619303267.72.0.263161379463.issue43930@roundup.psfhosted.org> Paul Moore added the comment: New changeset d962b00fcffa9070acdca850753f254828caa1d7 by St?phane Bidoul in branch '3.9': [3.9] bpo-43930: Update bundled pip to 21.1 and setuptools to 56.0.0 (GH-25578) https://github.com/python/cpython/commit/d962b00fcffa9070acdca850753f254828caa1d7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 18:28:58 2021 From: report at bugs.python.org (Paul Moore) Date: Sat, 24 Apr 2021 22:28:58 +0000 Subject: [issue43930] Update bundled pip to 21.1 and setuptools to 56.0.0 In-Reply-To: <1619273635.66.0.622596591495.issue43930@roundup.psfhosted.org> Message-ID: <1619303338.39.0.756536308104.issue43930@roundup.psfhosted.org> Paul Moore added the comment: New changeset fc82f3f8fb36f88a4e7238a463812c2916bd4db0 by St?phane Bidoul in branch '3.8': [3.8] bpo-43930: Update bundled pip to 21.1 and setuptools to 56.0.0 (GH-25576) (GH-25579) https://github.com/python/cpython/commit/fc82f3f8fb36f88a4e7238a463812c2916bd4db0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 18:35:49 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 24 Apr 2021 22:35:49 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1619303749.51.0.337608064842.issue43914@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +24302 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25582 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 18:36:33 2021 From: report at bugs.python.org (Larry Hastings) Date: Sat, 24 Apr 2021 22:36:33 +0000 Subject: [issue43901] Add an empty annotations dict to all unannotated classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619303793.53.0.554862763808.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: Aaaaand I just had a realization. Lazy creation of an empty annotations dict, for both classes and modules, will work fine. As stated in my previous comment in this issue, my goal here is to improve best practices in 3.10+, while preserving the unfortunate best practices of 3.9 and before. I don't know why I couldn't see it before, but: adding a getset to modules and user classes, and lazily creating the empty annotations dict if not set, ought to work fine. The getset code will have to store the annotations dict in the class / module dict but that's not a big deal. If you're in 3.10+, and your code looks in the class dict for annotations, and we lazy-create it with a getset and store it in the class dict, then you still see what you expected to see. * If the class has annotations, they'll be in the class dict. * If the class has no annotations, but someone accessed cls.__annotations__, the empty dict will be lazily created and you'll see it. * If the class doesn't have annotations, then the class dict won't have an '__annotations__' key, which is what you were expecting. In any scenario the old best practices code works fine. If you're in 3.10+, and your code uses cls.__annotations__ or getattr() to get the class dict, and we lazy-create it with a getset and store it in the class dict, then you also get what you expected. If the class or module has annotations, you get them; if it doesn't, it lazy creates an empty dict and stores and returns that. Your code works fine too. Sorry I've been slow on figuring this out--but at least I got there in the end, before beta. And it's good news! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 18:36:55 2021 From: report at bugs.python.org (Larry Hastings) Date: Sat, 24 Apr 2021 22:36:55 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619303815.82.0.520869413514.issue43901@roundup.psfhosted.org> Change by Larry Hastings : ---------- title: Add an empty annotations dict to all unannotated classes and modules -> Lazy-create an empty annotations dict in all unannotated user classes and modules _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 18:38:50 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sat, 24 Apr 2021 22:38:50 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619303930.44.0.601203870599.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > Does the test suite pass for apply-to-all.diff? No, multiple tests fail. First test_distutils fails, then during the re-run, test_multiprocessing_forkserver, test_multiprocessing_spawn, and test_pdb fail. > Also, quite a hornet's nest you've uncovered (about __class__ assignment). Yes, indeed. Apropos, I see that bpo-24991 is still open. > Would that be fixed better with the IMMUTABLE flag? That would be a change of functionality, given that we apply the immutable flag to all built-in types. Currently __class__ assignment is allowed for heap types, and it has been so for many years. I feel reluctant to add apply-to-all.diff to the PR right now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 18:48:47 2021 From: report at bugs.python.org (Larry Hastings) Date: Sat, 24 Apr 2021 22:48:47 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619304527.14.0.0345401266127.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: Hmm. Sorry for the stream-of-consciousness thought process here, but this approach adds wrinkles too. Function objects from the very beginning have lazy-created their annotations dict if it's not set. Which means this works fine: while True: del fn.__annotations__ print(fn.__annotations__) You can do that all day. The function object will *always* create a new annotations object if it doesn't have one. del fn.__annotations__ always works, and accessing fn.__annotations__ always succeeds. It doesn't retain any state of "I already lazily created one, I shouldn't create another". If I add getsets to classes and modules so they lazy-create annotations on demand if they otherwise aren't set, then either a) they need an extra bit set somewhere that says "I lazily created an empty annotations dict once, I shouldn't do it again", or b) they will duplicate this behavior that functions display. a) would better emulate existing semantics; b) would definitely be a user-visible breaking change. There's actually a test in the Lib/test/test_opcodes (iirc) that explicitly tests deleting __annotations__, then checks that modifying the annotations dict throws an exception. I haven't done any investigating to see if this check was the result of a regression, and there was a bpo issue, and there was a valid use case, etc etc etc. My instinct is that deleting o.__annotations__ is not an important or widely-used use case. In fact I plan to recommend against it in my "best practices" documentation. So either approach should be acceptable. Which means I should go with the simpler one, the one that will duplicate the function object's always-recreate-annotations-dicts behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 19:03:42 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 24 Apr 2021 23:03:42 +0000 Subject: [issue43929] Raise on threading.Event.__bool__ due to ambiguous nature In-Reply-To: <1619260783.59.0.920057566197.issue43929@roundup.psfhosted.org> Message-ID: <1619305422.22.0.298404976001.issue43929@roundup.psfhosted.org> Raymond Hettinger added the comment: Steven is right that this would be a behavior change. It is also out of line with Python norms where all objects are born true and have to learn to be false with either __len__ or __bool__. It is not a norm for bool(obj) to raise an exception. Following Steven's suggestion, I'll mark this a closed. Thank for the suggestion. ---------- nosy: +rhettinger resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 19:08:59 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 24 Apr 2021 23:08:59 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619305739.22.0.810581369259.issue43901@roundup.psfhosted.org> Guido van Rossum added the comment: Functions don't store __annotations__ in their __dict__, it is a separate slot named func_annotations (see funcobject.c). I guess that's because the __dict__ is purely for user-defined function attributes. But perhaps for classes the C equivalent of this pseudo-code will work? @property def __annotations__(self): if "__annotations__" not in self.__dict__: self.__dict__["__annotations__"] = {} return self.__dict__["__annotations__"] The whole thing is protected by the GIL of course, so there's no race condition between the check and the assignment. So if you look in __dict__ it will be like it's still Python 3.9, but if you're using the attribute (the recommended approach for code that only cares about 3.10) it'll be as if it always existed. Sounds pretty compatible to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 19:18:38 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 24 Apr 2021 23:18:38 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619306318.03.0.450904960264.issue43901@roundup.psfhosted.org> Guido van Rossum added the comment: So, honestly I don't understand what your concern with the lazy approach is. Was your design based on having a bit in the class/module object (outside its __dict__) saying "I already lazily created one"? Or am I missing something? Also, I'll stop going on about "best practice". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 19:19:34 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sat, 24 Apr 2021 23:19:34 +0000 Subject: [issue43762] Add audit events for loading of sqlite3 extensions In-Reply-To: <1617792679.62.0.407303342016.issue43762@roundup.psfhosted.org> Message-ID: <1619306374.91.0.807299687909.issue43762@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Good question. sqlite3_load_extension() loads an extension into a database connection, so it would make sense to also pass the connection object. I'd say we do it; it's a small change, and as you say: if we wanted to add it later, we couldn't. Ref. - http://www.sqlite.org/c3ref/load_extension.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 19:33:55 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sat, 24 Apr 2021 23:33:55 +0000 Subject: [issue43762] Add audit events for loading of sqlite3 extensions In-Reply-To: <1617792679.62.0.407303342016.issue43762@roundup.psfhosted.org> Message-ID: <1619307235.62.0.315049146643.issue43762@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Something like the attached patch, if I understand you correctly? ---------- Added file: https://bugs.python.org/file49982/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 19:37:12 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sat, 24 Apr 2021 23:37:12 +0000 Subject: [issue43762] Add audit events for loading of sqlite3 extensions In-Reply-To: <1617792679.62.0.407303342016.issue43762@roundup.psfhosted.org> Message-ID: <1619307432.94.0.651415299084.issue43762@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Maybe it's better to send the event only if the connection succeeded: diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c index 8dbfa7b38a..0220978cf2 100644 --- a/Modules/_sqlite/module.c +++ b/Modules/_sqlite/module.c @@ -97,6 +97,12 @@ static PyObject* module_connect(PyObject* self, PyObject* args, PyObject* result = PyObject_Call(factory, args, kwargs); + if (result) { + if (PySys_Audit("sqlite3.connected", "O", self) < 0) { + return -1; + } + } + return result; } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 19:41:30 2021 From: report at bugs.python.org (Brett Cannon) Date: Sat, 24 Apr 2021 23:41:30 +0000 Subject: [issue43864] [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead In-Reply-To: <1618578775.46.0.785924432695.issue43864@roundup.psfhosted.org> Message-ID: <1619307690.23.0.240190218632.issue43864@roundup.psfhosted.org> Change by Brett Cannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 19:51:50 2021 From: report at bugs.python.org (Larry Hastings) Date: Sat, 24 Apr 2021 23:51:50 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619308310.62.0.059162629675.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: > Functions don't store __annotations__ in their __dict__, it is a > separate slot named func_annotations (see funcobject.c). I guess > that's because the __dict__ is purely for user-defined function > attributes. I brought up functions because I'm now proposing to make classes and modules behave more like functions in this one way, that they too will now lazy-create an empty annotations dict every time. But yes, function objects don't store __annotations__ in their __dict__, and best practices for 3.9 and before was to use fn.__annotations__ or getattr() when getting the annotations from a function object, and 3.10 will not change that best practice. I don't know specifically why the implementor made that design choice, but I might have done that too. Most function objects don't have a __dict__ so this is almost always cheaper overall. And recreating the dict seems harmless. (Just to round the bases on this topic: I don't think you should be permitted to delete __annotations__, like most other metadata items on functions / classes / modules. But I don't propose to change that for 3.10.) > So if you look in __dict__ it will be like it's still Python 3.9, > but if you're using the attribute (the recommended approach for code > that only cares about 3.10) it'll be as if it always existed. Sounds > pretty compatible to me. Yes, exactly. That was the thing I finally figured out this afternoon. Sorry for being a slow learner. Again, this approach will change the semantics around deleting annotations on class and module objects. Deleting them won't be permanent--if you delete one, then ask for it, a fresh one will be created. But that seems harmless. > So, honestly I don't understand what your concern with the lazy > approach is. Was your design based on having a bit in the > class/module object (outside its __dict__) saying "I already > lazily created one"? Or am I missing something? My concern is that always lazy-creating on demand will change user-visible behavior. Consider this code: class C: a:int=3 del C.__annotations__ print(C.__annotations__) In 3.9, that throws an AttributeError, because C no longer has an '__annotations__' attribute. If I change Python 3.10 so that classes and modules *always* lazy-create __annotations__ if they don't have them, then this code will succeed and print an empty dict. That's a user-visible change, and I was hoping to avoid those entirely. Is it a breaking change? I doubt it. Is it an important change? It doesn't seem like it. I bring it up just in the interests of considering every angle. But I don't think this is important at all, and I think always lazy-creating annotations dicts on classes and modules is the right approach. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 20:01:08 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 25 Apr 2021 00:01:08 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619308868.09.0.547036032789.issue43901@roundup.psfhosted.org> Guido van Rossum added the comment: I think "no user-visible changes" is a pipe dream. Deleting __annotations__ seems fairly pointless so I don't mind changes that are only visible when you do that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 20:05:40 2021 From: report at bugs.python.org (wim glenn) Date: Sun, 25 Apr 2021 00:05:40 +0000 Subject: [issue28874] test_logging fails and freezes In-Reply-To: <1480923682.41.0.106352881958.issue28874@psf.upfronthosting.co.za> Message-ID: <1619309140.39.0.460635461223.issue28874@roundup.psfhosted.org> wim glenn added the comment: I was seeing this problem when building 3.6.4. Fixed it by replacing the test cert with a newer one from 3.6.13: curl https://raw.githubusercontent.com/python/cpython/v3.6.13/Lib/test/keycert.pem > ./Lib/test/keycert.pem Hope this helps someone else one day.. ---------- nosy: +wim.glenn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 20:11:06 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sun, 25 Apr 2021 00:11:06 +0000 Subject: [issue43754] Eliminate bindings for partial pattern matches In-Reply-To: <1617739231.38.0.2365910918.issue43754@roundup.psfhosted.org> Message-ID: <1619309466.61.0.974132750629.issue43754@roundup.psfhosted.org> Brandt Bucher added the comment: Since the feature freeze is coming up (and this changes the bytecode), I'd like to open this up for review now. It probably shouldn't actually be merged before the AST changes in issue 43892, though. There will be quite a few conflicts that need resolving, but I'd rather integrate the AST changes into this PR than force Nick to integrate these deeper changes into his branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 20:56:13 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 25 Apr 2021 00:56:13 +0000 Subject: [issue43918] anext builtin docstring has no signature text or info about default argument In-Reply-To: <1619148606.41.0.129428714687.issue43918@roundup.psfhosted.org> Message-ID: <1619312173.89.0.517491709181.issue43918@roundup.psfhosted.org> Terry J. Reedy added the comment: inspect.signature(anext) raises "ValueError: builtin has invalid signature". Guido, is this a bug? Even if not, docstring should have it. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 20:58:54 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 25 Apr 2021 00:58:54 +0000 Subject: [issue43889] Pickle performance regression in 3.10 In-Reply-To: <1618845135.21.0.985662855004.issue43889@roundup.psfhosted.org> Message-ID: <1619312334.22.0.75144972828.issue43889@roundup.psfhosted.org> Ken Jin added the comment: I'm unable to reproduce the regression locally with pyperformance. Additionally, the links on speed.python.org show that the results returned to normal after a week (again seemingly without any commit to cause such a change). I'm closing this bug as it doesn't seem related to the code in cpython itself. Thanks everyone. ----- $ pyperf compare_to 2021-04-13_23-59-master-11159d2c9d66.json.gz 2021-04-14_23-03-master-3fc65b97d09f.json.gz pickle_dict: Mean +- std dev: [2021-04-13_23-59-master-11159d2c9d66] 72.0 us +- 1.6 us -> [2021-04-14_23-03-master-3fc65b97d09f] 73.1 us +- 0.9 us: 1.02x slower pickle_list: Mean +- std dev: [2021-04-13_23-59-master-11159d2c9d66] 11.1 us +- 0.1 us -> [2021-04-14_23-03-master-3fc65b97d09f] 11.0 us +- 0.1 us: 1.01x faster Benchmark hidden because not significant (1): pickle Geometric mean: 1.00x slower ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 21:27:57 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 25 Apr 2021 01:27:57 +0000 Subject: [issue43925] Add hangul syllables to unicodedata.decomposititon In-Reply-To: <1619199570.5.0.82333265185.issue43925@roundup.psfhosted.org> Message-ID: <1619314077.29.0.133987516933.issue43925@roundup.psfhosted.org> Terry J. Reedy added the comment: I verified the claim in 3.19.0a7 freshly compiled today. >>> import unicodedata as ud >>> ud.decomposition('\uac00') '' >>> for cp in range(0xac00, 0xd7a4): if (s := ud.decomposition(chr(cp))) != '': print(cp, s) >>> ---------- nosy: +terry.reedy type: -> enhancement versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 21:46:44 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 25 Apr 2021 01:46:44 +0000 Subject: [issue43874] argparse crashes on subparsers with no dest/metava In-Reply-To: <1618600066.88.0.240618154113.issue43874@roundup.psfhosted.org> Message-ID: <1619315204.11.0.494850284343.issue43874@roundup.psfhosted.org> Terry J. Reedy added the comment: Wait for responses ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 22:31:28 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 25 Apr 2021 02:31:28 +0000 Subject: [issue42737] PEP 563: drop annotations for complex assign targets In-Reply-To: <1608888770.02.0.483696766952.issue42737@roundup.psfhosted.org> Message-ID: <1619317888.44.0.238649659568.issue42737@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset 8cc3cfa8afab1651c4f6e9ba43a7ab7f10f64c32 by Batuhan Taskaya in branch 'master': bpo-42737: annotations with complex targets no longer causes any runtime effects (GH-23952) https://github.com/python/cpython/commit/8cc3cfa8afab1651c4f6e9ba43a7ab7f10f64c32 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 22:54:34 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 25 Apr 2021 02:54:34 +0000 Subject: [issue42725] PEP 563: Should the behavior change for yield/yield from's In-Reply-To: <1608730131.08.0.595189962302.issue42725@roundup.psfhosted.org> Message-ID: <1619319274.64.0.964012244011.issue42725@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +24303 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25583 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 22:59:21 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 25 Apr 2021 02:59:21 +0000 Subject: [issue42737] PEP 563: drop annotations for complex assign targets In-Reply-To: <1608888770.02.0.483696766952.issue42737@roundup.psfhosted.org> Message-ID: <1619319561.52.0.00468680121063.issue42737@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- resolution: -> postponed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 22:59:46 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 25 Apr 2021 02:59:46 +0000 Subject: [issue42737] PEP 563: drop annotations for complex assign targets In-Reply-To: <1608888770.02.0.483696766952.issue42737@roundup.psfhosted.org> Message-ID: <1619319586.18.0.862040338832.issue42737@roundup.psfhosted.org> Batuhan Taskaya added the comment: Ah, seems like there is still one open PR. Keeping this up for that... ---------- resolution: postponed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 23:12:23 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 25 Apr 2021 03:12:23 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1619320343.74.0.577956103437.issue38530@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- nosy: +Dennis Sweeney nosy_count: 8.0 -> 9.0 pull_requests: +24304 pull_request: https://github.com/python/cpython/pull/25584 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 23:15:21 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 25 Apr 2021 03:15:21 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1619320521.89.0.89015209475.issue38530@roundup.psfhosted.org> Dennis Sweeney added the comment: I opened PR 25584 to fix this current behavior: >>> v Traceback (most recent call last): File "", line 1, in NameError: name 'v' is not defined. Did you mean: 'id'? >>> vv Traceback (most recent call last): File "", line 1, in NameError: name 'vv' is not defined. Did you mean: 'id'? >>> vvv Traceback (most recent call last): File "", line 1, in NameError: name 'vvv' is not defined. Did you mean: 'abs'? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 24 23:52:35 2021 From: report at bugs.python.org (Aritn Sarraf) Date: Sun, 25 Apr 2021 03:52:35 +0000 Subject: [issue43929] Raise on threading.Event.__bool__ due to ambiguous nature In-Reply-To: <1619260783.59.0.920057566197.issue43929@roundup.psfhosted.org> Message-ID: <1619322755.55.0.405023959623.issue43929@roundup.psfhosted.org> Aritn Sarraf added the comment: Understood. Thanks both, for taking the time to look. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 00:33:19 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 25 Apr 2021 04:33:19 +0000 Subject: [issue43888] GitHub Actions CI/CD `Coverage` job is broken on master In-Reply-To: <1618833046.45.0.972351861197.issue43888@roundup.psfhosted.org> Message-ID: <1619325199.16.0.52464035776.issue43888@roundup.psfhosted.org> Batuhan Taskaya added the comment: Coverage runs are still failing on the master, and I think at least we should do something like allow failure or other wise github will send notifications for this flaky run. ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 00:36:37 2021 From: report at bugs.python.org (Ammar Askar) Date: Sun, 25 Apr 2021 04:36:37 +0000 Subject: [issue43888] GitHub Actions CI/CD `Coverage` job is broken on master In-Reply-To: <1618833046.45.0.972351861197.issue43888@roundup.psfhosted.org> Message-ID: <1619325397.7.0.594053374762.issue43888@roundup.psfhosted.org> Ammar Askar added the comment: For what it's worth I think Brett's suggestion of just removing the coverage build entirely is good too since it seems like no one actually looks at the results and they take up valuable CI time. ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 01:31:46 2021 From: report at bugs.python.org (Victor Milovanov) Date: Sun, 25 Apr 2021 05:31:46 +0000 Subject: [issue14965] super() and property inheritance behavior In-Reply-To: <1338433441.66.0.975494137492.issue14965@psf.upfronthosting.co.za> Message-ID: <1619328706.7.0.0878016779083.issue14965@roundup.psfhosted.org> Victor Milovanov added the comment: There's a patch attached to this bug. Why is its stage "needs patch"? ---------- nosy: +Victor Milovanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 01:34:53 2021 From: report at bugs.python.org (Erik Welch) Date: Sun, 25 Apr 2021 05:34:53 +0000 Subject: [issue43918] anext builtin docstring has no signature text or info about default argument In-Reply-To: <1619148606.41.0.129428714687.issue43918@roundup.psfhosted.org> Message-ID: <1619328893.55.0.758428220267.issue43918@roundup.psfhosted.org> 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 appropriate to me to add it to the docstring at this point in time. Search for "" to find other functions and methods that have the same issue. `dict.pop` is one such example. `inspect.signature(anext)` and `inspect.signature(next)` both raise ValueError. The text for `next` is what one may hope to see (and why you raise a fair point): `"ValueError: no signature found for builtin "`. The difference between `anext` and `next` in this regard is that `anext` uses the argument clinic. It is the argument clinic that converts `NULL` to `""` in the signature text that inspect tries (and fails) to parse to get the AST of. I actually did poke around a bit at having the the Argument Clinic and `inspect` module more intelligently pick up this case to give a better error. I think this is doable, but should not be part of this bug report. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 02:06:31 2021 From: report at bugs.python.org (Ma Lin) Date: Sun, 25 Apr 2021 06:06:31 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1619330791.05.0.877588730635.issue41486@roundup.psfhosted.org> Ma Lin added the comment: > The defines of BOB_BUFFER_TYPE/BOB_SIZE_TYPE/BOB_SIZE_MAX are ugly. If put the core code together, these defines can be put in a thin wrapper in _bz2module.c/_lzmamodule.c/zlibmodule.c files. I tried, it looks well. I will updated the PR within one or two days. The code is more concise, and the burden of review is not big. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 02:56:02 2021 From: report at bugs.python.org (paul j3) Date: Sun, 25 Apr 2021 06:56:02 +0000 Subject: [issue43876] argparse documentation contrasting nargs '*' vs. '+' is misleading In-Reply-To: <1618605356.69.0.0775347773509.issue43876@roundup.psfhosted.org> Message-ID: <1619333762.26.0.242771351703.issue43876@roundup.psfhosted.org> paul j3 added the comment: Let's see if I can clarify somethings. But first, I should say that I've worked with this code for so long, that I may miss things that could confuse a beginner. A basic distinction is between "optionals" and "positionals". I put those in quotes because that's not the same as "required or not". Talk about "options" in commandline arguments goes way back (see getopt, and optparse). An "optional" is identified by a flag string, such as "-f" or "--foo", short or long, single or double dash. I prefer to call these "flagged arguments". "optionals" can occur in any order, and even repeatedly. A "postional" is identified by position, without any sort of flag string. In earlier parsers, these where the extras, the strings that weren't handled by "options". These can only occur in the defined order. Conventionally, optionals come first, and positionals at the end. That's how most "help/usage" messages display them. But argparse tries to handle them in any order. Both kinds can take a "nargs" parameter. This specifies how many arguments (or strings) are required, either following the flag string, or as part of position. Obviously if you don't specify the flag, you don't have to provide its arguments either. There's another point of confusion. "parse.add_argument" creates an "Action", also called an "argument". And each "action" has a 'nargs' that specifies how many "arguments" go along with it. Sorry. The default "nargs" value is "None", which means 1 string. "?" means zro or one (optional, but in a different sense than flagged). "*" means any number. "+" means one or more. nargs could also be a number, e.g. "2". There isn't anything that specifies "2 or more" or "2 or 3" (though that has been requested). "?+*" are used in basically the same sense as in regex/re patterns. There's another parameter, "action", which also controls the number of required strings. With "store_true" no string is allowed after the flag, effectively "nargs=0" (this action makes no sense for positionals). It's actually of subclass of "store_const", with a default "False" and const "True". With a flagged argument, you may also specify a "required" parameter. That's convenient, but does lead to confusing terminology. "optionals" may be "required", and a "positional" with "?" is optional/not-required. Since "+" and "*" allow many strings, something has to define the end of that list. That end is either the end of the input, or the next flag string. If you are just using flagged arguments this isn't a problem. But with "positionals", it is hard to handle more than one open-end nargs. Or to use such a "positional" after an open-ended "optional". As with regex, these nargs are "greedy". In some ways, the documentation is more complicated than the code itself. The code is well written, with different methods and classes handling different issues. The code itself does not have a lot of complicated rules and conditions. The complexity comes from how the different pieces interact. "flagged vs positional", nargs, and "required" are separate specifications, though they do have significant interactions. In your example: parser.add_argument("outdata", help="Path to output data file") parser.add_argument("plotTimes", nargs='*', help="Times to plot") parser.add_argument("outplot", help="Path to output plot file") "outdata" takes one string. "outplot" takes another. "plotTimes" then gets anything left over in between. An empty list of strings satisfies its "nargs". The strings are actually allocated with a regex expression. With `arg_argument('--foo', nargs='+')`, --foo one --foo one two three are both allowed. With "*", --foo is also allowed. For a "positional" omit the "--foo". That means that a "positional" with "*" is always seen (which can require some special edge case handling). ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 02:57:42 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 25 Apr 2021 06:57:42 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619333862.07.0.12802806731.issue43892@roundup.psfhosted.org> Nick Coghlan added the comment: Interesting idea - I had missed that you were suggested "identifier*" for the cls node. It's simple enough to check for Name-or-Attribute in the AST validator though, and sticking with a standard expr_ty node means getting a lot of standard handling in the rest of the compiler and the unparser. My commitments today finished earlier than I expected, so I'm about to tackle the unparser now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 03:05:49 2021 From: report at bugs.python.org (paul j3) Date: Sun, 25 Apr 2021 07:05:49 +0000 Subject: [issue11354] argparse: nargs could accept range of options count In-Reply-To: <1298911895.1.0.590272861033.issue11354@psf.upfronthosting.co.za> Message-ID: <1619334349.37.0.131636225175.issue11354@roundup.psfhosted.org> paul j3 added the comment: Post parsing testing for the correct number of strings is the easy part. It's the auto-generate usage that's harder to do right, especially if we wanted to enable the metavar tuple option. Clean usage for '+' is messy enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 03:10:49 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 25 Apr 2021 07:10:49 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619334649.42.0.0430994011466.issue43892@roundup.psfhosted.org> Nick Coghlan added the comment: Working on the unparser picked up an inconsistency I had previously missed: aside from named expressions, "target" attributes in the AST are generally full expression subnodes, rather than identifier attributes. Identifier attributes on nodes are typically called "name", including in the originally implemented MatchAs node. Accordingly, I've switched both MatchStar and MatchAs over to having "name" attributes instead of "target" attributes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 04:43:54 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 25 Apr 2021 08:43:54 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619340234.73.0.551203925119.issue43892@roundup.psfhosted.org> Change by Nick Coghlan : ---------- pull_requests: +24305 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25585 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 04:56:33 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 25 Apr 2021 08:56:33 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619340993.57.0.190396707619.issue43892@roundup.psfhosted.org> Nick Coghlan added the comment: PR against the main repo is now up: https://github.com/python/cpython/pull/25585 A couple of things in the unparser tripped me up (ast_unparse.c only handles annotation expressions, the way ast._Unparser.visit() is defined means NodeVisitor.generic_visit can't be used), so the PR also includes some clarifying comments for future editors. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 05:37:40 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sun, 25 Apr 2021 09:37:40 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619343460.39.0.840506897717.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: The more I read about these issues, the more I feel reluctant to apply PR 25520. Why change the behaviour/traits of heap types without a proper discussion (or PEP)? Applying this PR feels like an arbitrary change. All the related issues and mailing list discussions seems to end without consensus, and fundamental questions (what is an immutable type? which types should be immutable? why is it a problem that a type is mutable?) seems to be avoided all the time. And, as Victor points out in msg391596 (and which has also been pointed out by others in other discussions): > Currently, the limitation of not being able to modify a built-in type is arbitrary, it's not a technical limitation FWIW #1, in pypy3, datetime.timedelta.foo = 1 is ok; in python3 (3.7-3.10) it's not. FWIW #2, in Python 3.9, functools.partialmethod is implemented in Python, and functools.partial is implemented in C as a static type: $ python3.9 >>> import functools >>> functools.partial.foo = 1 # is this a problem? Traceback (most recent call last): File "", line 1, in TypeError: can't set attributes of built-in/extension type 'functools.partial' >>> functools.partialmethod.foo = 1 # is this a problem? If I'm only bringing noise into the discussion, feel free to remove me from the nosy list. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 05:59:30 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 25 Apr 2021 09:59:30 +0000 Subject: [issue43466] ssl/hashlib: Add configure option to set or auto-detect rpath to OpenSSL libs In-Reply-To: <1615418043.46.0.229114131093.issue43466@roundup.psfhosted.org> Message-ID: <1619344770.25.0.679495409896.issue43466@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24306 pull_request: https://github.com/python/cpython/pull/25587 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:08:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Apr 2021 10:08:02 +0000 Subject: [issue43655] Tkinter: make X window & macOS recognize dialogs as such In-Reply-To: <1617008023.65.0.620967294098.issue43655@roundup.psfhosted.org> Message-ID: <1619345282.14.0.926519042033.issue43655@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 3bb3fb3be09d472a43cdc3d9d9578bd49f3dfb8c by Serhiy Storchaka in branch 'master': bpo-43655: Tkinter and IDLE dialog windows are now recognized as dialogs by window managers on macOS and X Window (#25187) https://github.com/python/cpython/commit/3bb3fb3be09d472a43cdc3d9d9578bd49f3dfb8c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:13:13 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Apr 2021 10:13:13 +0000 Subject: [issue43655] Tkinter: make X window & macOS recognize dialogs as such In-Reply-To: <1617008023.65.0.620967294098.issue43655@roundup.psfhosted.org> Message-ID: <1619345593.76.0.233768781489.issue43655@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +24307 pull_request: https://github.com/python/cpython/pull/25588 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:17:00 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Apr 2021 10:17:00 +0000 Subject: [issue43534] turtle.textinput window is not transient In-Reply-To: <1616029936.62.0.714792032874.issue43534@roundup.psfhosted.org> Message-ID: <1619345820.49.0.393263938613.issue43534@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24308 pull_request: https://github.com/python/cpython/pull/25589 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:17:05 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Apr 2021 10:17:05 +0000 Subject: [issue43534] turtle.textinput window is not transient In-Reply-To: <1616029936.62.0.714792032874.issue43534@roundup.psfhosted.org> Message-ID: <1619345825.16.0.512845597505.issue43534@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24309 pull_request: https://github.com/python/cpython/pull/25590 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:16:53 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Apr 2021 10:16:53 +0000 Subject: [issue43534] turtle.textinput window is not transient In-Reply-To: <1616029936.62.0.714792032874.issue43534@roundup.psfhosted.org> Message-ID: <1619345813.21.0.9500154785.issue43534@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset b5adc8a7e5c13d175b4d3e53b37bc61de35b1457 by Serhiy Storchaka in branch 'master': bpo-43534: Make dialogs in turtle.textinput() and turtle.numinput() transitient again (GH-24923) https://github.com/python/cpython/commit/b5adc8a7e5c13d175b4d3e53b37bc61de35b1457 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:31:39 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Apr 2021 10:31:39 +0000 Subject: [issue43937] Turtle uses the default root window Message-ID: <1619346699.57.0.755542402356.issue43937@roundup.psfhosted.org> New submission from Serhiy Storchaka : Some of methods in the turtle module implicitly use the default root window: call global mainloop() and create PhotoImage without specifying the master window. It can cause a problem if multiple root windows are used. ---------- components: Library (Lib) messages: 391849 nosy: gregorlingl, serhiy.storchaka, willingc priority: normal severity: normal status: open title: Turtle uses the default root window type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:35:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Apr 2021 10:35:47 +0000 Subject: [issue43534] turtle.textinput window is not transient In-Reply-To: <1616029936.62.0.714792032874.issue43534@roundup.psfhosted.org> Message-ID: <1619346947.42.0.410698590889.issue43534@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +24310 pull_request: https://github.com/python/cpython/pull/25591 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:38:05 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Apr 2021 10:38:05 +0000 Subject: [issue42609] Eval with too high string multiplication crashes newer Python versions In-Reply-To: <1607511907.66.0.321451468972.issue42609@roundup.psfhosted.org> Message-ID: <1619347085.77.0.173765800908.issue42609@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset face87c94e67ad9c72b9a3724f112fd76c1002b9 by Serhiy Storchaka in branch 'master': bpo-42609: Check recursion depth in the AST validator and optimizer (GH-23744) https://github.com/python/cpython/commit/face87c94e67ad9c72b9a3724f112fd76c1002b9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:40:51 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Apr 2021 10:40:51 +0000 Subject: [issue39529] Deprecate get_event_loop() In-Reply-To: <1580641897.21.0.210075972969.issue39529@roundup.psfhosted.org> Message-ID: <1619347251.52.0.999392111199.issue39529@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 172c0f2752d8708b6dda7b42e6c5a3519420a4e8 by Serhiy Storchaka in branch 'master': bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() (GH-23554) https://github.com/python/cpython/commit/172c0f2752d8708b6dda7b42e6c5a3519420a4e8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:43:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Apr 2021 10:43:30 +0000 Subject: [issue39529] Deprecate get_event_loop() In-Reply-To: <1580641897.21.0.210075972969.issue39529@roundup.psfhosted.org> Message-ID: <1619347410.5.0.217639956436.issue39529@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:44:37 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Apr 2021 10:44:37 +0000 Subject: [issue43534] turtle.textinput window is not transient In-Reply-To: <1616029936.62.0.714792032874.issue43534@roundup.psfhosted.org> Message-ID: <1619347477.73.0.261627342138.issue43534@roundup.psfhosted.org> miss-islington added the comment: New changeset 7248ce30bb84f2d5af855a867cc4e3cc40a07fb5 by Miss Islington (bot) in branch '3.9': bpo-43534: Make dialogs in turtle.textinput() and turtle.numinput() transitient again (GH-24923) https://github.com/python/cpython/commit/7248ce30bb84f2d5af855a867cc4e3cc40a07fb5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:45:04 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Apr 2021 10:45:04 +0000 Subject: [issue43664] Compiling long expression leads to segfault (again) In-Reply-To: <1617078944.41.0.741182615703.issue43664@roundup.psfhosted.org> Message-ID: <1619347504.2.0.980506199529.issue43664@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Eval with too high string multiplication crashes newer Python versions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:45:23 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Apr 2021 10:45:23 +0000 Subject: [issue43534] turtle.textinput window is not transient In-Reply-To: <1616029936.62.0.714792032874.issue43534@roundup.psfhosted.org> Message-ID: <1619347523.88.0.74186467465.issue43534@roundup.psfhosted.org> miss-islington added the comment: New changeset c70f268523cb3213693710e14c0fcae81fd3fa7a by Miss Islington (bot) in branch '3.8': bpo-43534: Make dialogs in turtle.textinput() and turtle.numinput() transitient again (GH-24923) https://github.com/python/cpython/commit/c70f268523cb3213693710e14c0fcae81fd3fa7a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:46:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Apr 2021 10:46:29 +0000 Subject: [issue43937] Turtle uses the default root window In-Reply-To: <1619346699.57.0.755542402356.issue43937@roundup.psfhosted.org> Message-ID: <1619347589.42.0.533013881847.issue43937@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +24311 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25591 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:47:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Apr 2021 10:47:09 +0000 Subject: [issue43534] turtle.textinput window is not transient In-Reply-To: <1616029936.62.0.714792032874.issue43534@roundup.psfhosted.org> Message-ID: <1619347629.64.0.982381939232.issue43534@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: -24310 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:47:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Apr 2021 10:47:27 +0000 Subject: [issue43534] turtle.textinput window is not transient In-Reply-To: <1616029936.62.0.714792032874.issue43534@roundup.psfhosted.org> Message-ID: <1619347647.75.0.4570514685.issue43534@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:49:35 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Apr 2021 10:49:35 +0000 Subject: [issue43655] Tkinter: make X window & macOS recognize dialogs as such In-Reply-To: <1617008023.65.0.620967294098.issue43655@roundup.psfhosted.org> Message-ID: <1619347775.12.0.566801268364.issue43655@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 9a165399aec930f27639dd173426ccc33586662b by Serhiy Storchaka in branch '3.9': [3.9] bpo-43655: Tkinter and IDLE dialog windows are now recognized as dialogs by window managers on macOS and X Window (GH-25187). (GH-25588) https://github.com/python/cpython/commit/9a165399aec930f27639dd173426ccc33586662b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 06:49:40 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Apr 2021 10:49:40 +0000 Subject: [issue43655] Tkinter: make X window & macOS recognize dialogs as such In-Reply-To: <1617008023.65.0.620967294098.issue43655@roundup.psfhosted.org> Message-ID: <1619347780.87.0.486913442602.issue43655@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +24312 pull_request: https://github.com/python/cpython/pull/25592 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 07:06:51 2021 From: report at bugs.python.org (Andre Roberge) Date: Sun, 25 Apr 2021 11:06:51 +0000 Subject: [issue43914] Highlight invalid ranges in SyntaxErrors In-Reply-To: <1619114890.78.0.876060892584.issue43914@roundup.psfhosted.org> Message-ID: <1619348811.0.0.798597190274.issue43914@roundup.psfhosted.org> Change by Andre Roberge : ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 07:19:55 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Apr 2021 11:19:55 +0000 Subject: [issue43655] Tkinter: make X window & macOS recognize dialogs as such In-Reply-To: <1617008023.65.0.620967294098.issue43655@roundup.psfhosted.org> Message-ID: <1619349595.79.0.10585792268.issue43655@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 6077efa2b2be17e736d061fe74f933dc616c64b2 by Miss Islington (bot) in branch '3.8': [3.9] bpo-43655: Tkinter and IDLE dialog windows are now recognized as dialogs by window managers on macOS and X Window (GH-25187). (GH-25588) (GH-25592) https://github.com/python/cpython/commit/6077efa2b2be17e736d061fe74f933dc616c64b2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 07:20:20 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Apr 2021 11:20:20 +0000 Subject: [issue43655] Tkinter: make X window & macOS recognize dialogs as such In-Reply-To: <1617008023.65.0.620967294098.issue43655@roundup.psfhosted.org> Message-ID: <1619349620.84.0.602431008215.issue43655@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 07:45:22 2021 From: report at bugs.python.org (Tal Einat) Date: Sun, 25 Apr 2021 11:45:22 +0000 Subject: [issue38490] statistics: add covariance, Pearson's correlation, and simple linear regression In-Reply-To: <1571175609.51.0.475949905245.issue38490@roundup.psfhosted.org> Message-ID: <1619351122.66.0.141237544171.issue38490@roundup.psfhosted.org> Tal Einat added the comment: New changeset 09aa6f914dc313875ff18474770a0a7c13ea8dea by Tymoteusz Wo?od?ko in branch 'master': bpo-38490: statistics: Add covariance, Pearson's correlation, and simple linear regression (#16813) https://github.com/python/cpython/commit/09aa6f914dc313875ff18474770a0a7c13ea8dea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 07:47:06 2021 From: report at bugs.python.org (Tal Einat) Date: Sun, 25 Apr 2021 11:47:06 +0000 Subject: [issue38490] statistics: add covariance, Pearson's correlation, and simple linear regression In-Reply-To: <1571175609.51.0.475949905245.issue38490@roundup.psfhosted.org> Message-ID: <1619351226.06.0.234109071616.issue38490@roundup.psfhosted.org> Tal Einat added the comment: Thanks for the suggestion, PR, and great heaps of patience and perseverance, Tymek! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 10:49:39 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Apr 2021 14:49:39 +0000 Subject: [issue43534] turtle.textinput window is not transient In-Reply-To: <1616029936.62.0.714792032874.issue43534@roundup.psfhosted.org> Message-ID: <1619362179.67.0.630414985889.issue43534@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 8af929fc76f21fb123f6a47cb3ebcf4e5b758dea by Serhiy Storchaka in branch 'master': bpo-43534: Fix the turtle module working with multiple root windows (GH-25591) https://github.com/python/cpython/commit/8af929fc76f21fb123f6a47cb3ebcf4e5b758dea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 10:49:44 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Apr 2021 14:49:44 +0000 Subject: [issue43534] turtle.textinput window is not transient In-Reply-To: <1616029936.62.0.714792032874.issue43534@roundup.psfhosted.org> Message-ID: <1619362184.5.0.512860279352.issue43534@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24313 pull_request: https://github.com/python/cpython/pull/25593 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 10:49:50 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Apr 2021 14:49:50 +0000 Subject: [issue43534] turtle.textinput window is not transient In-Reply-To: <1616029936.62.0.714792032874.issue43534@roundup.psfhosted.org> Message-ID: <1619362190.45.0.269752831649.issue43534@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24314 pull_request: https://github.com/python/cpython/pull/25594 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 10:49:59 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 25 Apr 2021 14:49:59 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1619362199.74.0.474192783071.issue43882@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- keywords: +patch pull_requests: +24315 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25595 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 10:53:44 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 25 Apr 2021 14:53:44 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1619362424.82.0.61890367104.issue43882@roundup.psfhosted.org> Senthil Kumaran added the comment: I have added a PR to remove ascii newlines and tabs from URL input. It is as per the WHATWG spec. However, I still like to research more and find out if this isn't introducing behavior that will break existing systems. It should also be aligned the decisions we have made with previous related bug reports. Please review. ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 11:08:23 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sun, 25 Apr 2021 15:08:23 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1619363303.25.0.6746224492.issue38605@roundup.psfhosted.org> Change by Anthony Sottile : ---------- nosy: +Anthony Sottile nosy_count: 14.0 -> 15.0 pull_requests: +24316 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/25596 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 12:05:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 25 Apr 2021 16:05:23 +0000 Subject: [issue8579] Add missing tests for FlushKey, LoadKey, and SaveKey in winreg In-Reply-To: <1272650551.21.0.0191974450566.issue8579@psf.upfronthosting.co.za> Message-ID: <1619366723.04.0.638839915583.issue8579@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Tests nosy: +paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 12:15:40 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 25 Apr 2021 16:15:40 +0000 Subject: [issue35676] unittest assert helper methods have incorrect signature in docs In-Reply-To: <1546834667.39.0.848001961358.issue35676@roundup.psfhosted.org> Message-ID: <1619367340.39.0.393928701407.issue35676@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 12:22:07 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 25 Apr 2021 16:22:07 +0000 Subject: [issue24026] Python hangs forever in wait() of threading.py In-Reply-To: <1429712264.48.0.476930197364.issue24026@psf.upfronthosting.co.za> Message-ID: <1619367727.26.0.179507871568.issue24026@roundup.psfhosted.org> Irit Katriel added the comment: Python 2.7 is no longer maintained. If this is still a problem in python 3.8+, and you manage to produce a repro script, please open a new issue for it. ---------- nosy: +iritkatriel resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 12:25:34 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 25 Apr 2021 16:25:34 +0000 Subject: [issue43938] Document that dataclasses.FrozenInstanceError derives from AttributeError Message-ID: <1619367934.66.0.118444398997.issue43938@roundup.psfhosted.org> New submission from Eric V. Smith : This is a newcomer friendly issue. The documentation just needs a sentence that FrozenInstanceError is derived from AttributeError. ---------- assignee: docs at python components: Documentation keywords: easy, newcomer friendly messages: 391861 nosy: docs at python, eric.smith priority: normal severity: normal stage: needs patch status: open title: Document that dataclasses.FrozenInstanceError derives from AttributeError versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 12:58:46 2021 From: report at bugs.python.org (DaRoee) Date: Sun, 25 Apr 2021 16:58:46 +0000 Subject: [issue43939] Deadlock in logging Message-ID: <1619369926.8.0.917759570645.issue43939@roundup.psfhosted.org> New submission from DaRoee : I've recently encountered a weird bug. To make a long story short, I?ve been using an external package to make sure my threads stop working in time, and appearently it?s been using ctypes.pythonapi.PyThreadState_SetAsyncExc. There is a slight chance, that this code that is literally injecting an exception in the thread, will throw an exception in the handle function of the logger, right after the acquire. This will make the whole process deadlocked (only the thread with the exception will be able to continue logging) once the other threads try to log. While I totally understand that this is not a casual use case, I think that the logger should be able to handle situations such as this... The good news is that I?ve created a test (attached) that once you run it with pytest it?ll reproduce constantly (even though it?s a statistical bug), and the solution for this is relatively easy. Once we change the lock to use context manager the whole action is much more atomic, making the test pass constantly. I?d be happy to help solve it, and replace locks to context manager usage throughout the file (or whatever the maintainers see fit for this). ---------- components: Library (Lib) files: reproduction_test.py messages: 391862 nosy: DaRoee priority: normal severity: normal status: open title: Deadlock in logging type: behavior versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file49983/reproduction_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 13:31:48 2021 From: report at bugs.python.org (robertohueso) Date: Sun, 25 Apr 2021 17:31:48 +0000 Subject: [issue32822] finally block doesn't re-raise exception if return statement exists inside In-Reply-To: <1518387497.4.0.467229070634.issue32822@psf.upfronthosting.co.za> Message-ID: <1619371908.55.0.263970424589.issue32822@roundup.psfhosted.org> Change by robertohueso : ---------- keywords: +patch nosy: +robertohueso nosy_count: 4.0 -> 5.0 pull_requests: +24317 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25600 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 13:49:00 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 25 Apr 2021 17:49:00 +0000 Subject: [issue26810] inconsistent garbage collector behavior across platforms when using ctypes data-structures In-Reply-To: <1461168268.36.0.0880478693475.issue26810@psf.upfronthosting.co.za> Message-ID: <1619372940.3.0.948158546619.issue26810@roundup.psfhosted.org> Irit Katriel added the comment: I don't think GC is even guaranteed to do exactly the same thing in two different runs on the same platform. If objects are hashed by id (memory address) and then traversed then couldn't the order in which unrelated objects are deleted be non-deterministic? In any case, 2.7 is no longer maintained. If you can provide a simple repro script for 3.9+, a GC expert may look at it. Open a new issue if you do that. ---------- nosy: +iritkatriel resolution: -> not a bug stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 14:03:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 25 Apr 2021 18:03:25 +0000 Subject: [issue27420] Docs for os.link - say what happens if link already exists In-Reply-To: <1467282816.95.0.317527848578.issue27420@psf.upfronthosting.co.za> Message-ID: <1619373805.11.0.263397116353.issue27420@roundup.psfhosted.org> Irit Katriel added the comment: There is a general note at the top of the module: "Note: All functions in this module raise OSError (or subclasses thereof) in the case of invalid or inaccessible file names and paths, or other arguments that have the correct type, but are not accepted by the operating system." So there seems to have been a decision not state this separately for each function in the module. ---------- nosy: +iritkatriel resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 14:13:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 25 Apr 2021 18:13:44 +0000 Subject: [issue31055] All Sphinx generated pages could have a new "Edit This Page" link adjacent to the existing "Show Source" In-Reply-To: <1501159526.11.0.527058516666.issue31055@psf.upfronthosting.co.za> Message-ID: <1619374424.97.0.313473289691.issue31055@roundup.psfhosted.org> Irit Katriel added the comment: Another option is to just add a link to https://devguide.python.org/docquality/ ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 14:16:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 25 Apr 2021 18:16:03 +0000 Subject: [issue29732] Heap out of bounds read in tok_nextc() In-Reply-To: <1488788024.7.0.161413972339.issue29732@psf.upfronthosting.co.za> Message-ID: <1619374563.15.0.20922576255.issue29732@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 14:37:47 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 25 Apr 2021 18:37:47 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619375867.47.0.613895842996.issue43908@roundup.psfhosted.org> Guido van Rossum added the comment: My main concern is that types that were immutable in previous Python versions shouldn't become mutable as a surprise side effect of making them heap types. I don't know which types have become mutable this way though. My other concern is that the language design *intentionally* disallowed mutating built-in types (unlike some other languages that allow it, e.g. Ruby). Mutating built-in types is one of those "attractive nuisance" anti-patterns where at a small scale this often appears to be the quickest way to solve a problem, but it tends to break unrelated things in larger-scale applications (when different libraries using such tricks collide). (There's also a concern about mutating types that are shared between multiple interpreters, but IIUC heap types are not shared, so this shouldn't be a problem.) Presumably we should review the list of heap types that you are proposing to make immutable (in a form more easily digestible by humans than a diff) and reach agreement on that. And perhaps the list should include information on when a type became a heap type. (Types that were always heap types probably needn't be changed.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 14:42:16 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Sun, 25 Apr 2021 18:42:16 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619376136.6.0.411367009904.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Thanks for the background info, Guido! I'll prepare a list. Should we continue the discussion on Discourse or python-dev? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 14:45:51 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 25 Apr 2021 18:45:51 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619376136.6.0.411367009904.issue43908@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Let's post the list here and post a brief mention of this issue on python-dev. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 15:12:59 2021 From: report at bugs.python.org (Saiyang Gou) Date: Sun, 25 Apr 2021 19:12:59 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1619377979.36.0.432689334104.issue38605@roundup.psfhosted.org> Change by Saiyang Gou : ---------- pull_requests: +24318 pull_request: https://github.com/python/cpython/pull/25602 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 15:49:50 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Apr 2021 19:49:50 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1619380190.61.0.590033174788.issue38605@roundup.psfhosted.org> miss-islington added the comment: New changeset f84f1b5c638eeb6e13c287fe5ebf3a7d2fdb60e9 by Saiyang Gou in branch 'master': bpo-38605: Update __future__ module doc as `annotations` is now "mandatory in 3.11" (GH-25602) https://github.com/python/cpython/commit/f84f1b5c638eeb6e13c287fe5ebf3a7d2fdb60e9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 16:51:31 2021 From: report at bugs.python.org (Llandy Riveron Del Risco) Date: Sun, 25 Apr 2021 20:51:31 +0000 Subject: [issue43938] Document that dataclasses.FrozenInstanceError derives from AttributeError In-Reply-To: <1619367934.66.0.118444398997.issue43938@roundup.psfhosted.org> Message-ID: <1619383891.04.0.554882068312.issue43938@roundup.psfhosted.org> Change by Llandy Riveron Del Risco : ---------- keywords: +patch nosy: +llandy3d nosy_count: 2.0 -> 3.0 pull_requests: +24319 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25603 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 17:43:54 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 25 Apr 2021 21:43:54 +0000 Subject: [issue43532] Add keyword-only fields to dataclasses In-Reply-To: <1616002761.92.0.652624260802.issue43532@roundup.psfhosted.org> Message-ID: <1619387034.56.0.471085662919.issue43532@roundup.psfhosted.org> Change by Eric V. Smith : ---------- pull_requests: +24320 pull_request: https://github.com/python/cpython/pull/25608 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 18:09:46 2021 From: report at bugs.python.org (DaRoee) Date: Sun, 25 Apr 2021 22:09:46 +0000 Subject: [issue43939] Deadlock in logging In-Reply-To: <1619369926.8.0.917759570645.issue43939@roundup.psfhosted.org> Message-ID: <1619388586.36.0.151516496399.issue43939@roundup.psfhosted.org> Change by DaRoee : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 18:32:40 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 25 Apr 2021 22:32:40 +0000 Subject: [issue40608] PY3.8 GC segfault (Py_TRASHCAN_SAFE_BEGIN/END are not backwards compatible) In-Reply-To: <1589306849.27.0.146369076662.issue40608@roundup.psfhosted.org> Message-ID: <1619389960.66.0.879837907988.issue40608@roundup.psfhosted.org> Irit Katriel added the comment: There has been no progress on PR12607. I think we should at least deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10 and tell people to use Py_TRASHCAN_BEGIN/END instead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 18:57:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 25 Apr 2021 22:57:38 +0000 Subject: [issue11100] test_fdopen: close failed in file object destructor In-Reply-To: <1296664919.37.0.123111264864.issue11100@psf.upfronthosting.co.za> Message-ID: <1619391458.6.0.786282031082.issue11100@roundup.psfhosted.org> Irit Katriel added the comment: Closing since python 2.7 is no longer maintained. Please create a new issue if this is still an issue in 3.8+ ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 21:54:29 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Mon, 26 Apr 2021 01:54:29 +0000 Subject: [issue43534] turtle.textinput window is not transient In-Reply-To: <1616029936.62.0.714792032874.issue43534@roundup.psfhosted.org> Message-ID: <1619402069.2.0.615036196272.issue43534@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset 9ca20fdc4c27e31832adbd6d393a87e7d8953e3c by Miss Islington (bot) in branch '3.8': bpo-43534: Fix the turtle module working with multiple root windows GH-25594 https://github.com/python/cpython/commit/9ca20fdc4c27e31832adbd6d393a87e7d8953e3c ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 21:54:45 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Mon, 26 Apr 2021 01:54:45 +0000 Subject: [issue43534] turtle.textinput window is not transient In-Reply-To: <1616029936.62.0.714792032874.issue43534@roundup.psfhosted.org> Message-ID: <1619402085.21.0.0642067651961.issue43534@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset b47f05157bd05c5825c26389af5be3064a2c1313 by Miss Islington (bot) in branch '3.9': bpo-43534: Fix the turtle module working with multiple root windows GH-25593 https://github.com/python/cpython/commit/b47f05157bd05c5825c26389af5be3064a2c1313 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 22:09:05 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 26 Apr 2021 02:09:05 +0000 Subject: [issue43939] Deadlock in logging In-Reply-To: <1619369926.8.0.917759570645.issue43939@roundup.psfhosted.org> Message-ID: <1619402945.48.0.0757232271933.issue43939@roundup.psfhosted.org> Raymond Hettinger added the comment: A few thoughts: * We normally say "all bets are off" when it comes to manipulating Python internals with ctypes. This issue is just one of many ways to wreak havoc. * The programming pattern of killing running threads at arbitrary points in their execution is inherently fragile. I don't think other modules are obliged to try to support it. * The pattern of "acquire(); try: something(); finally release();" is common. Logging is only of many modules in the ecosystem that use this pattern. * ISTM we can't assume that the lock is a context manager because createLock() is a public method and users can do anything with it. * That said, we could add our own __enter__ and __exit__ methods to the Handler class. * Lastly, I have a vague memory that at one point there was a rejected proposal to switch logging to use the with-statement throughout. We should research that to see if the reasoning is still applicable or not. ---------- nosy: +pitrou, rhettinger versions: -Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 22:11:50 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 26 Apr 2021 02:11:50 +0000 Subject: [issue43936] os.path.realpath() normalizes paths before resolving links on Windows In-Reply-To: <1619299325.99.0.263866939052.issue43936@roundup.psfhosted.org> Message-ID: <1619403110.48.0.339685349175.issue43936@roundup.psfhosted.org> Eryk Sun added the comment: > os.path.realpath() normalizes paths before resolving links > on Windows Normalizing the input path is required in order to be consistent with the Windows file API. OTOH, the target path of a relative symlink gets resolved in a POSIX-ly correct manner in the kernel, and ntpath._readlink_deep() doesn't ensure this. I've attached a prototype that I wrote for a POSIX-like implementation that recursively resolves both the drive and the path. It uses the final path only as a shortcut to normalize volume GUID names as drives and the proper casing of UNC server and share names. However, it's considerably more work than the final-path approach, and more work always has the potential for more bugs. I'm providing it for the sake of discussion, or just for people to point to it as an example of what not to do... ;-) Patching up the current implementation would probably involve extending _getfinalpathname() to support follow_symlinks=False. Aspects of the POSIX implementation would have to be adopted, but I think it can be kept relatively simple when integrated with _getfinalpathname(path, follow_symlinks=False). The latter also makes it easy to identify a UNC path, which is necessary because mountpoints should never be resolved in a UNC path, which is something the current implementation gets wrong. What this wouldn't support is resolving an inaccessible drive as much as possible. Mapped drives are object symlinks that expand to UNC paths that can include an arbitrary filepath on a share. Substitute drives by definition target an arbitrary filepath, and can even target other substitute and mapped drives. A final-path only approach would leave the inaccessible drive in the result, along with any symlinks that are internal to the drive. A final-path approach also can't support targets with rooted paths or ".." components that traverse a mountpoint. The final path will be on the mountpoint's device, which will change how such relative symlinks resolve. That said, rooted symlink targets are almost never seen in Windows, and targets that traverse a mountpoint by way of a ".." component should be rare, in principle. One problem is the frequent use of bind mountpoints in place of symlinks in Windows. In CMD, bind mountpoints can be created by anyone via `mklink /j`. Here's a fabricated example with a mountpoint (i.e. junction) that's used where normally a symlink should be used. C:\ work\ foo\ bar [junction -> C:\work\bar] remote [symlink -> \\baz\spam] bar\ remote [symlink -> ..\remote] remote [symlink -> \\qux\eggs] C:\work\foo\bar\remote normally resolves as follows: C:\work\foo\bar\remote -> C:\work\foo\bar + ..\remote -> C:\work\foo\remote -> \\baz\spam Assume that \\baz\spam is down, so C:\work\foo\bar\remote can't be strictly resolved. If the non-strict algorithm relies on getting the final path of C:\work\foo\bar\remote before resolving the target of "remote", then the result for this case will be incorrect. C:\work\foo\bar\remote -> C:\work\bar\remote -> C:\work\bar + ..\remote -> C:\work\remote -> \\qux\eggs ---------- components: +Windows nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware versions: -Python 3.6, Python 3.7 Added file: https://bugs.python.org/file49984/realpath_posixly.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 22:52:44 2021 From: report at bugs.python.org (Huang Yang) Date: Mon, 26 Apr 2021 02:52:44 +0000 Subject: [issue43940] int casting to float results to a different value in memory Message-ID: <1619405564.97.0.595981007242.issue43940@roundup.psfhosted.org> New submission from Huang Yang : from ctypes import * import struct i = int('7f94e57c', 16) cp = pointer(c_int(i)) fp = cast(cp, POINTER(c_float)) print(fp.contents.value) # nan print(struct.pack(">f", fp.contents.value).hex()) # 7fd4e57c # value changed: 7f94e57c -> 7fd4e57c ---------- components: Library (Lib), ctypes messages: 391876 nosy: yang8621 priority: normal severity: normal status: open title: int casting to float results to a different value in memory type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 25 23:00:01 2021 From: report at bugs.python.org (Huang Yang) Date: Mon, 26 Apr 2021 03:00:01 +0000 Subject: [issue43940] int casting to float results to a different value in memory In-Reply-To: <1619405564.97.0.595981007242.issue43940@roundup.psfhosted.org> Message-ID: <1619406001.18.0.552052273738.issue43940@roundup.psfhosted.org> Huang Yang added the comment: It's reproducible only if the float is nan, with prefix 7f or ff. Seems the value is OR operated by 0x00400000. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 00:22:28 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Mon, 26 Apr 2021 04:22:28 +0000 Subject: [issue23975] numbers.Rational implements __float__ incorrectly In-Reply-To: <1429214817.83.0.816258978912.issue23975@psf.upfronthosting.co.za> Message-ID: <1619410948.96.0.934481202805.issue23975@roundup.psfhosted.org> Change by Sergey B Kirpichev : ---------- pull_requests: +24321 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25619 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 00:50:23 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 26 Apr 2021 04:50:23 +0000 Subject: [issue43940] int casting to float results to a different value in memory In-Reply-To: <1619405564.97.0.595981007242.issue43940@roundup.psfhosted.org> Message-ID: <1619412623.53.0.920444944687.issue43940@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +mark.dickinson, rhettinger, tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 01:02:16 2021 From: report at bugs.python.org (Larry Hastings) Date: Mon, 26 Apr 2021 05:02:16 +0000 Subject: [issue43941] Unit test failure in test_gdb only with -O0 Message-ID: <1619413336.26.0.680975027921.issue43941@roundup.psfhosted.org> New submission from Larry Hastings : Recent Python source trees fail a regression test in test_gdb. Oddly, the behavior only appears up when optimization is turned off. To reproduce: % git clone cpython buildtrunk % cd buildtrunk % ./configure % vi Makefile # change "-O3" to "-O0" !! % make -j % ./python -m test -v test_gdb You'll be rewarded with one failure: ====================================================================== FAIL: test_wrapper_call (test.test_gdb.PyBtTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/larry/src/python/buildtrunk/Lib/test/test_gdb.py", line 947, in test_wrapper_call self.assertRegex(gdb_output, AssertionError: Regex didn't match: ", v=) at Python/bltinmodule.c:1207\n1207\t{\nBreakpoint 2: file Objects/descrobject.c, line 1386.\n\nBreakpoint 2, wrapper_call (wp=, args=, kwds=) at Objects/descrobject.c:1386\n1386\t{\nTraceback (most recent call first):\n \n File "", line 4, in __init__\n File "", line 7, in \n' ---------------------------------------------------------------------- I just reproduced this with version 3c4850e222388889426e250ff43308e4802dc582 . Note that if you don't change the Makefile, and leave the optimization level at "-O3", you won't see this test failure. Pablo, I nosied you just to get it on your radar. Good luck with getting Python 3.10 over the finish line! ---------- components: Library (Lib) keywords: 3.10regression messages: 391878 nosy: larry, pablogsal priority: normal severity: normal stage: needs patch status: open title: Unit test failure in test_gdb only with -O0 type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 01:14:27 2021 From: report at bugs.python.org (Huang Yang) Date: Mon, 26 Apr 2021 05:14:27 +0000 Subject: [issue43940] int casting to float results to a different value in memory In-Reply-To: <1619405564.97.0.595981007242.issue43940@roundup.psfhosted.org> Message-ID: <1619414067.92.0.556088207525.issue43940@roundup.psfhosted.org> Huang Yang added the comment: Also reproducible by: from ctypes import * i = int('7f94e57c', 16) cp = pointer(c_int(i)) fp = cast(cp, POINTER(c_float)) print(fp.contents.value) # nan p = pointer(c_float(fp.contents.value)) ip = cast(p, POINTER(c_int)) print(hex(ip.contents.value)) #'0x7fd4e57c' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 01:54:20 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 26 Apr 2021 05:54:20 +0000 Subject: [issue43940] int casting to float results to a different value in memory In-Reply-To: <1619405564.97.0.595981007242.issue43940@roundup.psfhosted.org> Message-ID: <1619416460.82.0.784089993359.issue43940@roundup.psfhosted.org> Steven D'Aprano added the comment: I believe that this may be the same issue as this thread https://mail.python.org/archives/list/python-dev at python.org/thread/35NECLGFIVAHWTIPAYDBJOJJX3FSY233/ in particular this comment: https://mail.python.org/archives/list/python-dev at python.org/message/QIC4DLFYEI3IVGUFK5KRTIELTKFI76B6/ ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 01:55:57 2021 From: report at bugs.python.org (Larry Hastings) Date: Mon, 26 Apr 2021 05:55:57 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619416557.99.0.310818473732.issue43901@roundup.psfhosted.org> Change by Larry Hastings : ---------- keywords: +patch pull_requests: +24322 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25623 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 02:38:19 2021 From: report at bugs.python.org (ANDRZEJ J.) Date: Mon, 26 Apr 2021 06:38:19 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619419099.74.0.619174694353.issue43901@roundup.psfhosted.org> Change by ANDRZEJ J. : ---------- components: +FreeBSD -Interpreter Core nosy: +kokxxxxik, koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 03:03:33 2021 From: report at bugs.python.org (Ruben Vorderman) Date: Mon, 26 Apr 2021 07:03:33 +0000 Subject: [issue43612] zlib.compress should have a wbits argument In-Reply-To: <1616565860.52.0.251244097489.issue43612@roundup.psfhosted.org> Message-ID: <1619420613.62.0.148290941486.issue43612@roundup.psfhosted.org> Ruben Vorderman added the comment: A patch was created, but has not been reviewed yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 03:04:07 2021 From: report at bugs.python.org (Ruben Vorderman) Date: Mon, 26 Apr 2021 07:04:07 +0000 Subject: [issue43612] zlib.compress should have a wbits argument In-Reply-To: <1616565860.52.0.251244097489.issue43612@roundup.psfhosted.org> Message-ID: <1619420647.97.0.53505891697.issue43612@roundup.psfhosted.org> Change by Ruben Vorderman : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 03:08:37 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Mon, 26 Apr 2021 07:08:37 +0000 Subject: [issue26092] doctest should allow custom sys.displayhook In-Reply-To: <1452622857.37.0.137754453324.issue26092@psf.upfronthosting.co.za> Message-ID: <1619420917.74.0.675029688771.issue26092@roundup.psfhosted.org> Sergey B Kirpichev added the comment: Tim, lets decide on this simple issue. To me, https://bugs.python.org/issue8048 was obviously a bad thing. While it "fixes" one application, which customize sys.displayhook in a strange way - it break testing almost everyone, which do sys.displayhook customization. See e.g. https://github.com/sympy/sympy/blob/master/conftest.py or https://github.com/diofant/diofant/blob/master/conftest.py. BTW, SymPy is far more popular library than dreampie, which is py2-only and looks unmaintained. Last, but not least - introduced doctest's behaviour wasn't documented. It break things in a surprising way and do this silently... There is a documentation issue if you decide to keep this "feature". Noam, what do you think about fixing your problem with mock.patch? >>> import sys >>> from unittest.mock import patch >>> with patch('sys.displayhook', sys.__displayhook__): ... doctest.testmod() Tentative patch attached. ---------- keywords: +patch Added file: https://bugs.python.org/file49985/doctest-displayhook.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 03:10:37 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Mon, 26 Apr 2021 07:10:37 +0000 Subject: [issue12403] Mention sys.displayhook in code module docs and the compile builtin docs In-Reply-To: <1308959744.93.0.261089879651.issue12403@psf.upfronthosting.co.za> Message-ID: <1619421037.32.0.338932672733.issue12403@roundup.psfhosted.org> Change by Sergey B Kirpichev : ---------- nosy: +Sergey.Kirpichev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 03:40:59 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 26 Apr 2021 07:40:59 +0000 Subject: [issue43940] int casting to float results to a different value in memory In-Reply-To: <1619405564.97.0.595981007242.issue43940@roundup.psfhosted.org> Message-ID: <1619422859.56.0.313628438195.issue43940@roundup.psfhosted.org> Mark Dickinson added the comment: There's an implicit float-to-double conversion here (`fp.contents.value` is represented as a Python float, which is backed by a C double). What you're seeing is that converting the single-precision signaling NaN to double precision loses the signaling bit, producing a quiet double-precision NaN with the same sign and payload (modulo the signaling bit). That's what I'd expect under IEEE 754 semantics. (IEEE 754-2008 says, in section 6.2, "Under default exception handling, any operation signaling an invalid operation exception and for which a floating-point result is to be delivered shall deliver a quiet NaN.".) I don't think there's anything we can or should do about this at Python level. ctypes is correctly reflecting the existing C-level behaviour. In other words, this is expected behaviour, not a bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 03:58:18 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 26 Apr 2021 07:58:18 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1619423898.76.0.622896479438.issue38820@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24323 pull_request: https://github.com/python/cpython/pull/25624 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 04:01:47 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 26 Apr 2021 08:01:47 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619424107.72.0.124108100981.issue43908@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 04:15:19 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 26 Apr 2021 08:15:19 +0000 Subject: [issue43940] int casting to float results to a different value in memory In-Reply-To: <1619405564.97.0.595981007242.issue43940@roundup.psfhosted.org> Message-ID: <1619424919.2.0.561126435224.issue43940@roundup.psfhosted.org> Change by Mark Dickinson : ---------- resolution: -> not a bug status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 04:38:26 2021 From: report at bugs.python.org (Huang Yang) Date: Mon, 26 Apr 2021 08:38:26 +0000 Subject: [issue43940] int casting to float results to a different value in memory In-Reply-To: <1619405564.97.0.595981007242.issue43940@roundup.psfhosted.org> Message-ID: <1619426306.92.0.814600326338.issue43940@roundup.psfhosted.org> Huang Yang added the comment: OK. Seems it's the default behavior of CPU instruction. And CPU follows the IEEE standard of float. Is there any workaround? ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 04:41:49 2021 From: report at bugs.python.org (Kubilay Kocak) Date: Mon, 26 Apr 2021 08:41:49 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619426509.66.0.854384148963.issue43901@roundup.psfhosted.org> Change by Kubilay Kocak : ---------- components: +Interpreter Core -FreeBSD nosy: -koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 04:47:06 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 26 Apr 2021 08:47:06 +0000 Subject: [issue43940] int casting to float results to a different value in memory In-Reply-To: <1619405564.97.0.595981007242.issue43940@roundup.psfhosted.org> Message-ID: <1619426826.1.0.719694538995.issue43940@roundup.psfhosted.org> Mark Dickinson added the comment: > Is there any workaround? Sorry, I can't answer that without knowing what it is you're trying to do - that is, I don't know which part of the behaviour you want a workaround for. But that's getting off topic for this tracker, which is for bug reporting; I'd suggest taking the discussion to one of the mailing lists, Stack Overflow, or some other resource. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 04:51:03 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 26 Apr 2021 08:51:03 +0000 Subject: [issue41139] cgi uses the locale encoding for log files In-Reply-To: <1593257405.62.0.0746372218017.issue41139@roundup.psfhosted.org> Message-ID: <1619427063.43.0.362388827517.issue41139@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +24324 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25625 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 04:53:51 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 26 Apr 2021 08:53:51 +0000 Subject: [issue43939] Deadlock in logging In-Reply-To: <1619369926.8.0.917759570645.issue43939@roundup.psfhosted.org> Message-ID: <1619427231.64.0.424267825153.issue43939@roundup.psfhosted.org> Antoine Pitrou added the comment: Feel free to submit a PR to use context managers, though I'm not sure it solves the problem in a guaranteed way. Nick, what is the official word wrt. interruptibility of context managers? ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 04:54:20 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 26 Apr 2021 08:54:20 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1619427260.62.0.747428609452.issue38820@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 3c586ca500854476e6eff06713236faff233d035 by Christian Heimes in branch 'master': bpo-38820: Old OpenSSL 3.0.0 releases are in /old/3.0/ (GH-25624) https://github.com/python/cpython/commit/3c586ca500854476e6eff06713236faff233d035 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 04:54:23 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Apr 2021 08:54:23 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1619427263.06.0.575513482198.issue38820@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24325 pull_request: https://github.com/python/cpython/pull/25626 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 04:54:29 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Apr 2021 08:54:29 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1619427269.71.0.887716821715.issue38820@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24326 pull_request: https://github.com/python/cpython/pull/25627 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 04:54:48 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 26 Apr 2021 08:54:48 +0000 Subject: [issue43939] Deadlock in logging In-Reply-To: <1619369926.8.0.917759570645.issue43939@roundup.psfhosted.org> Message-ID: <1619427288.22.0.183152786527.issue43939@roundup.psfhosted.org> Antoine Pitrou added the comment: But also, please ask the "external package" that uses PyThreadState_SetAsyncExc to clear up its documentation and mentions the pitfalls. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 05:25:22 2021 From: report at bugs.python.org (Michael Felt) Date: Mon, 26 Apr 2021 09:25:22 +0000 Subject: [issue40878] Use c99 on the aixtools bot In-Reply-To: <1597517014.17.0.358922148902.issue40878@roundup.psfhosted.org> Message-ID: <1c01fe94-0203-322a-341a-750c71661d33@felt.demon.nl> Michael Felt added the comment: Disregard the last mail -seems many routines go to unresolved. On 15/08/2020 20:43, Stefan Krah wrote: > Change by Stefan Krah : > > > ---------- > assignee: -> skrah > resolution: -> fixed > stage: patch review -> resolved > status: open -> closed > type: -> compile error > > _______________________________________ > Python tracker > > _______________________________________ > ---------- Added file: https://bugs.python.org/file49986/OpenPGP_0x722BFDB61F396FC2.asc _______________________________________ Python tracker _______________________________________ -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_0x722BFDB61F396FC2.asc Type: application/pgp-keys Size: 1761 bytes Desc: not available URL: From report at bugs.python.org Mon Apr 26 05:29:05 2021 From: report at bugs.python.org (Reuben Thomas) Date: Mon, 26 Apr 2021 09:29:05 +0000 Subject: [issue43942] RawDescriptionHelpFormatter seems to be ignored for argument descriptions Message-ID: <1619429345.55.0.132994171177.issue43942@roundup.psfhosted.org> New submission from Reuben Thomas : The documentation seems very clear on this subject: "RawTextHelpFormatter maintains whitespace for all sorts of help text, including argument descriptions. However, multiple new lines are replaced with one." But consider the following code: ``` from argparse import ArgumentParser, RawDescriptionHelpFormatter parser = ArgumentParser( description='A simple templating system.', epilog='Use `-\' as a file name to indicate standard input or output.', formatter_class=RawDescriptionHelpFormatter, ) parser.add_argument( '--verbose', help='show on standard error the path being built,\nand the names of files built, included and pasted' ) args = parser.parse_args() ``` Then try running it in a suitably-sized terminal: $ python3 test.py --help usage: test.py [-h] [--verbose VERBOSE] A simple templating system. optional arguments: -h, --help show this help message and exit --verbose VERBOSE show on standard error the path being built, and the names of files built, included and pasted Use `-' as a file name to indicate standard input or output. ``` The \n in the help for the `--verbose` argument is not respected. ---------- components: Library (Lib) messages: 391890 nosy: rrt priority: normal severity: normal status: open title: RawDescriptionHelpFormatter seems to be ignored for argument descriptions versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 05:29:51 2021 From: report at bugs.python.org (Reuben Thomas) Date: Mon, 26 Apr 2021 09:29:51 +0000 Subject: [issue43942] RawDescriptionHelpFormatter seems to be ignored for argument descriptions In-Reply-To: <1619429345.55.0.132994171177.issue43942@roundup.psfhosted.org> Message-ID: <1619429391.81.0.00636639937485.issue43942@roundup.psfhosted.org> Reuben Thomas added the comment: (Tested with Python 3.9.4.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 05:35:39 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Apr 2021 09:35:39 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1619429739.89.0.499864968323.issue38820@roundup.psfhosted.org> miss-islington added the comment: New changeset 10ee2662dfeeb3b00d232f8f1c2eecc4d7e65244 by Miss Islington (bot) in branch '3.8': [3.8] bpo-38820: Old OpenSSL 3.0.0 releases are in /old/3.0/ (GH-25624) (GH-25627) https://github.com/python/cpython/commit/10ee2662dfeeb3b00d232f8f1c2eecc4d7e65244 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 06:16:29 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 26 Apr 2021 10:16:29 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619432189.9.0.641473510775.issue43933@roundup.psfhosted.org> Mark Shannon added the comment: What exactly is the issue here? That the line number is -1, or that is different from 3.9? The `-1` should be `None`. I can fix that, but there is the issue of whether the cleanup code in a with statement should have a line number or not. The traceback for 3.9 is incorrect, the program is not on line 10 when __exit__ is called. Currently we mark the cleanup code for the with statement as artificial meaning that it has no line number. We could give it the line number of the `with` keyword, but that might break coverage and profiling tools. PEP 626 says that the "with" keyword is executable, and should be traced, but nothing about whether that includes the cleanup call to __exit__. ---------- nosy: +nedbat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 06:22:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Apr 2021 10:22:01 +0000 Subject: [issue26215] Make GC_Head a compile-time option In-Reply-To: <1453892927.49.0.620193472963.issue26215@psf.upfronthosting.co.za> Message-ID: <1619432521.4.0.518546795134.issue26215@roundup.psfhosted.org> Change by Irit Katriel : ---------- type: -> enhancement versions: +Python 3.11 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 06:22:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Apr 2021 10:22:50 +0000 Subject: [issue26215] Make GC_Head a compile-time option In-Reply-To: <1453892927.49.0.620193472963.issue26215@psf.upfronthosting.co.za> Message-ID: <1619432570.71.0.0133587091815.issue26215@roundup.psfhosted.org> Irit Katriel added the comment: This seems like something that would require a PEP, or at least a discussion on python-ideas. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 06:24:34 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 10:24:34 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619432674.94.0.309808498391.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > Let's post the list here and post a brief mention of this issue on python-dev. Attached. The list contains commits, commit dates, affected files, and the name of the PyType_Spec variables (I _can_ resolve these to the actual type names, but I figured this would be ok for now). I've also posted the list on Discsourse bco. readability. I'll post a notification on python-dev as well. https://discuss.python.org/t/list-of-built-in-types-converted-to-heap-types/8403 ---------- Added file: https://bugs.python.org/file49987/list.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 06:28:35 2021 From: report at bugs.python.org (Noam Yorav-Raphael) Date: Mon, 26 Apr 2021 10:28:35 +0000 Subject: [issue26092] doctest should allow custom sys.displayhook In-Reply-To: <1619420917.74.0.675029688771.issue26092@roundup.psfhosted.org> Message-ID: Noam Yorav-Raphael added the comment: Hi, I think that using mock.patch to fix the problem is fine. I personally haven't encountered this problem in the past years, so whatever you decide is fine by me. Thanks! Noam On Mon, Apr 26, 2021 at 10:08 AM Sergey B Kirpichev wrote: > > Sergey B Kirpichev added the comment: > > Tim, lets decide on this simple issue. > > To me, https://bugs.python.org/issue8048 was obviously a bad thing. > While it "fixes" one application, which customize sys.displayhook in a > strange way - it break testing almost everyone, which do sys.displayhook > customization. See e.g. > https://github.com/sympy/sympy/blob/master/conftest.py or > https://github.com/diofant/diofant/blob/master/conftest.py. BTW, SymPy > is far more popular library than dreampie, which is py2-only and looks > unmaintained. > > Last, but not least - introduced doctest's behaviour wasn't documented. > It break things in a surprising way and do this silently... There is a > documentation issue if you decide to keep this "feature". > > Noam, what do you think about fixing your problem with mock.patch? > > >>> import sys > >>> from unittest.mock import patch > >>> with patch('sys.displayhook', sys.__displayhook__): > ... doctest.testmod() > > Tentative patch attached. > > ---------- > keywords: +patch > Added file: https://bugs.python.org/file49985/doctest-displayhook.diff > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 06:42:20 2021 From: report at bugs.python.org (Ned Batchelder) Date: Mon, 26 Apr 2021 10:42:20 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619433740.44.0.0518709914334.issue43933@roundup.psfhosted.org> Ned Batchelder added the comment: Mark, you say: > The traceback for 3.9 is incorrect, the program is not on line 10 when __exit__ is called. It's kind of not on any line in main(), but line 10 is the most useful line to indicate. It's the last bit of the user's code that was running, and it is the reason for leaving the with statement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 06:48:59 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Mon, 26 Apr 2021 10:48:59 +0000 Subject: [issue26092] doctest should allow custom sys.displayhook In-Reply-To: <1452622857.37.0.137754453324.issue26092@psf.upfronthosting.co.za> Message-ID: <1619434139.96.0.743805891937.issue26092@roundup.psfhosted.org> Sergey B Kirpichev added the comment: > I personally haven't encountered this problem in the past years Noam, that's because Python has your patch :-) But if we revert one - mentioned solution with mock.patch will work. Please, tell us if you find it bad for any reason. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 06:57:09 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Apr 2021 10:57:09 +0000 Subject: [issue28968] xml rpc server fails with connection reset by peer error no 104 In-Reply-To: <1481709223.17.0.559234955094.issue28968@psf.upfronthosting.co.za> Message-ID: <1619434629.99.0.887761048175.issue28968@roundup.psfhosted.org> Irit Katriel added the comment: 2.7 is no longer maintained. Please create a new issue with full reproduction information if you are still having this problem in 3.8+. ---------- nosy: +iritkatriel stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 06:59:39 2021 From: report at bugs.python.org (Noam Yorav-Raphael) Date: Mon, 26 Apr 2021 10:59:39 +0000 Subject: [issue26092] doctest should allow custom sys.displayhook In-Reply-To: <1452622857.37.0.137754453324.issue26092@psf.upfronthosting.co.za> Message-ID: <1619434779.46.0.178361573314.issue26092@roundup.psfhosted.org> Noam Yorav-Raphael added the comment: Yes, sorry, I didn't remember the history exactly. I don't have a strong opinion. I'm okay with reverting the behavior to use sys.displayhook. Thanks, Noam ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 07:12:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 26 Apr 2021 11:12:57 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619435577.07.0.794147405564.issue43908@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I also opened https://bugs.python.org/issue43916 to track some points raised by Serhiy ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 07:31:25 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 11:31:25 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619436685.18.0.614012067863.issue43916@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 07:34:11 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Apr 2021 11:34:11 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619436851.85.0.527312870918.issue43908@roundup.psfhosted.org> Serhiy Storchaka added the comment: In Python 3.8 there were only few extension heap types: _curses_panel.panel, ssl.SSLError, _tkinter.tkapp, _tkinter.Tcl_Obj, _tkinter.tktimertoken and PyStructSequence types. The following heap types were added in Python 3.9: posix.DirEntry, posix.ScandirIterator, select.devpoll, select.kevent, select.poll, select.epoll, select.kqueue, _struct.unpack_iterator, _struct.Struct, _abc._abc_data, _random.Random, _json.Scanner, _json.Encoder, zlib.Compress, zlib.Decompress, _hashlib.HASH, _hashlib.HASHXOF, _hashlib.HMAC, ast.AST. The list of heap types added in Python 3.10 is too long (more than 60 types). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 07:35:07 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Apr 2021 11:35:07 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619436907.32.0.905194730869.issue43908@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- Removed message: https://bugs.python.org/msg391902 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 07:48:11 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Apr 2021 11:48:11 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619437691.14.0.213009191659.issue43916@roundup.psfhosted.org> Serhiy Storchaka added the comment: >From Objects/typeobject.c: /* The condition below could use some explanation. It appears that tp_new is not inherited for static types whose base class is 'object'; this seems to be a precaution so that old extension types don't suddenly become callable (object.__new__ wouldn't insure the invariants that the extension type's own factory function ensures). Heap types, of course, are under our control, so they do inherit tp_new; static extension types that specify some other built-in type as the default also inherit object.__new__. */ if (base != &PyBaseObject_Type || (type->tp_flags & Py_TPFLAGS_HEAPTYPE)) { if (type->tp_new == NULL) type->tp_new = base->tp_new; } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 07:54:22 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 26 Apr 2021 11:54:22 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619438062.79.0.326945591788.issue43916@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 07:54:31 2021 From: report at bugs.python.org (Ma Lin) Date: Mon, 26 Apr 2021 11:54:31 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1619438071.89.0.571938783785.issue41486@roundup.psfhosted.org> Ma Lin added the comment: Very sorry for update at the last moment. But after the update, we should no need to touch it in the future, so I think it's worthy. Please review the last commit in PR 21740, the previous commits have not been changed. IMO if use a Git client such as TortoiseGit, reviewing may be more convenient. The changes: 1, Move `Modules/blocks_output_buffer.h` to `Include/internal/pycore_blocks_output_buffer.h` Keep the `Modules` folder clean. 2, Ask the user to initialize the struct instance like this, and use assertions to check it: _BlocksOutputBuffer buffer = {.list = NULL}; Then no longer worry about whether buffer.list is uninitialized in error handling. There is an extra assignment, but it's beneficial to long-term code maintenance. 3, Change the type of BUFFER_BLOCK_SIZE from `int` to `Py_ssize_t`. The core code can remove a few type casts. 4, These functions return allocated size on success, return -1 on failure: _BlocksOutputBuffer_Init() _BlocksOutputBuffer_InitAndGrow() _BlocksOutputBuffer_InitWithSize() _BlocksOutputBuffer_Grow() If the code is used in other sites, this API is simpler. 5, All functions are decorated with `inline`. If the compiler is smart enough, it's possible to eliminate some code when `max_length` is constant and < 0. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 08:09:20 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Apr 2021 12:09:20 +0000 Subject: [issue20290] inspect module bug for modules with same filename In-Reply-To: <1389992896.56.0.367733971337.issue20290@psf.upfronthosting.co.za> Message-ID: <1619438960.5.0.876146739925.issue20290@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> inspect.findsource raises IndexError _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 08:10:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Apr 2021 12:10:44 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619439044.15.0.817595969891.issue43916@roundup.psfhosted.org> Serhiy Storchaka added the comment: The explaining comment was added in f884b749103bad0724e2e4878cd5fe49a41bd7df. The code itself is much older. It was originally added in 6d6c1a35e08b95a83dbe47dbd9e6474daff00354, then weaked in c11e192d416e2970e6a06cf06d4cf788f322c6ea and strengthen in 29687cd2112c540a8a4d31cf3b191cf10db08412. All types except static types which are direct descendants of object inherit tp_new from a base class. We need to check which static types had tp_new = NULL before they were converted to heap types and set it to NULL manually after type creation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 08:16:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Apr 2021 12:16:46 +0000 Subject: [issue21251] Standard library trace module crashes with exception In-Reply-To: <1397652137.22.0.406999160837.issue21251@psf.upfronthosting.co.za> Message-ID: <1619439406.27.0.443471726837.issue21251@roundup.psfhosted.org> Irit Katriel added the comment: pyblock supports python 3 now. Are you seeing the problem pm 3.8+?Otherwise this issue can be closed since python 2 past EOL. ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 08:25:49 2021 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Mon, 26 Apr 2021 12:25:49 +0000 Subject: [issue35930] Raising an exception raised in a "future" instance will create reference cycles In-Reply-To: <1549549530.21.0.398741964575.issue35930@roundup.psfhosted.org> Message-ID: <1619439949.43.0.393615366005.issue35930@roundup.psfhosted.org> Jes?s Cea Avi?n added the comment: I retired the backporting request. Thanks, Ned. ---------- versions: -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 08:31:03 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 26 Apr 2021 12:31:03 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619440263.73.0.986991972188.issue43933@roundup.psfhosted.org> Mark Shannon added the comment: In this case, if happens that line 10 was the last line of code executing in the body of the with statement. But the reason it was listed, was that it was statically the last line of code in the body. If the body is something like: 1. if TRUE: 2. ... 3. else: 4. ... Then the reported last line will be 4, even though it is never executed. We can fix this, at the cost of extra compiler complexity and increased bytecode size for the non-exceptional case, but it is very difficult for the exceptional case, because we don't know statically where the exception has come from. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 08:33:26 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 12:33:26 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619440406.09.0.708403155697.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > We need to check which static types had tp_new = NULL before they were converted to heap types I did a quick git grep. Results pasted into the list over at https://discuss.python.org/t/list-of-built-in-types-converted-to-heap-types/8403. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 08:45:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Apr 2021 12:45:25 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619441125.75.0.855110900503.issue43916@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is incomplete. For example arrayiterator did have tp_new = NULL (in other words, PyArrayIter_Type.tp_new was not set to non-NULL value). In 3.9: >>> import array >>> type(iter(array.array('I')))() Traceback (most recent call last): File "", line 1, in TypeError: cannot create 'arrayiterator' instances In 3.10: >>> import array >>> type(iter(array.array('I')))() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 08:48:39 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 12:48:39 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619441319.59.0.549395579079.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > It is incomplete. Yes, I know. I'm working on completing it manually. Some of the static structs were only partially initialised (most stop at tp_members). The rest of the struct (including tp_new) would then be initialised to zero. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 08:50:39 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Apr 2021 12:50:39 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619441439.46.0.792970542524.issue43916@roundup.psfhosted.org> Serhiy Storchaka added the comment: Thank you for your work Erlend. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 08:51:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 26 Apr 2021 12:51:13 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619441473.25.0.860880531195.issue43916@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Serhiy, do you think this should be a release blocker for the beta? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 08:55:50 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 26 Apr 2021 12:55:50 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619441750.51.0.588738755485.issue43933@roundup.psfhosted.org> Mark Shannon added the comment: This test case was added for 3.10. In 3.9 it reports that the pass statement executes, even though it is unreachable. https://github.com/python/cpython/blob/master/Lib/test/test_sys_settrace.py#L919 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:01:44 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 26 Apr 2021 13:01:44 +0000 Subject: [issue18233] SSLSocket.getpeercertchain() In-Reply-To: <1371415195.44.0.636993698614.issue18233@psf.upfronthosting.co.za> Message-ID: <1619442104.05.0.313790325248.issue18233@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 666991fc598bc312d72aff0078ecb553f0a968f1 by Christian Heimes in branch 'master': bpo-18233: Add internal methods to access peer chain (GH-25467) https://github.com/python/cpython/commit/666991fc598bc312d72aff0078ecb553f0a968f1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:06:14 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 13:06:14 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619442374.69.0.212644806164.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > Thank you for your work Erlend. Anytime! I've updated the list now. There may still be errors, but I think it's pretty accurate now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:06:53 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 26 Apr 2021 13:06:53 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619442413.32.0.988607526896.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: > No, multiple tests fail. First test_distutils fails, then during the re-run, test_multiprocessing_forkserver, test_multiprocessing_spawn, and test_pdb fail. Can you provide the error output log you're getting? I'm getting a lot of errors for a lot of tests by applying your patch. But the test_pdb error looks related. If test_pdb fails then all the tests after that also fail. I'm not sure if they are related at all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:08:40 2021 From: report at bugs.python.org (Larry Hastings) Date: Mon, 26 Apr 2021 13:08:40 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619442520.56.0.380966980112.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: I keep thinking about it, and I think letting inspect.get_annotations() and inspect.signature() raise exceptions is the right API choice. I note that that's what typing.get_type_hints() did in Python 3.9. During the development of Python 3.10, this was changed; typing.get_type_hints() started catching Exception and returning the original annotation dictionary (with un-eval'd strings). This change has been reverted, and as of the current moment typing.get_type_hints() no longer catches exceptions on eval(). I think there are two types of people who will have string annotations that throw an exception when eval'd: 1) People who made a typo or other mistake. 2) People who deliberately use undefined identifiers in their annotations, due to circular import / circular dependencies in their code bases. The people who are saying "just catch the exception and let it pass silently" seem to be in group 2. I suggest that people in group 2 are sophisticated enough to start passing in eval_str=False to inspect.signature(). And I think people in group 1 would want to be alerted to their mistake, rather than have the library silently catch the error and mysteriously change its behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:09:38 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 26 Apr 2021 13:09:38 +0000 Subject: [issue43532] Add keyword-only fields to dataclasses In-Reply-To: <1616002761.92.0.652624260802.issue43532@roundup.psfhosted.org> Message-ID: <1619442578.36.0.30503831695.issue43532@roundup.psfhosted.org> Eric V. Smith added the comment: I've checked in the code, tests, and some basic documentation. I didn't finish the documentation in order to make sure I could get this in before beta 1. I'm going to leave this issue open until I have time for the rest of the documentation. ---------- resolution: -> fixed stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:13:58 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 26 Apr 2021 13:13:58 +0000 Subject: [issue43466] ssl/hashlib: Add configure option to set or auto-detect rpath to OpenSSL libs In-Reply-To: <1615418043.46.0.229114131093.issue43466@roundup.psfhosted.org> Message-ID: <1619442838.9.0.245233962518.issue43466@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 5f87915d4af724f375b00dde2b948468d3e4ca97 by Christian Heimes in branch 'master': bpo-43466: Link with libz in PY_UNSUPPORTED_OPENSSL_BUILD path (GH-25587) https://github.com/python/cpython/commit/5f87915d4af724f375b00dde2b948468d3e4ca97 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:18:08 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 13:18:08 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619443088.03.0.753542988344.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > Can you provide the error output log you're getting? I don't think we should use more time on apply-to-all.diff, since it's probably not going to be applied as it is anyway. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:22:22 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 26 Apr 2021 13:22:22 +0000 Subject: [issue43943] test_ssl fails in the macos CI In-Reply-To: <1619441607.06.0.479500365034.issue43943@roundup.psfhosted.org> Message-ID: <1619443342.86.0.908122862393.issue43943@roundup.psfhosted.org> Christian Heimes added the comment: I have seen the test fail before. It seems to be flaky on macOS but it fails only very rarely. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:24:42 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 13:24:42 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619443482.81.0.530829062428.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Here's a plaintext version: - 0b858cdd5d2021-01-04 Modules/cjkcodecs/multibytecodec.c - _multibytecodec.MultibyteCodec - c8a87addb1 2021-01-04 Modules/pyexpat.c - pyexpat.xmlparser - 75bf107c62 2021-01-02 Modules/arraymodule.c - array.arrayiterator - dd39123970 2020-12-29 Modules/_functoolsmodule.c - functools.KeyWrapper - functools._lru_list_elem - 6104013838 2020-12-18 Modules/_threadmodule.c - _thread.lock - _thread._localdummy - a6109ef68d 2020-11-20 Modules/_sre.c - re.Pattern - re.Match - _sre.SRE_Scanner - c8c4200b65 2020-10-26 Modules/unicodedata.c - unicodedata.UCD - 256e54acdb 2020-10-01 Modules/_sqlite - sqlite3.Connection - sqlite3.Cursor - 9031bd4fa4 2020-10-01 Modules/_sqlite - sqlite3.Row - sqlite3.Statement - cb6db8b6ae 2020-09-27 Modules/_sqlite - sqlite3.Node - sqlite3.Cache - 52a2df135c 2020-09-08 Modules/sha256module.c - _sha256.sha224 - _sha256.sha256 - 2aabc3200b 2020-09-06 Modules/md5module.c Modules/sha1module.c Modules/sha512module.c - _md5.md5 - _sha1.sha1 - _sha512.sha384 - _sha512.sha512 - e087f7cd43 2020-08-13 Modules/_winapi.c - winapi__overlapped.Overlapped - c4862e333a 2020-06-17 Modules/_gdbmmodule.c - g_dbm.dbm - bf69a8f99f 2020-06-16 Modules/_dbmmodule.c - _dbm.dbm - 33f15a16d4 2019-11-05 Modules/posixmodule.c - posix.DirEntry - posix.ScandirIterator - df69e75edc 2019-09-25 Modules/_hashopenssl.c - _hashlib.HASH - f919054e53 2019-09-14 Modules/selectmodule.c - select.devpoll - select.kevent - select.poll - 04f0bbfbed 2019-09-10 Modules/zlibmodule.c - zlib.Compress - zlib.Decompress - 4f384af067 2012-10-14 Modules/_tkinter.c - _tkinter.Tcl_Obj - _tkinter.tktimertoken - _tkinter.tkapp - bc07cb883e 2012-06-14 Modules/_curses_panel.c - _curses_panel.panel ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:30:13 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 13:30:13 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619443813.87.0.915896879472.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Is there any way we can fix this in Objects/typeobject.c, or do we actually have to patch every single type manually? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:36:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 26 Apr 2021 13:36:35 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619444195.95.0.590439835873.issue43916@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Is there any way we can fix this in Objects/typeobject.c, or do we actually have to patch every single type manually? That would be probably a bad idea since typeobject.c is supposed to be generic. We would be inverting the responsibility concerns to the base. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:37:41 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 26 Apr 2021 13:37:41 +0000 Subject: [issue43943] test_ssl fails in the macos CI In-Reply-To: <1619441607.06.0.479500365034.issue43943@roundup.psfhosted.org> Message-ID: <1619444261.1.0.687486911612.issue43943@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > it fails only very rarely. Unfortunately, in https://github.com/python/cpython/pull/25584 it has failed 3 times in a row. That's why I decided to open the issue. Let me re-run again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:38:40 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Apr 2021 13:38:40 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619444320.29.0.0532134817094.issue43916@roundup.psfhosted.org> Serhiy Storchaka added the comment: I afraid that changing the corresponding code in Objects/typeobject.c will break existing user code. For now, it is safer to patch every single type manually. Later we can design a general solution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:40:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 26 Apr 2021 13:40:10 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619444410.12.0.462673412226.issue43916@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I am marking this as a release blocker, giving that this is probably going to involve a big change. ---------- priority: deferred blocker -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:40:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 26 Apr 2021 13:40:49 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619444449.12.0.919960227945.issue43908@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I'm elevating this as a release blocker since this is probably going to involve a moderately big change and we don't want people relying on the new behaviour when we don't intend to. ---------- priority: deferred blocker -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:43:59 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 13:43:59 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619444639.5.0.925161575441.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Is it worth it adding tests for this? I'm thinking a generic version of msg391910 (maybe Lib/test/test_uninitialised_heap_types.py) coupled with a dataset. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:44:46 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 26 Apr 2021 13:44:46 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619444686.62.0.875740717635.issue43908@roundup.psfhosted.org> Christian Heimes added the comment: Could you please land the new flag and typeobject.c code now? I'm happy to take care of "my" code myself. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:44:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Apr 2021 13:44:36 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619444676.39.0.732195367799.issue43908@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think it is safer to merge apply-to-all.diff, and revert the changes for individual types if we have reasons to make them mutable. Correspondingly, for all converted heap types we should set tp_new = NULL unless they have special tp_new implementation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:47:31 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 26 Apr 2021 13:47:31 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619444851.95.0.165758327108.issue43916@roundup.psfhosted.org> Christian Heimes added the comment: I have had this workaround in _hashopenssl.c for a while. Can I get rid of the function with "{Py_tp_new, NULL}" or is there a more generic way to accomplish the same goal? /* {Py_tp_new, NULL} doesn't block __new__ */ static PyObject * _disabled_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyErr_Format(PyExc_TypeError, "cannot create '%.100s' instances", _PyType_Name(type)); return NULL; } ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:49:52 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 13:49:52 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619444992.22.0.0833190575553.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > Could you please land the new flag and typeobject.c code now? I've only got two more questions before I mark it ready for review, and that's regarding Guido's comment in msg391756: Should the new flag also take care of __class__ assignment, or should we leave that out? Are there other places where !Py_TPFLAGS_HEAPTYPE is used where we would like to use the immutable flag? > I'm happy to take care of "my" code myself. No problem, I'll leave it out of the patch :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:52:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Apr 2021 13:52:27 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619445147.06.0.192322000211.issue43916@roundup.psfhosted.org> Serhiy Storchaka added the comment: test_uninitialised_heap_types.py will need to import unrelited modules (some of which can be platform depending). And more modules will be added as more types be converted. I think it is better to add tests for different modules in corresponding module test files. They are pretty trivial, for example: def test_new_tcl_obj(self): self.assertRaises(TypeError, _tkinter.Tcl_Obj) @requires_curses_func('panel') def test_new_curses_panel(self): w = curses.newwin(10, 10) panel = curses.panel.new_panel(w) self.assertRaises(TypeError, type(panel)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:56:04 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 13:56:04 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619445364.81.0.776933567935.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: You're right, that would become messy. Complementing existing test suites is a better approach. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 09:58:19 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 26 Apr 2021 13:58:19 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619445499.04.0.214435320029.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: > I think it is safer to merge apply-to-all.diff, and revert the changes for individual types if we have reasons to make them mutable. I don't think it's a good idea though. About 10 or 8 tests are failing if apply-to-all.diff is applied. The tests that are not related to it are also failing because of it. After test_pdb fails a segfault error occurs and the remaining tests are never executed. If we want to merge apply-to-all.diff then we need to make some modifications first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 10:19:01 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 26 Apr 2021 14:19:01 +0000 Subject: [issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring In-Reply-To: <1618106073.56.0.0553736134144.issue43803@roundup.psfhosted.org> Message-ID: <1619446741.57.0.525858244506.issue43803@roundup.psfhosted.org> Shreyan Avigyan added the comment: Ping ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 11:04:35 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 26 Apr 2021 15:04:35 +0000 Subject: [issue42904] get_type_hints does not provide localns for classes In-Reply-To: <1610427615.24.0.000795612365541.issue42904@roundup.psfhosted.org> Message-ID: <1619449475.22.0.664662834469.issue42904@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +24327 pull_request: https://github.com/python/cpython/pull/25632 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 11:12:46 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Apr 2021 15:12:46 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1619449966.53.0.840519460162.issue38820@roundup.psfhosted.org> miss-islington added the comment: New changeset 3b917d177452dcacf41605254fc299d051fbf75a by Miss Islington (bot) in branch '3.9': [3.9] bpo-38820: Old OpenSSL 3.0.0 releases are in /old/3.0/ (GH-25624) (GH-25626) https://github.com/python/cpython/commit/3b917d177452dcacf41605254fc299d051fbf75a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 11:21:37 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 26 Apr 2021 15:21:37 +0000 Subject: [issue43762] Add audit events for loading of sqlite3 extensions In-Reply-To: <1617792679.62.0.407303342016.issue43762@roundup.psfhosted.org> Message-ID: <1619450497.97.0.461543428873.issue43762@roundup.psfhosted.org> Steve Dower added the comment: Yeah, along those lines. I believe the event is ".../result" in other places, just to be clear that it's not a function with that name. Also, don't forget to clean up when returning early from the connected event. We don't want to leak the connection object if the hook raises an error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 11:26:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Apr 2021 15:26:36 +0000 Subject: [issue22972] Timeout making ajax calls to SimpleHTTPServer from internet explorer In-Reply-To: <1417431240.84.0.697766622208.issue22972@psf.upfronthosting.co.za> Message-ID: <1619450796.43.0.801884197361.issue22972@roundup.psfhosted.org> Irit Katriel added the comment: Closing this as Python 2.7 is past EOL and there was no followup for over 6 years. If you are still having this problem in 3.9+, and you believe it is indeed a python rather than javascript issue, please create a new issue. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 11:27:53 2021 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 26 Apr 2021 15:27:53 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619450873.74.0.0693710711356.issue43892@roundup.psfhosted.org> Nick Coghlan added the comment: PR is green now, and I don't have any further changes I want to make, so Brandt, please feel free to merge if you're happy with the proposed AST nodes, and the way I've gone about implementing them. If you'd like some adjustments, it probably makes the most sense to just amend the PR directly - otherwise the 24-hour turnaround on comments due to the time zone difference will potentially give us trouble with the beta deadline. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 11:28:02 2021 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 26 Apr 2021 15:28:02 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619450882.98.0.586071797042.issue43892@roundup.psfhosted.org> Change by Nick Coghlan : ---------- stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 11:28:41 2021 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 26 Apr 2021 15:28:41 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619450921.54.0.27759694283.issue43892@roundup.psfhosted.org> Change by Nick Coghlan : ---------- assignee: ncoghlan -> brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 11:41:12 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Apr 2021 15:41:12 +0000 Subject: [issue23336] Thread.LockType is misnamed In-Reply-To: <1422424947.14.0.409463431872.issue23336@psf.upfronthosting.co.za> Message-ID: <1619451672.2.0.481650802935.issue23336@roundup.psfhosted.org> Irit Katriel added the comment: _dummy_thread and dummy_threading modules have been removed in V3.9. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 12:01:30 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 26 Apr 2021 16:01:30 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619452890.42.0.488915951389.issue43817@roundup.psfhosted.org> Guido van Rossum added the comment: I'm not a big user of the inspect module, but I always thought that its use was so that you could look at a function (or other object) *produced by a 3rd party* and learn something about it. Asking for the signature is one such operation, and I'd be rather upset if I couldn't inspect the annotation if that 3rd party happened to have added a bad string annotation. especially if I wasn't interested in the annotation part of the signature in the first place. (There's a lot of other useful info to be gleaned from it.) OTOH I think it's fine for get_annotations() to raise by default if there's a bad annotation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 12:13:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Apr 2021 16:13:27 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619453607.63.0.429075089416.issue43908@roundup.psfhosted.org> Serhiy Storchaka added the comment: These types were immutable before. If merely making them immutable again makes tests failing then perhaps there is something wrong with these tests or there are other bugs which are needed to be fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 12:29:48 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 26 Apr 2021 16:29:48 +0000 Subject: [issue42609] Eval with too high string multiplication crashes newer Python versions In-Reply-To: <1607511907.66.0.321451468972.issue42609@roundup.psfhosted.org> Message-ID: <1619454588.42.0.136852628632.issue42609@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +24328 pull_request: https://github.com/python/cpython/pull/25634 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 12:41:52 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 26 Apr 2021 16:41:52 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619455312.41.0.777763221453.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: > If merely making them immutable again makes tests failing then perhaps there is something wrong with these tests or there are other bugs which are needed to be fixed. I've noticed that the test_pdb fails because it expected the a class method to have the __repr__ "some func" but it got "bound method some func at 0x0000000". This may be the affect of this apply-to-all.diff. Other tests failing were actually fixed in other issues but somehow apply-to-all.diff is suddenly triggering them I think. The most fatal test failures is the test_pdb and test_logging because after those tests failed there were some unexpected behaviors like other tests were executed randomly, segfault and most prominent is that they started compiling by themselves! These are the two tests we should really look into right now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 12:52:32 2021 From: report at bugs.python.org (robertohueso) Date: Mon, 26 Apr 2021 16:52:32 +0000 Subject: [issue32822] finally block doesn't re-raise exception if return statement exists inside In-Reply-To: <1518387497.4.0.467229070634.issue32822@psf.upfronthosting.co.za> Message-ID: <1619455952.07.0.297010209454.issue32822@roundup.psfhosted.org> robertohueso added the comment: Just opened PR 25600, if the changes are ok then I can backport it to 3.9 and 3.8 docs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 13:00:52 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 26 Apr 2021 17:00:52 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619456452.22.0.190000903996.issue43933@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 13:01:27 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 26 Apr 2021 17:01:27 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619456487.5.0.603281275223.issue43892@roundup.psfhosted.org> Brandt Bucher added the comment: Sounds good. I'll probably be able to make time to review it today, or tomorrow at the latest. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 13:17:35 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Apr 2021 17:17:35 +0000 Subject: [issue10599] sgmllib.parse_endtag() is not respecting quoted text In-Reply-To: <1291238509.2.0.989759336682.issue10599@psf.upfronthosting.co.za> Message-ID: <1619457455.77.0.149206764207.issue10599@roundup.psfhosted.org> Irit Katriel added the comment: sgmllib was removed in python 3. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 13:19:58 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Apr 2021 17:19:58 +0000 Subject: [issue14810] tarfile does not support timestamp older 1970-01-01 In-Reply-To: <1337039308.77.0.231194182342.issue14810@psf.upfronthosting.co.za> Message-ID: <1619457598.12.0.678069983965.issue14810@roundup.psfhosted.org> Irit Katriel added the comment: Python 2 only issue. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 13:21:03 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 26 Apr 2021 17:21:03 +0000 Subject: [issue32891] Add 'Integer' as synonym for 'Integral' in numbers module. In-Reply-To: <1519191292.27.0.467229070634.issue32891@psf.upfronthosting.co.za> Message-ID: <1619457663.77.0.684732032371.issue32891@roundup.psfhosted.org> Mark Dickinson added the comment: Sorry, Sergey: I don't have the time, energy or inclination for an extended discussion here, so I'll simply record my -1 for the proposed change and move on. If you want to push this change through, the way forward would likely be to find a core developer (maybe Terry?) who's willing to champion the change (and review the PR, of course). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 13:24:45 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 26 Apr 2021 17:24:45 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619457885.13.0.956248349585.issue43908@roundup.psfhosted.org> Guido van Rossum added the comment: > > Could you please land the new flag and typeobject.c code now? > > I've only got two more questions before I mark it ready for review, > and that's regarding Guido's comment in msg391756: > Should the new flag also take care of __class__ assignment, > or should we leave that out? Let's leave that out. It's a separate can of worms and someone else can look into it later. > Are there other places where !Py_TPFLAGS_HEAPTYPE is used > where we would like to use the immutable flag? Again, I think we can do that later. So I am in favor of landing your (small) patch that introduces the flag now. I also think you should try to separately land small patches that add the IMMUTABLETYPE flag to a few very public types, e.g. array.array and the three in _sre (which are exported by re.py). We can then look into the test failures with a little less time pressure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 13:31:34 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 26 Apr 2021 17:31:34 +0000 Subject: [issue42904] get_type_hints does not provide localns for classes In-Reply-To: <1610427615.24.0.000795612365541.issue42904@roundup.psfhosted.org> Message-ID: <1619458294.59.0.961613809387.issue42904@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 1b1f9852bda85c01ef124858f293e9c13e04ffce by Ken Jin in branch 'master': bpo-42904: Change search order of typing.get_type_hints eval (#25632) https://github.com/python/cpython/commit/1b1f9852bda85c01ef124858f293e9c13e04ffce ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 08:53:27 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 26 Apr 2021 12:53:27 +0000 Subject: [issue43943] test_ssl fails in the macos CI Message-ID: <1619441607.06.0.479500365034.issue43943@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Check out this build: https://github.com/python/cpython/pull/25584/checks?check_run_id=2437718845 Here, test_ssl fails in the macos CI target: 1 test failed: test_ssl 20 tests skipped: test_devpoll test_epoll test_gdb test_idle test_ioctl test_msilib test_multiprocessing_fork test_ossaudiodev test_spwd test_startfile test_tcl test_tix test_tk test_ttk_guionly test_ttk_textonly test_turtle test_winconsoleio test_winreg test_winsound test_zipfile64 0:18:53 load avg: 3.12 0:18:53 load avg: 3.12 Re-running failed tests in verbose mode 0:18:53 load avg: 3.12 Re-running test_ssl in verbose mode test_ssl: testing with 'OpenSSL 1.1.1k 25 Mar 2021' (1, 1, 1, 11, 15) under Mac ('10.15.7', ('', '', ''), 'x86_64') HAS_SNI = True OP_ALL = 0x80000054 OP_NO_TLSv1_1 = 0x10000000 test__create_stdlib_context (test.test_ssl.ContextTests) ... ok test_cert_store_stats (test.test_ssl.ContextTests) ... ok test_check_hostname (test.test_ssl.ContextTests) ... ok test_ciphers (test.test_ssl.ContextTests) ... ok test_constructor (test.test_ssl.ContextTests) ... ok test_context_client_server (test.test_ssl.ContextTests) ... ok test_context_custom_class (test.test_ssl.ContextTests) ... ok test_create_default_context (test.test_ssl.ContextTests) ... ok test_get_ca_certs (test.test_ssl.ContextTests) ... ok test_get_ciphers (test.test_ssl.ContextTests) ... ok test_hostname_checks_common_name (test.test_ssl.ContextTests) ... ok test_load_cert_chain (test.test_ssl.ContextTests) ... ok test_load_default_certs (test.test_ssl.ContextTests) ... ok test_load_default_certs_env (test.test_ssl.ContextTests) ... ok test_load_default_certs_env_windows (test.test_ssl.ContextTests) ... skipped 'Windows specific' test_load_dh_params (test.test_ssl.ContextTests) ... ok test_load_verify_cadata (test.test_ssl.ContextTests) ... ok test_load_verify_locations (test.test_ssl.ContextTests) ... ok test_min_max_version (test.test_ssl.ContextTests) ... ok test_num_tickest (test.test_ssl.ContextTests) ... ok test_options (test.test_ssl.ContextTests) ... ok test_python_ciphers (test.test_ssl.ContextTests) ... ok test_security_level (test.test_ssl.ContextTests) ... ok test_session_stats (test.test_ssl.ContextTests) ... ok test_set_default_verify_paths (test.test_ssl.ContextTests) ... ok test_set_ecdh_curve (test.test_ssl.ContextTests) ... ok test_sni_callback (test.test_ssl.ContextTests) ... ok test_sni_callback_refcycle (test.test_ssl.ContextTests) ... ok test_verify_flags (test.test_ssl.ContextTests) ... ok test_verify_mode_protocol (test.test_ssl.ContextTests) ... ok test_DER_to_PEM (test.test_ssl.BasicSocketTests) ... ok test_asn1object (test.test_ssl.BasicSocketTests) ... ok test_cert_time_to_seconds (test.test_ssl.BasicSocketTests) ... ok test_cert_time_to_seconds_locale (test.test_ssl.BasicSocketTests) ... skipped 'locale-specific month name needs to be different from C locale' test_cert_time_to_seconds_timezone (test.test_ssl.BasicSocketTests) ... skipped 'local time needs to be different from UTC' test_connect_ex_error (test.test_ssl.BasicSocketTests) ... ok test_constants (test.test_ssl.BasicSocketTests) ... ok test_dealloc_warn (test.test_ssl.BasicSocketTests) ... ok test_empty_cert (test.test_ssl.BasicSocketTests) Wrapping with an empty cert file ... ok test_enum_certificates (test.test_ssl.BasicSocketTests) ... skipped 'Windows specific' test_enum_crls (test.test_ssl.BasicSocketTests) ... skipped 'Windows specific' test_errors_sslwrap (test.test_ssl.BasicSocketTests) ... ok test_get_default_verify_paths (test.test_ssl.BasicSocketTests) ... ok test_malformed_cert (test.test_ssl.BasicSocketTests) Wrapping with a badly formatted certificate (syntax error) ... ok test_malformed_key (test.test_ssl.BasicSocketTests) Wrapping with a badly formatted key (syntax error) ... ok test_match_hostname (test.test_ssl.BasicSocketTests) ... ok test_openssl_version (test.test_ssl.BasicSocketTests) ... ok test_parse_all_sans (test.test_ssl.BasicSocketTests) ... ok test_parse_cert (test.test_ssl.BasicSocketTests) ... {'OCSP': ('http://ocsp.verisign.com',), 'caIssuers': ('http://SVRIntl-G3-aia.verisign.com/SVRIntlG3.cer',), 'crlDistributionPoints': ('http://SVRIntl-G3-crl.verisign.com/SVRIntlG3.crl',), 'issuer': ((('countryName', 'US'),), (('organizationName', 'VeriSign, Inc.'),), (('organizationalUnitName', 'VeriSign Trust Network'),), (('organizationalUnitName', 'Terms of use at https://www.verisign.com/rpa (c)10'),), (('commonName', 'VeriSign Class 3 International Server CA - G3'),)), 'notAfter': 'Sep 20 23:59:59 2012 GMT', 'notBefore': 'Sep 21 00:00:00 2011 GMT', 'serialNumber': '2EE6EA7640A075CEE5005F4D7C79549A', 'subject': ((('countryName', 'FI'),), (('stateOrProvinceName', 'Espoo'),), (('localityName', 'Espoo'),), (('organizationName', 'Nokia'),), (('organizationalUnitName', 'BI'),), (('commonName', 'projects.developer.nokia.com'),)), 'subjectAltName': (('DNS', 'projects.developer.nokia.com'), ('DNS', 'projects.forum.nokia.com')), 'version': 3} ok test_parse_cert_CVE_2013_4238 (test.test_ssl.BasicSocketTests) ... {'issuer': ((('countryName', 'US'),), (('stateOrProvinceName', 'Oregon'),), (('localityName', 'Beaverton'),), (('organizationName', 'Python Software Foundation'),), (('organizationalUnitName', 'Python Core Development'),), (('commonName', 'null.python.org\x00example.org'),), (('emailAddress', 'python-dev at python.org'),)), 'notAfter': 'Aug 7 13:12:52 2013 GMT', 'notBefore': 'Aug 7 13:11:52 2013 GMT', 'serialNumber': '00', 'subject': ((('countryName', 'US'),), (('stateOrProvinceName', 'Oregon'),), (('localityName', 'Beaverton'),), (('organizationName', 'Python Software Foundation'),), (('organizationalUnitName', 'Python Core Development'),), (('commonName', 'null.python.org\x00example.org'),), (('emailAddress', 'python-dev at python.org'),)), 'subjectAltName': (('DNS', 'altnull.python.org\x00example.com'), ('email', 'null at python.org\x00user at example.org'), ('URI', 'http://null.python.org\x00http://example.org'), ('IP Address', '192.0.2.1'), ('IP Address', '2001:DB8:0:0:0:0:0:1')), 'version': 3} ok test_parse_cert_CVE_2019_5010 (test.test_ssl.BasicSocketTests) ... {'issuer': ((('countryName', 'UK'),), (('commonName', 'cody-ca'),)), 'notAfter': 'Jun 14 18:00:58 2028 GMT', 'notBefore': 'Jun 18 18:00:58 2018 GMT', 'serialNumber': '02', 'subject': ((('countryName', 'UK'),), (('commonName', 'codenomicon-vm-2.test.lal.cisco.com'),)), 'subjectAltName': (('DNS', 'codenomicon-vm-2.test.lal.cisco.com'),), 'version': 3} ok test_private_init (test.test_ssl.BasicSocketTests) ... ok test_purpose_enum (test.test_ssl.BasicSocketTests) ... ok test_random (test.test_ssl.BasicSocketTests) ... RAND_status is 1 (sufficient randomness) ok test_read_write_zero (test.test_ssl.BasicSocketTests) ... server: new connection from ('127.0.0.1', 52385) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_refcycle (test.test_ssl.BasicSocketTests) ... ok test_server_side (test.test_ssl.BasicSocketTests) ... ok test_str_for_enums (test.test_ssl.BasicSocketTests) ... ok test_timeout (test.test_ssl.BasicSocketTests) ... ok test_tls_unique_channel_binding (test.test_ssl.BasicSocketTests) ... ok test_unknown_channel_binding (test.test_ssl.BasicSocketTests) ... ok test_unsupported_dtls (test.test_ssl.BasicSocketTests) ... ok test_wrapped_unconnected (test.test_ssl.BasicSocketTests) ... ok test_bad_server_hostname (test.test_ssl.SSLErrorTests) ... ok test_lib_reason (test.test_ssl.SSLErrorTests) ... ok test_str (test.test_ssl.SSLErrorTests) ... ok test_subclass (test.test_ssl.SSLErrorTests) ... ok test_buffer_types (test.test_ssl.MemoryBIOTests) ... ok test_eof (test.test_ssl.MemoryBIOTests) ... ok test_error_types (test.test_ssl.MemoryBIOTests) ... ok test_pending (test.test_ssl.MemoryBIOTests) ... ok test_read_write (test.test_ssl.MemoryBIOTests) ... ok test_private_init (test.test_ssl.SSLObjectTests) ... ok test_unwrap (test.test_ssl.SSLObjectTests) ... ok test_bio_handshake (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52391) Needed 2 calls to complete do_handshake(). server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) Needed 3 calls to complete unwrap(). ok test_bio_read_write_data (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52393) Needed 2 calls to complete do_handshake(). Needed 1 calls to complete write(). server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) Needed 4 calls to complete read(). Needed 2 calls to complete unwrap(). ok test_ciphers (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52395) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52396) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_connect (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52398) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52399) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_connect_cadata (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52401) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52402) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_connect_capath (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52404) server: bad connection attempt from ('127.0.0.1', 52404): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() OSError: [Errno 41] Protocol wrong type for socket ERROR test_connect_ex (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52407) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_connect_fail (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52409) server: bad connection attempt from ('127.0.0.1', 52409): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:969) ok test_connect_with_context (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52411) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52412) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52413) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_connect_with_context_fail (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52415) server: bad connection attempt from ('127.0.0.1', 52415): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:969) ok test_context_setget (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52417) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_get_ca_certs_capath (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52419) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_get_server_certificate (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52422) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52424) Verified certificate for localhost:52420 is -----BEGIN CERTIFICATE----- MIIF8TCCBFmgAwIBAgIJAMstgJlaaVJcMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNV BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xODA4MjkxNDIzMTZaFw0zNzEwMjgx NDIzMTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEj MCEGA1UECgwaUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMMCWxv Y2FsaG9zdDCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAMW0s615CVCi M3vO2S7HubSGYYqQ/WGHSFsqpNwPzuOQsCoDBlZ6eNkyMJttne8/4A5sIiRggrM9 djtiL4fkzc7aZcgPGgcaMv8Za2gTIM1e+b1QL4xG5I6rYxoscdAbRHHZPFxisxVQ ztv3euk3UsZGsK/WAhJczgS8QmigBHsBp2PSkb+jR+oMB0WMfpBluGfWJmV754Zu Nx92Af8fQXx2fU88ahWIdeJxuxDiQHrTTY9/5pc/hvZAoBt+XI0cQoc8cQ45NesW Mx1z5uopbbh6kSwxkjn2rH2FT/hG+nf+/68TBMvs2buKWm3NmfZy8YJbf0sLSc1g s7OQ7cfzHADvmHq7KR0H5Y7+/YIogr0z9k771A2uZqiR8oNqYKTf1vyGULA0voux Wm93ddNLlafhhaf3YSqKW1Qkmg+julztVN1YKDjNUWfhDxmHg0U2f+pMHyUQyCuw 1NXlzJnvOGgGJQxI7jluajY2ycTtx78lSGWp7m6HQ9PUwgGBNX6gMwIDAQABo4IB wDCCAbwwFAYDVR0RBA0wC4IJbG9jYWxob3N0MA4GA1UdDwEB/wQEAwIFoDAdBgNV HSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAdBgNVHQ4E FgQUhXUQJdAsgFAkGltXcN61y3GpO3swfQYDVR0jBHYwdIAUs4qgorpx8agkedSk WyU2FR5JyM2hUaRPME0xCzAJBgNVBAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29m dHdhcmUgRm91bmRhdGlvbiBDQTEWMBQGA1UEAwwNb3VyLWNhLXNlcnZlcoIJAMst gJlaaVJbMIGDBggrBgEFBQcBAQR3MHUwPAYIKwYBBQUHMAKGMGh0dHA6Ly90ZXN0 Y2EucHl0aG9udGVzdC5uZXQvdGVzdGNhL3B5Y2FjZXJ0LmNlcjA1BggrBgEFBQcw AYYpaHR0cDovL3Rlc3RjYS5weXRob250ZXN0Lm5ldC90ZXN0Y2Evb2NzcC8wQwYD VR0fBDwwOjA4oDagNIYyaHR0cDovL3Rlc3RjYS5weXRob250ZXN0Lm5ldC90ZXN0 Y2EvcmV2b2NhdGlvbi5jcmwwDQYJKoZIhvcNAQELBQADggGBAJXzVrvVjHC90d7a Y7Ap19tgJ9ZZ/WEbMMbQXXN9NOFo4yimieZgvYnTDvRyrXJ2+IYh/XU8+G2+nATh ggNpbK7QVbpe8sr1D47W2Y3IVkb0+Kx0Khl7jkdwH/v7vWkCoaVKbiEcBBQVVb+/ JEPIFwO+Pizq28ivHf1S39YVSZ7CRGnv8UVDg7IezxQcEz/+nHHL5xsYVjanr0Tx C6F5REb5Q0Yp2LDKSU1lYNP2jnS8Yp4ejUspmrQN8KJ3WzTkES+nJcXlB3YSrr51 cxXkCn1TOFY/eW1uyu2Aq1btfosc5+PUYjAicOcpsgM8/vo98DbATRGimdMpMSe4 xbgVozxPm3NeK7L7y/11R7gXvSHY5sG5/3OB2CUIbQheHKWDUN5n5trQjlrT8iqx P7iAIQdqcRVtBetRs1mN1BVGfgKoEwEWmb0DzHBxKiMWeK/R1QGdBLRjk5oEOpIu 5n5zk6X+UJu9DupUhm985RR3/sIoWkoO1y2M6e1hKbJT/2wEvA== -----END CERTIFICATE----- server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_get_server_certificate_fail (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52427) [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:969) server: bad connection attempt from ('127.0.0.1', 52427): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:969) ok test_get_server_certificate_sni (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52430) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52432) Verified certificate for localhost:52428 is -----BEGIN CERTIFICATE----- MIIF8TCCBFmgAwIBAgIJAMstgJlaaVJcMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNV BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xODA4MjkxNDIzMTZaFw0zNzEwMjgx NDIzMTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEj MCEGA1UECgwaUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMMCWxv Y2FsaG9zdDCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAMW0s615CVCi M3vO2S7HubSGYYqQ/WGHSFsqpNwPzuOQsCoDBlZ6eNkyMJttne8/4A5sIiRggrM9 djtiL4fkzc7aZcgPGgcaMv8Za2gTIM1e+b1QL4xG5I6rYxoscdAbRHHZPFxisxVQ ztv3euk3UsZGsK/WAhJczgS8QmigBHsBp2PSkb+jR+oMB0WMfpBluGfWJmV754Zu Nx92Af8fQXx2fU88ahWIdeJxuxDiQHrTTY9/5pc/hvZAoBt+XI0cQoc8cQ45NesW Mx1z5uopbbh6kSwxkjn2rH2FT/hG+nf+/68TBMvs2buKWm3NmfZy8YJbf0sLSc1g s7OQ7cfzHADvmHq7KR0H5Y7+/YIogr0z9k771A2uZqiR8oNqYKTf1vyGULA0voux Wm93ddNLlafhhaf3YSqKW1Qkmg+julztVN1YKDjNUWfhDxmHg0U2f+pMHyUQyCuw 1NXlzJnvOGgGJQxI7jluajY2ycTtx78lSGWp7m6HQ9PUwgGBNX6gMwIDAQABo4IB wDCCAbwwFAYDVR0RBA0wC4IJbG9jYWxob3N0MA4GA1UdDwEB/wQEAwIFoDAdBgNV HSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAdBgNVHQ4E FgQUhXUQJdAsgFAkGltXcN61y3GpO3swfQYDVR0jBHYwdIAUs4qgorpx8agkedSk WyU2FR5JyM2hUaRPME0xCzAJBgNVBAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29m dHdhcmUgRm91bmRhdGlvbiBDQTEWMBQGA1UEAwwNb3VyLWNhLXNlcnZlcoIJAMst gJlaaVJbMIGDBggrBgEFBQcBAQR3MHUwPAYIKwYBBQUHMAKGMGh0dHA6Ly90ZXN0 Y2EucHl0aG9udGVzdC5uZXQvdGVzdGNhL3B5Y2FjZXJ0LmNlcjA1BggrBgEFBQcw AYYpaHR0cDovL3Rlc3RjYS5weXRob250ZXN0Lm5ldC90ZXN0Y2Evb2NzcC8wQwYD VR0fBDwwOjA4oDagNIYyaHR0cDovL3Rlc3RjYS5weXRob250ZXN0Lm5ldC90ZXN0 Y2EvcmV2b2NhdGlvbi5jcmwwDQYJKoZIhvcNAQELBQADggGBAJXzVrvVjHC90d7a Y7Ap19tgJ9ZZ/WEbMMbQXXN9NOFo4yimieZgvYnTDvRyrXJ2+IYh/XU8+G2+nATh ggNpbK7QVbpe8sr1D47W2Y3IVkb0+Kx0Khl7jkdwH/v7vWkCoaVKbiEcBBQVVb+/ JEPIFwO+Pizq28ivHf1S39YVSZ7CRGnv8UVDg7IezxQcEz/+nHHL5xsYVjanr0Tx C6F5REb5Q0Yp2LDKSU1lYNP2jnS8Yp4ejUspmrQN8KJ3WzTkES+nJcXlB3YSrr51 cxXkCn1TOFY/eW1uyu2Aq1btfosc5+PUYjAicOcpsgM8/vo98DbATRGimdMpMSe4 xbgVozxPm3NeK7L7y/11R7gXvSHY5sG5/3OB2CUIbQheHKWDUN5n5trQjlrT8iqx P7iAIQdqcRVtBetRs1mN1BVGfgKoEwEWmb0DzHBxKiMWeK/R1QGdBLRjk5oEOpIu 5n5zk6X+UJu9DupUhm985RR3/sIoWkoO1y2M6e1hKbJT/2wEvA== -----END CERTIFICATE----- server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_get_server_certificate_timeout (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52435) server: bad connection attempt from ('127.0.0.1', 52435): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:969) ok test_makefile_close (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52437) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_non_blocking_connect_ex (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52439) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_non_blocking_handshake (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 52441) Needed 2 calls to do_handshake() to establish session. server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_PROTOCOL_TLS (test.test_ssl.ThreadedTests) Connecting to an SSLv23 server with various client options ... PROTOCOL_TLS->PROTOCOL_TLS CERT_NONE PROTOCOL_TLSv1->PROTOCOL_TLS CERT_NONE PROTOCOL_TLS->PROTOCOL_TLS CERT_OPTIONAL PROTOCOL_TLSv1->PROTOCOL_TLS CERT_OPTIONAL PROTOCOL_TLS->PROTOCOL_TLS CERT_REQUIRED PROTOCOL_TLSv1->PROTOCOL_TLS CERT_REQUIRED PROTOCOL_TLS->PROTOCOL_TLS CERT_NONE {PROTOCOL_TLSv1->PROTOCOL_TLS} CERT_NONE ok test_alpn_protocols (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52459) client: sending b'FOO\n'... server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: closing connection. server: new connection from ('127.0.0.1', 52461) client: sending b'FOO\n'... server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: closing connection. server: new connection from ('127.0.0.1', 52463) client: sending b'FOO\n'... server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: closing connection. server: new connection from ('127.0.0.1', 52465) client: sending b'FOO\n'... server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: closing connection. ok test_asyncore_server (test.test_ssl.ThreadedTests) Check the example asyncore integration. ... server: new connection from 127.0.0.1:52467 client: sending b'FOO\n'... server: read b'FOO\n' from client client: read b'foo\n' client: closing connection. client: connection closed. cleanup: stopping server. server: read b'over\n' from client cleanup: joining server thread. server: closed connection server: read b'' from client cleanup: successfully joined. ok test_check_hostname (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52469) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52471) server: bad connection attempt from ('127.0.0.1', 52471): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad certificate (_ssl.c:969) ok test_check_hostname_idn (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52474) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52476) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52478) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52480) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52482) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52484) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52486) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52488) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52490) server: bad connection attempt from ('127.0.0.1', 52490): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad certificate (_ssl.c:969) ok test_compression (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52492) client: sending b'FOO\n'... server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: closing connection. got compression: None ok test_compression_disabled (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52494) client: sending b'FOO\n'... server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: closing connection. ok test_crl_check (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52496) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52498) server: bad connection attempt from ('127.0.0.1', 52498): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:969) server: new connection from ('127.0.0.1', 52500) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_default_ecdh_curve (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52502) server: connection cipher is now ('ECDHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256) ok test_dh_params (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52504) server: connection cipher is now ('DHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256) client: sending b'FOO\n'... client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: closing connection. ok test_do_handshake_enotconn (test.test_ssl.ThreadedTests) ... ok test_dual_rsa_ecc (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52506) server: connection cipher is now ('ECDHE-ECDSA-AES256-GCM-SHA384', 'TLSv1.2', 256) ok test_ecc_cert (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52508) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_ecdh_curve (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52510) client: sending b'FOO\n'... server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: closing connection. server: new connection from ('127.0.0.1', 52512) client: sending b'FOO\n'... server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: closing connection. server: new connection from ('127.0.0.1', 52514) server: bad connection attempt from ('127.0.0.1', 52514): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: NO_SUITABLE_KEY_SHARE] no suitable key share (_ssl.c:969) ok test_echo (test.test_ssl.ThreadedTests) Basic test of an SSL client connecting to a server ... server: new connection from ('127.0.0.1', 52516) client: sending b'FOO\n'... server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: closing connection. server: new connection from ('127.0.0.1', 52518) server: bad connection attempt from ('127.0.0.1', 52518): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL] called a function you should not call (_ssl.c:969) server: new connection from ('127.0.0.1', 52520) server: bad connection attempt from ('127.0.0.1', 52520): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:969) server: new connection from ('127.0.0.1', 52522) server: bad connection attempt from ('127.0.0.1', 52522): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL] called a function you should not call (_ssl.c:969) ok test_getpeercert (test.test_ssl.ThreadedTests) ... {'OCSP': ('http://testca.pythontest.net/testca/ocsp/',), 'caIssuers': ('http://testca.pythontest.net/testca/pycacert.cer',), 'crlDistributionPoints': ('http://testca.pythontest.net/testca/revocation.crl',), 'issuer': ((('countryName', 'XY'),), (('organizationName', 'Python Software Foundation CA'),), (('commonName', 'our-ca-server'),)), 'notAfter': 'Oct 28 14:23:16 2037 GMT', 'notBefore': 'Aug 29 14:23:16 2018 GMT', 'serialNumber': 'CB2D80995A69525C', 'subject': ((('countryName', 'XY'),), (('localityName', 'Castle Anthrax'),), (('organizationName', 'Python Software Foundation'),), (('commonName', 'localhost'),)), 'subjectAltName': (('DNS', 'localhost'),), 'version': 3} Connection cipher is ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256). ok test_getpeercert_enotconn (test.test_ssl.ThreadedTests) ... ok test_handshake_timeout (test.test_ssl.ThreadedTests) ... ok test_hostname_checks_common_name (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52529) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52531) server: bad connection attempt from ('127.0.0.1', 52531): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad certificate (_ssl.c:969) ok test_min_max_version_mismatch (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52533) server: bad connection attempt from ('127.0.0.1', 52533): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:969) ok test_min_max_version_sslv3 (test.test_ssl.ThreadedTests) ... skipped 'SSLv3 is not available.' test_min_max_version_tlsv1_1 (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52535) server: connection cipher is now ('ECDHE-RSA-AES256-SHA', 'TLSv1.0', 256) ok test_min_max_version_tlsv1_2 (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52537) server: connection cipher is now ('ECDHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256) ok test_no_shared_ciphers (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52539) server: bad connection attempt from ('127.0.0.1', 52539): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: NO_SHARED_CIPHER] no shared cipher (_ssl.c:969) ok test_nonblocking_send (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52541) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) Test server failure: Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2491, in run self.write(msg.lower()) File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2410, in write return self.sslconn.write(bytes) File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1148, in write return self._sslobj.write(data) ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2286) ok test_npn_protocols (test.test_ssl.ThreadedTests) ... ok test_protocol_sslv2 (test.test_ssl.ThreadedTests) Connecting to an SSLv2 server with various client options ... skipped 'SSLv2 is not available.' test_protocol_sslv3 (test.test_ssl.ThreadedTests) Connecting to an SSLv3 server with various client options ... skipped 'SSLv3 is not available.' test_protocol_tlsv1 (test.test_ssl.ThreadedTests) Connecting to a TLSv1 server with various client options ... PROTOCOL_TLSv1->PROTOCOL_TLSv1 CERT_NONE PROTOCOL_TLSv1->PROTOCOL_TLSv1 CERT_OPTIONAL PROTOCOL_TLSv1->PROTOCOL_TLSv1 CERT_REQUIRED {PROTOCOL_TLS->PROTOCOL_TLSv1} CERT_NONE ok test_protocol_tlsv1_1 (test.test_ssl.ThreadedTests) Connecting to a TLSv1.1 server with various client options. ... PROTOCOL_TLSv1_1->PROTOCOL_TLSv1_1 CERT_NONE {PROTOCOL_TLS->PROTOCOL_TLSv1_1} CERT_NONE PROTOCOL_TLSv1_1->PROTOCOL_TLS CERT_NONE {PROTOCOL_TLSv1_2->PROTOCOL_TLSv1_1} CERT_NONE {PROTOCOL_TLSv1_1->PROTOCOL_TLSv1_2} CERT_NONE ok test_protocol_tlsv1_2 (test.test_ssl.ThreadedTests) Connecting to a TLSv1.2 server with various client options. ... PROTOCOL_TLSv1_2->PROTOCOL_TLSv1_2 CERT_NONE {PROTOCOL_TLS->PROTOCOL_TLSv1_2} CERT_NONE PROTOCOL_TLSv1_2->PROTOCOL_TLS CERT_NONE {PROTOCOL_TLSv1->PROTOCOL_TLSv1_2} CERT_NONE {PROTOCOL_TLSv1_2->PROTOCOL_TLSv1} CERT_NONE {PROTOCOL_TLSv1_1->PROTOCOL_TLSv1_2} CERT_NONE {PROTOCOL_TLSv1_2->PROTOCOL_TLSv1_1} CERT_NONE ok test_read_write_after_close_raises_valuerror (test.test_ssl.ThreadedTests) ... ok test_recv_send (test.test_ssl.ThreadedTests) Test recv(), send() and friends. ... server: new connection from ('127.0.0.1', 52577) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_recv_zero (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52580) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_rude_shutdown (test.test_ssl.ThreadedTests) A brutal shutdown of an SSL server should raise an OSError ... ok test_selected_alpn_protocol (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52584) client: sending b'FOO\n'... server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: closing connection. ok test_selected_alpn_protocol_if_server_uses_alpn (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52586) client: sending b'FOO\n'... server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: sending b'FOO\n'... client: read b'foo\n' client: closing connection. ok test_sendfile (test.test_ssl.ThreadedTests) ... ok test_server_accept (test.test_ssl.ThreadedTests) ... ok test_session (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52592) server: connection cipher is now ('ECDHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256) server: new connection from ('127.0.0.1', 52594) server: connection cipher is now ('ECDHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256) server: new connection from ('127.0.0.1', 52596) server: connection cipher is now ('ECDHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256) server: new connection from ('127.0.0.1', 52598) server: connection cipher is now ('ECDHE-RSA-AES256-GCM-SHA384', 'TLSv1.2', 256) ok test_session_handling (test.test_ssl.ThreadedTests) ... ok test_shared_ciphers (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52604) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_sni_callback (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52606) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52608) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52610) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_sni_callback_alert (test.test_ssl.ThreadedTests) ... ok test_sni_callback_raising (test.test_ssl.ThreadedTests) ... ok test_sni_callback_wrong_return_type (test.test_ssl.ThreadedTests) ... ok test_socketserver (test.test_ssl.ThreadedTests) Using socketserver to create and manage SSL connections. ... server (('127.0.0.1', 52617):52617 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)): [26/Apr/2021 11:43:19] "GET /keycert.pem HTTP/1.1" 200 - client: read 4058 bytes from remote server '>' stopping HTTPS server joining HTTPS thread ok test_ssl_cert_verify_error (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52621) server: bad connection attempt from ('127.0.0.1', 52621): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:969) ok test_starttls (test.test_ssl.ThreadedTests) Switching from clear text to encrypted and back again. ... client: sending b'msg 1'... server: new connection from ('127.0.0.1', 52623) server: read b'msg 1' (unencrypted), sending back b'msg 1' (unencrypted)... client: read b'msg 1' from server client: sending b'MSG 2'... server: read b'MSG 2' (unencrypted), sending back b'msg 2' (unencrypted)... client: read b'msg 2' from server client: sending b'STARTTLS'... server: read STARTTLS from client, sending OK... client: read b'ok' from server, starting TLS... client: sending b'MSG 3'... server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: read b'MSG 3' (encrypted), sending back b'msg 3' (encrypted)... client: read b'msg 3' from server client: sending b'msg 4'... server: read b'msg 4' (encrypted), sending back b'msg 4' (encrypted)... client: read b'msg 4' from server client: sending b'ENDTLS'... server: read ENDTLS from client, sending OK... client: read b'ok' from server, ending TLS... client: sending b'msg 5'... server: connection is now unencrypted... server: read b'msg 5' (unencrypted), sending back b'msg 5' (unencrypted)... client: read b'msg 5' from server client: sending b'msg 6'... server: read b'msg 6' (unencrypted), sending back b'msg 6' (unencrypted)... client: read b'msg 6' from server client: closing connection. server: client closed connection ok test_tls1_3 (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52625) server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_tls_unique_channel_binding (test.test_ssl.ThreadedTests) Test tls-unique channel binding. ... server: new connection from ('127.0.0.1', 52627) got channel binding data: b'\xb6\xc4\x94=\xb1\xc0\xe1\x05\xbd\x803\xd1\xec\x14,\x95\x8d\xbe!\xbf\xa6\x93\x06)\xc0(U\r\x8d\xdcA\xe9\xa2\xef\xae*6\xa8\xb5~;\x8f\xd9\xa6\x141x\xa2' server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) server: new connection from ('127.0.0.1', 52628) got another channel binding data: b'N1\xb3OAX\xaa\x05dD/~\x8a\xcbM\xf3\x1b\x1a<\x98:\xb9\x80\xf6b\xe3\x1a\x0e\x9e\xf6\x87\xde\xfc\xfc\xc4\x93t\x90a\xb7\xa6O\xdf\xcc\x10\xdf?y' server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) ok test_version_basic (test.test_ssl.ThreadedTests) Basic tests for SSLSocket.version(). ... ok test_wrong_cert_tls12 (test.test_ssl.ThreadedTests) Connecting when the server rejects the client's certificate ... server: new connection from ('127.0.0.1', 52632) SSLError is SSLError(1, '[SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:969)') server: bad connection attempt from ('127.0.0.1', 52632): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:969) ok test_wrong_cert_tls13 (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 52634) SSLError is SSLError(1, '[SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:2438)') server: bad connection attempt from ('127.0.0.1', 52634): Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2347, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 518, in wrap_socket return self.sslsocket_class._create( File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1070, in _create self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:969) ok test_bpo37428_pha_cert_none (test.test_ssl.TestPostHandshakeAuth) ... ok test_pha_no_pha_client (test.test_ssl.TestPostHandshakeAuth) ... ok test_pha_no_pha_server (test.test_ssl.TestPostHandshakeAuth) ... ok test_pha_not_tls13 (test.test_ssl.TestPostHandshakeAuth) ... ok test_pha_optional (test.test_ssl.TestPostHandshakeAuth) ... ok test_pha_optional_nocert (test.test_ssl.TestPostHandshakeAuth) ... ok test_pha_required (test.test_ssl.TestPostHandshakeAuth) ... ok test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth) ... server: new connection from ('127.0.0.1', 52650) client cert is None client did not provide a cert server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) TLS: (, 'write', TLSVersion.TLSv1_3, _TLSContentType.ALERT, _TLSAlertType.CERTIFICATE_REQUIRED, b'\x02t') TLS: (, 'read', TLSVersion.TLSv1_3, _TLSContentType.ALERT, _TLSAlertType.CERTIFICATE_REQUIRED, b'\x02t') Test server failure: Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2427, in run msg = self.read() File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2404, in read return self.sslconn.read() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1131, in read return self._sslobj.read(len) ssl.SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate (_ssl.c:2438) ok test_pha_setter (test.test_ssl.TestPostHandshakeAuth) ... ok test_keylog_defaults (test.test_ssl.TestSSLDebug) ... ok test_keylog_env (test.test_ssl.TestSSLDebug) ... skipped 'test is not compatible with ignore_environment' test_keylog_filename (test.test_ssl.TestSSLDebug) ... ok test_msg_callback (test.test_ssl.TestSSLDebug) ... ok test_msg_callback_deadlock_bpo43577 (test.test_ssl.TestSSLDebug) ... ok test_msg_callback_tls12 (test.test_ssl.TestSSLDebug) ... ok test_get_server_certificate_ipv6 (test.test_ssl.NetworkedTests) ... skipped "Resource 'ipv6.google.com' is not available" test test_ssl failed test_timeout_connect_ex (test.test_ssl.NetworkedTests) ... ok ====================================================================== ERROR: test_connect_capath (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2045, in test_connect_capath s.connect(self.server_addr) File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1372, in connect self._real_connect(addr, False) File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1363, in _real_connect self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1339, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 54] Connection reset by peer ---------------------------------------------------------------------- Ran 164 tests in 29.112s FAILED (errors=1, skipped=10) 1 test failed again: test_ssl ---------- messages: 391914 nosy: christian.heimes, pablogsal priority: normal severity: normal status: open title: test_ssl fails in the macos CI versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 13:46:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Apr 2021 17:46:15 +0000 Subject: [issue3849] FUD in documentation for urllib.urlopen() In-Reply-To: <1221246343.23.0.128587140594.issue3849@psf.upfronthosting.co.za> Message-ID: <1619459175.26.0.409888376288.issue3849@roundup.psfhosted.org> Irit Katriel added the comment: This caveat no longer appear in the doc, and I could not find anything similar, so I am concluding this is no longer relevant. ---------- nosy: +iritkatriel resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 13:46:09 2021 From: report at bugs.python.org (Llandy Riveron Del Risco) Date: Mon, 26 Apr 2021 17:46:09 +0000 Subject: [issue43938] Document that dataclasses.FrozenInstanceError derives from AttributeError In-Reply-To: <1619367934.66.0.118444398997.issue43938@roundup.psfhosted.org> Message-ID: <1619459169.26.0.714085922082.issue43938@roundup.psfhosted.org> Llandy Riveron Del Risco added the comment: The CLA should be correctly signed. Using this message as a test to see if the star appears correctly after the name. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 13:50:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Apr 2021 17:50:03 +0000 Subject: [issue10764] sysconfig and alternative implementations In-Reply-To: <1293126984.08.0.755809334689.issue10764@psf.upfronthosting.co.za> Message-ID: <1619459403.17.0.685412204427.issue10764@roundup.psfhosted.org> Irit Katriel added the comment: This was fixed in python 3 (see issue9878) and it's too late for 2.7. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 13:55:58 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 17:55:58 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619459758.11.0.99338611372.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: No problem, will do! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 14:15:53 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 26 Apr 2021 18:15:53 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619459758.11.0.99338611372.issue43908@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: PS. Don't wait for me. I'm going on vacation this Thursday and won't be back until well after the 3.10b1 release is done, and before I go I'm pretty busy already. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 14:21:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Apr 2021 18:21:45 +0000 Subject: [issue31726] Missing token.COMMENT In-Reply-To: <1507450136.57.0.213398074469.issue31726@psf.upfronthosting.co.za> Message-ID: <1619461305.87.0.645412792998.issue31726@roundup.psfhosted.org> Irit Katriel added the comment: Fixed in 3.7 and too late for earlier versions. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 14:23:48 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 26 Apr 2021 18:23:48 +0000 Subject: [issue43757] pathlib: move 'resolve()' logic out of path flavour In-Reply-To: <1617762768.57.0.0406169855145.issue43757@roundup.psfhosted.org> Message-ID: <1619461428.48.0.909306709309.issue43757@roundup.psfhosted.org> Steve Dower added the comment: I'm happy with the PR as it stands now. Anyone else have an opinion? ---------- nosy: +eryksun, steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 14:29:18 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 26 Apr 2021 18:29:18 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619461758.47.0.297020538165.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: @serhiy.storchaka I have no idea what's causing the errors I described in https://bugs.python.org/msg391947. I looked at all the changes in apply-to-all.diff and I don't think any of the errors are related. Do you have any thoughts about this problem? Is it even reproducible? (I'm attaching a diff combining the patch.diff and apply-to-all.diff together in one file.) ---------- Added file: https://bugs.python.org/file49988/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 14:30:52 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 26 Apr 2021 18:30:52 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619461758.47.0.297020538165.issue43908@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: The solution would be bisection -- apply half of the changes from apply-to-all, and see if you still get the errors. Etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 14:32:48 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 26 Apr 2021 18:32:48 +0000 Subject: [issue42998] pathlib.Path: add `username` argument to `home()` In-Reply-To: <1611287835.84.0.363729514225.issue42998@roundup.psfhosted.org> Message-ID: <1619461968.81.0.490242876288.issue42998@roundup.psfhosted.org> Steve Dower added the comment: I'm not convinced this is a good change, mainly for the reasons Serhiy mentioned (and others have mentioned when I've spoken with them privately). What would you do with your custom subclass if home() did not have this argument? ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 14:39:09 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 26 Apr 2021 18:39:09 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619462349.75.0.13789807031.issue43908@roundup.psfhosted.org> Change by Shreyan Avigyan : Removed file: https://bugs.python.org/file49988/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 14:53:37 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 26 Apr 2021 18:53:37 +0000 Subject: [issue43938] Document that dataclasses.FrozenInstanceError derives from AttributeError In-Reply-To: <1619367934.66.0.118444398997.issue43938@roundup.psfhosted.org> Message-ID: <1619463217.43.0.820048718384.issue43938@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 8a307e488d596914a7a5df6b2fdd945f8ce81e69 by Llandy Riveron Del Risco in branch 'master': bpo-43938: improve dataclasses.FrozenInstanceError documentation (GH-25603) https://github.com/python/cpython/commit/8a307e488d596914a7a5df6b2fdd945f8ce81e69 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 14:53:40 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Apr 2021 18:53:40 +0000 Subject: [issue43938] Document that dataclasses.FrozenInstanceError derives from AttributeError In-Reply-To: <1619367934.66.0.118444398997.issue43938@roundup.psfhosted.org> Message-ID: <1619463220.37.0.985952371291.issue43938@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24330 pull_request: https://github.com/python/cpython/pull/25635 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 14:53:46 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Apr 2021 18:53:46 +0000 Subject: [issue43938] Document that dataclasses.FrozenInstanceError derives from AttributeError In-Reply-To: <1619367934.66.0.118444398997.issue43938@roundup.psfhosted.org> Message-ID: <1619463226.65.0.000407117277242.issue43938@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24331 pull_request: https://github.com/python/cpython/pull/25636 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:08:15 2021 From: report at bugs.python.org (Barney Gale) Date: Mon, 26 Apr 2021 19:08:15 +0000 Subject: [issue42998] pathlib.Path: add `username` argument to `home()` In-Reply-To: <1611287835.84.0.363729514225.issue42998@roundup.psfhosted.org> Message-ID: <1619464095.84.0.928509241699.issue42998@roundup.psfhosted.org> Barney Gale added the comment: Thanks very much for taking a look. I can understand the view that, given the unreliability of `os.path.expanduser('~foo')`, we shouldn't be making that functionality *more* available. My argument for this being a reasonable change is as follows: Firstly, `os.getcwd()` is a more fundamental operation than `os.path.absolute()`. In both pathlib and os.path, the `absolute()` implementation is built on the `getcwd()` implementation. The process is: call the more fundamental operation, and append whatever else was passed as an argument. Analagously, `gethomedir()` is a more fundamental operation than `expanduser()`. In the same way, `expanduser()` can call a more fundamental operation and then append the path passed in. Secondly, for a `pathlib.AbstractPath` implementation, it's a much cleaner API to have `getcwd()` and `gethomedir()` as abstract methods with identical signatures, and `absolute()` and `expanduser()` with default implementations. Thirdly, if there's are issues with the implementation for retrieving other user's home directories, those should be treated as individual issues with their own bugs, and we should add suitable warnings in the docs in the short term. My patch should make these cases *easier* to solve as we no longer have two competing implementations of the same thing. Finally, I don't think anyone is going to see `home('barney')` in the docs and decided to retrieve a user's home directory on a whim. If someone *does* need to retrieve another user's home directory, they're going to use `Path('~' + user).expanduser()` if `Path.home(user)` isn't available. My argument mostly comes from the similarities I perceive between getcwd/absolute and gethomedir/expanduser. We don't expect users to `os.path.absolute('.')` to get the current working directory, after all! But perhaps I've overestimated the similarities here. Any thoughts? Thanks again for taking a look. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:10:56 2021 From: report at bugs.python.org (Barney Gale) Date: Mon, 26 Apr 2021 19:10:56 +0000 Subject: [issue42998] pathlib.Path: add `username` argument to `home()` In-Reply-To: <1611287835.84.0.363729514225.issue42998@roundup.psfhosted.org> Message-ID: <1619464256.74.0.0694165693064.issue42998@roundup.psfhosted.org> Barney Gale added the comment: In the previous comment, I was referring to bpo-39899 when I referred to "my patch". Long day! :D ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:11:51 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 26 Apr 2021 19:11:51 +0000 Subject: [issue40432] Pegen regenerate project for Windows not working In-Reply-To: <1588127830.15.0.595745305392.issue40432@roundup.psfhosted.org> Message-ID: <1619464311.89.0.964740457787.issue40432@roundup.psfhosted.org> Steve Dower added the comment: New changeset 425434dadc30d96dc1c0c628f954f9b6f5edd2c9 by Ken Jin in branch 'master': bpo-40432: Use python 3.8 or higher to compile CPython on Windows (#25389) https://github.com/python/cpython/commit/425434dadc30d96dc1c0c628f954f9b6f5edd2c9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:12:36 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Apr 2021 19:12:36 +0000 Subject: [issue40432] Pegen regenerate project for Windows not working In-Reply-To: <1588127830.15.0.595745305392.issue40432@roundup.psfhosted.org> Message-ID: <1619464356.28.0.180473873174.issue40432@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +24332 pull_request: https://github.com/python/cpython/pull/25637 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:23:57 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 26 Apr 2021 19:23:57 +0000 Subject: [issue42998] pathlib.Path: add `username` argument to `home()` In-Reply-To: <1611287835.84.0.363729514225.issue42998@roundup.psfhosted.org> Message-ID: <1619465037.57.0.459509487537.issue42998@roundup.psfhosted.org> Steve Dower added the comment: Yeah, that's all reasonable. But why wouldn't we go the other way and say "getting a user directory for a different user is not supported and all existing ways to do it are now deprecated"? I know you think that's not a relevant argument right now, but it is a related one, and any change to the status quo justifies bringing it back up. So now it's up, we want to decide on it before we make another change that could run counter to the overall direction. So I think, given the unlikelihood of us being able to properly fix the functionality, that we should deprecate getting another user's directory completely and, hence, not add new entry points to deprecated API. Convince me I'm wrong :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:25:43 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 26 Apr 2021 19:25:43 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619465143.12.0.673096546844.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: > The solution would be bisection -- apply half of the changes from apply-to-all, and see if you still get the errors. Etc. Getting the same error. These are the errors :- 0:12:14 load avg: 0.92 [115/426] test_distutils test test_distutils crashed -- Traceback (most recent call last): File "C:\github\cpython\lib\test\libregrtest\runtest.py", line 282, in _runtest_inner refleak = _runtest_inner2(ns, test_name) File "C:\github\cpython\lib\test\libregrtest\runtest.py", line 229, in _runtest_inner2 the_module = importlib.import_module(abstest) File "C:\github\cpython\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 881, in exec_module File "", line 241, in _call_with_frames_removed File "C:\github\cpython\lib\test\test_distutils.py", line 15, in import distutils.tests File "C:\github\cpython\lib\contextlib.py", line 140, in __exit__ next(self.gen) File "C:\github\cpython\lib\test\support\warnings_helper.py", line 179, in _filterwarnings raise AssertionError("filter (%r, %s) did not catch any warning" % AssertionError: filter ('The distutils package is deprecated', DeprecationWarning) did not catch any warning 0:19:05 load avg: 0.07 [212/426/1] test_logging --- Logging error --- Traceback (most recent call last): File "C:\github\cpython\lib\logging\handlers.py", line 74, in emit self.doRollover() File "C:\github\cpython\lib\logging\handlers.py", line 179, in doRollover self.rotate(self.baseFilename, dfn) File "C:\github\cpython\lib\logging\handlers.py", line 117, in rotate self.rotator(source, dest) File "C:\github\cpython\lib\test\test_logging.py", line 5222, in rotator os.rename(source, dest + ".rotated") FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\Users\\shrey\\AppData\\Local\\Temp\\test_logging-2-lh2g0lpt.log' -> 'C:\\Users\\shrey\\AppData\\Local\\Temp\\test_logging-2-lh2g0lpt.log.1.test.rotated' Call stack: File "C:\github\cpython\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\github\cpython\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\github\cpython\lib\test\__main__.py", line 2, in main() File "C:\github\cpython\lib\test\libregrtest\main.py", line 719, in main Regrtest().main(tests=tests, **kwargs) File "C:\github\cpython\lib\test\libregrtest\main.py", line 641, in main self._main(tests, kwargs) File "C:\github\cpython\lib\test\libregrtest\main.py", line 694, in _main self.run_tests() File "C:\github\cpython\lib\test\libregrtest\main.py", line 521, in run_tests self.run_tests_sequential() File "C:\github\cpython\lib\test\libregrtest\main.py", line 423, in run_tests_sequential result = runtest(self.ns, test_name) File "C:\github\cpython\lib\test\libregrtest\runtest.py", line 194, in runtest return _runtest(ns, test_name) File "C:\github\cpython\lib\test\libregrtest\runtest.py", line 154, in _runtest result = _runtest_inner(ns, test_name, File "C:\github\cpython\lib\test\libregrtest\runtest.py", line 282, in _runtest_inner refleak = _runtest_inner2(ns, test_name) File "C:\github\cpython\lib\test\libregrtest\runtest.py", line 246, in _runtest_inner2 test_runner() File "C:\github\cpython\lib\test\support\__init__.py", line 682, in inner return func(*args, **kwds) File "C:\github\cpython\lib\test\test_logging.py", line 5503, in test_main support.run_unittest(*tests) File "C:\github\cpython\lib\test\support\__init__.py", line 1082, in run_unittest _run_suite(suite) File "C:\github\cpython\lib\test\support\__init__.py", line 959, in _run_suite result = runner.run(suite) File "C:\github\cpython\lib\test\support\testresult.py", line 169, in run test(self.result) File "C:\github\cpython\lib\unittest\suite.py", line 84, in __call__ return self.run(*args, **kwds) File "C:\github\cpython\lib\unittest\suite.py", line 122, in run test(result) File "C:\github\cpython\lib\unittest\suite.py", line 84, in __call__ return self.run(*args, **kwds) File "C:\github\cpython\lib\unittest\suite.py", line 122, in run test(result) File "C:\github\cpython\lib\unittest\case.py", line 652, in __call__ return self.run(*args, **kwds) File "C:\github\cpython\lib\unittest\case.py", line 592, in run self._callTestMethod(testMethod) File "C:\github\cpython\lib\unittest\case.py", line 549, in _callTestMethod method() File "C:\github\cpython\lib\test\test_logging.py", line 5229, in test_namer_rotator_inheritance rh.emit(self.next_rec()) 0:26:02 load avg: 0.46 [250/426/1] test_pdb test test_pdb failed -- Traceback (most recent call last): File "C:\github\cpython\lib\doctest.py", line 2205, in runTest raise self.failureException(self.format_failure(new.getvalue())) AssertionError: Failed doctest test for test.test_pdb.test_pdb_issue_20766 File "C:\github\cpython\lib\test\test_pdb.py", line 1270, in test_pdb_issue_20766 ---------------------------------------------------------------------- File "C:\github\cpython\lib\test\test_pdb.py", line 1282, in test.test_pdb.test_pdb_issue_20766 Failed example: with PdbTestInput(['continue', 'continue']): test_function() Expected: > (6)test_function() -> print('pdb %d: %s' % (i, sess._previous_sigint_handler)) (Pdb) continue pdb 1: > (5)test_function() -> sess.set_trace(sys._getframe()) (Pdb) continue pdb 2: Got: > (6)test_function() -> print('pdb %d: %s' % (i, sess._previous_sigint_handler)) (Pdb) continue pdb 1: > > (5)test_function() -> sess.set_trace(sys._getframe()) (Pdb) continue pdb 2: > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:29:48 2021 From: report at bugs.python.org (Barney Gale) Date: Mon, 26 Apr 2021 19:29:48 +0000 Subject: [issue42998] pathlib.Path: add `username` argument to `home()` In-Reply-To: <1611287835.84.0.363729514225.issue42998@roundup.psfhosted.org> Message-ID: <1619465388.32.0.887412653996.issue42998@roundup.psfhosted.org> Barney Gale added the comment: Totally valid! I suppose it hinges on the relatively likelihood/unlikelihood of us being able to make `expanduser('~foo')` reliable in future. On this question I'm relieved to defer to the experts! @eryksun: penny for your thoughts? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:31:14 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 19:31:14 +0000 Subject: [issue43762] Add audit events for loading of sqlite3 extensions In-Reply-To: <1617792679.62.0.407303342016.issue43762@roundup.psfhosted.org> Message-ID: <1619465474.43.0.520239380559.issue43762@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Ah, yes thanks for the heads up! I'll update the PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:36:21 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 26 Apr 2021 19:36:21 +0000 Subject: [issue43938] Document that dataclasses.FrozenInstanceError derives from AttributeError In-Reply-To: <1619367934.66.0.118444398997.issue43938@roundup.psfhosted.org> Message-ID: <1619465781.36.0.550829350223.issue43938@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 081bfe4eb58e107de0a38e98c44a3253e4ed1240 by Miss Islington (bot) in branch '3.8': bpo-43938: improve dataclasses.FrozenInstanceError documentation (GH-25603) (GH-25636) https://github.com/python/cpython/commit/081bfe4eb58e107de0a38e98c44a3253e4ed1240 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:36:27 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 26 Apr 2021 19:36:27 +0000 Subject: [issue43938] Document that dataclasses.FrozenInstanceError derives from AttributeError In-Reply-To: <1619367934.66.0.118444398997.issue43938@roundup.psfhosted.org> Message-ID: <1619465787.32.0.410345255484.issue43938@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset c9c1dbd253d70665c1fd20e6341f9a08e21f37f4 by Miss Islington (bot) in branch '3.9': bpo-43938: improve dataclasses.FrozenInstanceError documentation (GH-25603) (GH-25635) https://github.com/python/cpython/commit/c9c1dbd253d70665c1fd20e6341f9a08e21f37f4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:37:02 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 26 Apr 2021 19:37:02 +0000 Subject: [issue43938] Document that dataclasses.FrozenInstanceError derives from AttributeError In-Reply-To: <1619367934.66.0.118444398997.issue43938@roundup.psfhosted.org> Message-ID: <1619465822.38.0.300783281714.issue43938@roundup.psfhosted.org> Eric V. Smith added the comment: Thanks for the patch! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:40:00 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Apr 2021 19:40:00 +0000 Subject: [issue42924] bytearray_repeat copies from ob_bytes instead of ob_start In-Reply-To: <1610537215.58.0.240765902048.issue42924@roundup.psfhosted.org> Message-ID: <1619466000.7.0.461528048908.issue42924@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset d0698c676ca1b7d34be4165a631bf4847583de76 by Miss Islington (bot) in branch '3.9': bpo-42924: Fix incorrect copy in bytearray_repeat (GH-24208) (#24211) https://github.com/python/cpython/commit/d0698c676ca1b7d34be4165a631bf4847583de76 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:40:47 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Apr 2021 19:40:47 +0000 Subject: [issue42924] bytearray_repeat copies from ob_bytes instead of ob_start In-Reply-To: <1610537215.58.0.240765902048.issue42924@roundup.psfhosted.org> Message-ID: <1619466047.16.0.685280920709.issue42924@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e1203e8001432a08b87b54867490beb19a694069 by Miss Islington (bot) in branch '3.8': bpo-42924: Fix incorrect copy in bytearray_repeat (GH-24208) (#24212) https://github.com/python/cpython/commit/e1203e8001432a08b87b54867490beb19a694069 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:41:18 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Apr 2021 19:41:18 +0000 Subject: [issue42924] bytearray_repeat copies from ob_bytes instead of ob_start In-Reply-To: <1610537215.58.0.240765902048.issue42924@roundup.psfhosted.org> Message-ID: <1619466078.05.0.69513843937.issue42924@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:42:48 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Apr 2021 19:42:48 +0000 Subject: [issue34463] Discrepancy between traceback.print_exception and sys.__excepthook__ In-Reply-To: <1534964466.61.0.56676864532.issue34463@psf.upfronthosting.co.za> Message-ID: <1619466168.5.0.700531305461.issue34463@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 727bed675f1a47d12492efba0ca118707502d988 by Irit Katriel in branch '3.8': [3.8] bpo-34463: Make python tracebacks identical to C tracebacks for (#23899) https://github.com/python/cpython/commit/727bed675f1a47d12492efba0ca118707502d988 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:45:52 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Apr 2021 19:45:52 +0000 Subject: [issue17305] IDNA2008 encoding is missing In-Reply-To: <1361928766.42.0.728949411958.issue17305@psf.upfronthosting.co.za> Message-ID: <1619466352.55.0.551558072385.issue17305@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 2760a6711b0f510afbd09b19949bee786e098af9 by Miss Islington (bot) in branch '3.8': bpo-17305: Link to the third-party idna package. (GH-25208) (#25211) https://github.com/python/cpython/commit/2760a6711b0f510afbd09b19949bee786e098af9 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:46:17 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Apr 2021 19:46:17 +0000 Subject: [issue41661] os.path.relpath does not document ValueError on Windows with different drives In-Reply-To: <1598681705.55.0.359436315051.issue41661@roundup.psfhosted.org> Message-ID: <1619466377.95.0.0924810990899.issue41661@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b570feaa9c6039b9d89cdf854a5fb388872eb38e by Miss Islington (bot) in branch '3.8': bpo-41661: Document os.path.relpath() exception on Windows with different drives (GH-25346) (#25367) https://github.com/python/cpython/commit/b570feaa9c6039b9d89cdf854a5fb388872eb38e ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:54:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Apr 2021 19:54:33 +0000 Subject: [issue40432] Pegen regenerate project for Windows not working In-Reply-To: <1588127830.15.0.595745305392.issue40432@roundup.psfhosted.org> Message-ID: <1619466873.6.0.273705920612.issue40432@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset f65f3f0e99b27e0a4ea6bb7e30c5bdb5832a76c6 by Miss Islington (bot) in branch '3.9': bpo-40432: Use python 3.8 or higher to compile CPython on Windows (GH-25389) (#25637) https://github.com/python/cpython/commit/f65f3f0e99b27e0a4ea6bb7e30c5bdb5832a76c6 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:56:19 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Apr 2021 19:56:19 +0000 Subject: [issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32 In-Reply-To: <1477983724.8.0.857875109595.issue28577@psf.upfronthosting.co.za> Message-ID: <1619466979.16.0.0753283554541.issue28577@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 15:57:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Apr 2021 19:57:07 +0000 Subject: [issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32 In-Reply-To: <1477983724.8.0.857875109595.issue28577@psf.upfronthosting.co.za> Message-ID: <1619467027.88.0.478310240671.issue28577@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 10ad7eb2ef61a2ba99341c804c8c960e4f284621 by Pete Wicken in branch '3.8': [3.8] bpo-28577: Special case added to IP v4 and v6 hosts for /32 and /128 networks (GH-18757) (#25536) https://github.com/python/cpython/commit/10ad7eb2ef61a2ba99341c804c8c960e4f284621 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 16:30:19 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 20:30:19 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619469019.68.0.32612211283.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Christian: > Can I get rid of the function with "{Py_tp_new, NULL}" [...] Unfortunately not. The workaround in 993e88cf08994f7c1e0f9f62fda4ed32634ee2ad does the trick though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 16:59:45 2021 From: report at bugs.python.org (Genaro Camele) Date: Mon, 26 Apr 2021 20:59:45 +0000 Subject: [issue43944] Processes in Python 3.9 exiting with code 1 when It's created inside a ThreadPoolExecutor Message-ID: <1619470785.38.0.461987263008.issue43944@roundup.psfhosted.org> New submission from Genaro Camele : I've a piece of code that submits a task to a [ThreadPoolExecutor][1] which starts a [Process][2]. I've realised that in Python 3.8 that Process finished with exit code `0`. But I've updated Python to the 3.9 version and this started to finishing with exit code `1`! Even when the Process executes an empty task. Here's a minimal example: ```python from multiprocessing import Process from concurrent.futures import ThreadPoolExecutor def some_task(): pass def execute_error(): p = Process(target=some_task) p.start() p.join() print(p.exitcode) # This is always 1 on a ThreadPoolExecutor!!! executor = ThreadPoolExecutor(max_workers=4) executor.submit(execute_error) # execute_error() # IMPORTANT: this works correctly (exit 0) ``` My versions: ``` Ubuntu 21.04 Python 3.9.4 ``` **Note** that if `__execute_error` is called outside the ThreadPoolExecutor it works correctly. Running on Python 3.8.6 exitcode = 0 too. [1]: https://docs.python.org/3/library/concurrent.futures.html#threadpoolexecutor [2]: https://docs.python.org/3.9/library/multiprocessing.html#multiprocessing.Process ---------- messages: 391985 nosy: Genarito priority: normal severity: normal status: open title: Processes in Python 3.9 exiting with code 1 when It's created inside a ThreadPoolExecutor type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 17:09:05 2021 From: report at bugs.python.org (Shatabarto Bhattacharya) Date: Mon, 26 Apr 2021 21:09:05 +0000 Subject: [issue25567] shlex.quote doesn't work on bytestrings In-Reply-To: <1446814343.82.0.823951892686.issue25567@psf.upfronthosting.co.za> Message-ID: <1619471345.33.0.476422235053.issue25567@roundup.psfhosted.org> Shatabarto Bhattacharya added the comment: Looks like this issue has been solved? What is there to be worked on? ---------- nosy: +hrik2001 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 17:12:51 2021 From: report at bugs.python.org (Shatabarto Bhattacharya) Date: Mon, 26 Apr 2021 21:12:51 +0000 Subject: [issue42095] plistlib: Add tests that compare with plutil(1) In-Reply-To: <1603178661.31.0.803001342032.issue42095@roundup.psfhosted.org> Message-ID: <1619471571.21.0.079140559762.issue42095@roundup.psfhosted.org> Change by Shatabarto Bhattacharya : ---------- nosy: +hrik2001 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 17:17:40 2021 From: report at bugs.python.org (Nathaniel Smith) Date: Mon, 26 Apr 2021 21:17:40 +0000 Subject: [issue36921] Deprecate yield from and @coroutine in asyncio In-Reply-To: <1558018338.65.0.625435116263.issue36921@roundup.psfhosted.org> Message-ID: <1619471860.0.0.453096709768.issue36921@roundup.psfhosted.org> Nathaniel Smith added the comment: @types.coroutine is still useful as a tool for writing "foundation" coroutines that directly interact with the coroutine runner, e.g.: https://github.com/python-trio/trio/blob/94562c54d241859eb05ed85c88fd6073d6752ff6/trio/_core/_traps.py#L12-L21 https://github.com/dabeaz/curio/blob/27ccf4d130dd8c048e28bd15a22015bce3f55d53/curio/traps.py#L28-L36 So I think it's only @asyncio.coroutine that should be deprecated. ---------- nosy: +njs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 17:16:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Apr 2021 21:16:18 +0000 Subject: [issue40608] PY3.8 GC segfault (Py_TRASHCAN_SAFE_BEGIN/END are not backwards compatible) In-Reply-To: <1589306849.27.0.146369076662.issue40608@roundup.psfhosted.org> Message-ID: <1619471778.34.0.253861830093.issue40608@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 17:21:56 2021 From: report at bugs.python.org (Larry Hastings) Date: Mon, 26 Apr 2021 21:21:56 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619472116.39.0.951193198135.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: > I'm not a big user of the inspect module, but I always thought that > its use was so that you could look at a function (or other object) > *produced by a 3rd party* and learn something about it. That's interesting! I always thought its main use was the opposite--it was so third parties could introspect *your* functions. Like, Pydantic examines your function's signature so it can wrap it with runtime validation. (Though in this specific case, I believe Pydantic examines __annotations__ directly.) I also dimly recall a Python library that built COM bindings around your code, but I can't find it right now. I can't remember ever writing application code that used inspect.signature() to inspect library functions--but I've certainly written library functions that used inspect.signature() to inspect application code. > Asking for the signature is one such operation, and I'd be rather > upset if I couldn't inspect the annotation if that 3rd party happened > to have added a bad string annotation. Do you think that's likely? I'd be quite surprised if it was common for third party libraries to have string annotations--either manual or using automatic stringizing--in the first place. I thought string annotations were really only used as part of type hints, and the type-hinted code was all internal code bases from large organizations, not third-party libraries. But I concede I know little about it. Following on to that, the annotations would have to be bad, which means again either someone made a typo or it was done deliberately. The latter reason would be simply obnoxious if done by a third-party library--third-party libraries should not have the circular imports problem used to justifiy such practices. I suppose third-party libraries are just as error-prone as anybody else, so if they were manually stringizing their annotations, it could happen there. Which I agree would be annoying, just like any bug in a third-party library. But I wouldn't agree this specific error is so special that we need to suppress it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 17:43:27 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 26 Apr 2021 21:43:27 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619473407.43.0.867722510758.issue43817@roundup.psfhosted.org> Jelle Zijlstra added the comment: I agree with Guido that it's better to design inspect.signature to not throw an error for annotations that don't eval() cleanly. I use inspect.signature for getting information about callables (third-party and first-party) in my type checker: https://github.com/quora/pyanalyze/blob/master/pyanalyze/arg_spec.py#L436. In that context, I'd much rather get string annotations that I can process myself later than get an exception if the annotations aren't valid at runtime. In the former case I can still get useful information out of the signature even if I don't know how to process some annotations. For example, I'll still know what parameters exist even if I don't know what their types are. In the latter case, I don't get any useful signature data. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 18:04:10 2021 From: report at bugs.python.org (Alex Vandiver) Date: Mon, 26 Apr 2021 22:04:10 +0000 Subject: [issue32958] socket module calls with long host names can fail with idna codec error In-Reply-To: <1519674755.43.0.467229070634.issue32958@psf.upfronthosting.co.za> Message-ID: <1619474650.28.0.350839739339.issue32958@roundup.psfhosted.org> Alex Vandiver added the comment: It seems reasonable to fail on hostnames that are too long -- but it feels like the weirdness is that it is categorized as a UnicodeError, and not as, say, a ValueError. Would a re-categorization as ValueError seem like a reasonable adjustment here? ---------- nosy: +alexmv _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 18:09:18 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 26 Apr 2021 22:09:18 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619474958.85.0.863269117886.issue43817@roundup.psfhosted.org> Guido van Rossum added the comment: There may be a (deliberate? :-) misunderstanding. When I wrote about "you" inspecting code by a "3rd party" I meant that as a symmetric relationship -- the "you" could be a library and from the library's POV the "3rd party" could be you (or me). Either way, given that inspect.signature() collects many disparate aspects of the parameters of a function, it seems a bad design for it to raise an exception if any one of those aspects of any one of those parameters doesn't match an expectation (other than an expectation enforced by the parser+compiler themselves, like the constraint that positional-only parameters must precede other types of parameters). I looked at the code, and there's a special value that Parameter().annotation is set if there's no annotation (Parameter.empty). Maybe you can follow that model and add another special value for errors during evaluation? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 18:12:19 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 22:12:19 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619475139.5.0.373924389246.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Pablo, I've made a patch for most of these (I've left out Christian's modules). I've only added a couple of tests for now. Do you want all in one PR? $ git diff main --stat Lib/test/test_array.py | 4 ++++ Lib/test/test_unicodedata.py | 4 ++++ Modules/_dbmmodule.c | 1 + Modules/_functoolsmodule.c | 2 ++ Modules/_gdbmmodule.c | 1 + Modules/_sre.c | 5 +++++ Modules/_threadmodule.c | 2 ++ Modules/_winapi.c | 1 + Modules/arraymodule.c | 1 + Modules/cjkcodecs/multibytecodec.c | 1 + Modules/posixmodule.c | 2 ++ Modules/pyexpat.c | 1 + Modules/unicodedata.c | 1 + Modules/zlibmodule.c | 2 ++ 14 files changed, 28 insertions(+) I don't know why I included the sqlite3 and select types in msg391924; they are not affected by this issue. Somebody should double check that everything's covered. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 18:13:03 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 22:13:03 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619475183.05.0.309786507643.issue43916@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch Added file: https://bugs.python.org/file49989/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 18:21:09 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 26 Apr 2021 22:21:09 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619465143.12.0.673096546844.issue43908@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: So keep cutting in half until the error disappears? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 18:27:33 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 22:27:33 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619476053.41.0.0483497597663.issue43492@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch pull_requests: +24333 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25640 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 18:28:31 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 22:28:31 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619476111.1.0.335231749607.issue43492@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24334 pull_request: https://github.com/python/cpython/pull/25641 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 18:35:51 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Mon, 26 Apr 2021 22:35:51 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619476551.13.0.528611932279.issue43492@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Steve & Ned: It would be nice if we could merge the PR's just before the weekend, so we get up-to-date installers for the beta. FYI, the SQLite forum has been quiet, and the fossil branch has not moved. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 18:45:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Apr 2021 22:45:55 +0000 Subject: [issue27590] tarfile module next() method hides exceptions In-Reply-To: <1469200266.16.0.443973453456.issue27590@psf.upfronthosting.co.za> Message-ID: <1619477155.54.0.603328261667.issue27590@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 19:04:32 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 26 Apr 2021 23:04:32 +0000 Subject: [issue43945] [Enum] standardize format() behavior Message-ID: <1619478272.35.0.783754187217.issue43945@roundup.psfhosted.org> New submission from Ethan Furman : Currently, an enum with a mixed-in data type, such as IntEnum, will use that data type's `__format__` -- unless the user provides their own `__str__`, in which case the `str()` of the enum member will be used in the `format()` call. This behavior will be deprecated in 3.10, and in 3.12 the default `__format__` will use the default `__str__`, which is the standard behavior for Python objects For those that were relying on, for example, class Color(IntEnum): RED = 1 f'{Color.RED}' # -> '2' They will need to add ":d" to ensure the integer output: f'{Color.RED:d}' This change does work now. ---------- assignee: ethan.furman messages: 391995 nosy: ethan.furman priority: normal severity: normal stage: needs patch status: open title: [Enum] standardize format() behavior type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 19:08:53 2021 From: report at bugs.python.org (Jan Konopka) Date: Mon, 26 Apr 2021 23:08:53 +0000 Subject: [issue39812] Avoid daemon threads in concurrent.futures In-Reply-To: <1583071410.96.0.599538732629.issue39812@roundup.psfhosted.org> Message-ID: <1619478533.94.0.0540746427519.issue39812@roundup.psfhosted.org> Jan Konopka added the comment: Hi all! While browsing StackOverflow I came across this question: https://stackoverflow.com/q/67273533/2111778 The user created a ThreadPoolExecutor which started a Process using multiprocessing. The Process produces an exitcode of 0 in Python 3.8 but an exitcode of 1 in Python 3.9. I'm really not familiar with Python internals, but through monkey-patching Lib/concurrent/futures/thread.py I was able to pin this regression down to the change of > atexit.register(_python_exit) to > threading._register_atexit(_python_exit) which led me to this issue! (: I know that multiprocessing in Python is a little funky, since I worked with it on my Master's thesis. I think the entire process gets forked (i.e. copied), so the child process also gets a copy of the active ThreadPoolExecutor, which I think causes some sort of problem there. Note that this behavior seems to differ based on OS. I can confirm the issue on Linux with the 'fork' method and disconfirm it with the 'spawn' and 'forkserver' methods. https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods Could someone with more insight kindly take a look at this? Greetings Jan <3 ---------- nosy: +janfrederik.konopka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 19:16:49 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 26 Apr 2021 23:16:49 +0000 Subject: [issue43762] Add audit events for loading of sqlite3 extensions In-Reply-To: <1617792679.62.0.407303342016.issue43762@roundup.psfhosted.org> Message-ID: <1619479009.78.0.760922969046.issue43762@roundup.psfhosted.org> Steve Dower added the comment: New changeset 7244c0060dc3ef909f34b0791c3e7490b0340d5e by Erlend Egeberg Aasland in branch 'master': bpo-43762: Add audit events for loading of sqlite3 extensions (GH-25246) https://github.com/python/cpython/commit/7244c0060dc3ef909f34b0791c3e7490b0340d5e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 19:17:04 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 26 Apr 2021 23:17:04 +0000 Subject: [issue43762] Add audit events for loading of sqlite3 extensions In-Reply-To: <1617792679.62.0.407303342016.issue43762@roundup.psfhosted.org> Message-ID: <1619479024.81.0.10248496213.issue43762@roundup.psfhosted.org> Steve Dower added the comment: Thanks for the PR! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 19:17:22 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 26 Apr 2021 23:17:22 +0000 Subject: [issue40432] Pegen regenerate project for Windows not working In-Reply-To: <1588127830.15.0.595745305392.issue40432@roundup.psfhosted.org> Message-ID: <1619479042.91.0.735898966303.issue40432@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 19:32:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 26 Apr 2021 23:32:56 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619479976.79.0.369953158978.issue43916@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Pablo, I've made a patch for most of these (I've left out Christian's modules). I've only added a couple of tests for now. Do you want all in one PR? Yes, please. The second most important part here is also adding regression tests so this doesn't happen. These tests should also be added when new types are converted in the future. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 20:00:04 2021 From: report at bugs.python.org (Larry Hastings) Date: Tue, 27 Apr 2021 00:00:04 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619481604.08.0.48483976312.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: > I use inspect.signature for getting information about callables > (third-party and first-party) in my type checker: > https://github.com/quora/pyanalyze/blob/master/pyanalyze/arg_spec.py#L436. > In that context, I'd much rather get string annotations that I can > process myself later than get an exception if the annotations aren't > valid at runtime. This use case is what the eval_str parameter is for. Since you're dealing specifically with type hints (as opposed to annotations generally), you don't really care whether you get strings or valid objects--you need to handle both. So in Python 3.10+ you can--and should!--call inspect.get_annotations() and inspect.signature() with eval_str=False. If you do that you won't have any trouble. Since I keep getting new proposals on how to suppress eval() errors in inspect.signature(), I think I need to zoom out and talk about why I don't want to do it at all. Forgive me, but this is long--I'm gonna start from first principles. Changing inspect.signature() so it calls eval() on annotations is a change in 3.10. And, due to the fact that it's possible (how likely? nobody seems to know) that there are malformed string annotations lurking in user code, this has the possibility of being a breaking change. In order to handle this correctly, I think you need to start with a more fundamental question: are *stringized* annotations supposed to be a hidden implementation detail, and Python should present annotations as real values whether or not they were internally stringized? Or: if the user adds "from __future__ import annotation" to their module, is this them saying they explicitly want their annotations as strings and they should always see them as strings? (Again, this is specifically when the *language* turns your annotations into strings with the "from __future" import. I think if the user enters annotations as strings, the language should preserve those annotations as strings, and that includes the library.) It seems to me that the first answer is right. PEP 563 talks a lot about "here's how you turn your stringized annotations back into objects". In particular, it recommends calling typing.get_type_hints(), which AFAIK has always called eval() to turn string annotations back into objects. It's worth noting here that, in both 3.9 and in the current Python trunk, typing.get_type_hints() doesn't catch exceptions. Also, during the development of Python 3.10, during a time when stringized annotations had become the default behavior, inspect.signature() was changed to call typing.get_type_hints(). Presumably to have typing.get_type_hints() handle the tricky work of calling eval(). (I had problems with this specific approach. "annotations" and "type hints" aren't the same thing, so having inspect.signature() e.g. wrap some annotations with Optional, and change None to NoneType, was always a mistake. Also, typing.get_type_hints() was changed at this time to catch "Exception" and suppress *all* errors raised during the eval() call. Happily both these changes have since been backed out.) >From that perspective, *not* having inspect.signature() turn stringized annotations back into strings from the very beginning was a bug. And changing inspect.signature() in Python 3.10 so it calls eval() on string annotations is a bug fix. So far folks seem to agree--the pushback I'm getting is regarding details of my approach, not on the idea of doing it at all. Now we hit our second question. It's possible that inspect.signature() can't eval() every stringized annotation back into a Python value, due to a malformed annotation expression that wasn't caught at compile-time. This means inspect.signature() calls that worked in 3.9 could potentially start failing in 3.10. How should we address it? >From the perspective of "string annotations are a hidden implementation detail, and users want to see real objects", I think the fact that it wasn't already failing was also a bug. If your annotations are malformed, surely you want to know about it. If you have a malformed annotation, and you don't turn on stringized annotations, you get an exception when the annotation expression is evaluated at module import time, in any Python version up to an including 3.10. Stringized annotations delays this evaluation to when the annotations are examined--which means the exception for a malformed expression gets delayed too. Which in turn means, from my perspective, the fact that inspect.signature() didn't raise on malformed annotation expressions was a bug. I just don't agree that silently changing the failed eval()'d string annotation into something else is the right approach. There have been a bunch of proposals along these lines, and while I appreciate the creative contributions and the attempts at problem-solving, I haven't liked any of them. But it's not that I find that particular spelling awful, and if we could work together we'll find a spelling that I like. I don't like the basic approach of silently suppressing these errors--I think inspect.signature() raising an exception is *already* the right behavior. Again I'll quote from the Zen: "errors should never pass silently unless explicitly silenced", and, "special cases aren't special enough to break the rules". (For the record, Guido's new proposal of "add a field to the Parameter object indicating the error" is the best proposal yet. I don't want to do this at all, but if somehow it became simply unavoidable, ATM that seems like the best approach to take.) I must admit I'm a little puzzled by the pushback I'm getting. I thought the pushback would be "having inspect.signature() call eval() at all is a breaking change, it's too late to change it". But the pushback has been all about coddling users with malformed annotations, by making the errors pass silently. We're talking about user code that has errors, and these errors have been passing silently, potentially for years. I regret the inconvenience that 3.10 will finally start raising an exception for these errors--and yet it still seems like an obviously better design than silently suppressing these errors. (I also think that catching errors quickly goes down a rabbit hole. Should inspect.signature() also suppress MemoryError? RecursionError? ImportError?) Finally, there's an extant use case for code bases to deliberately provide malformed, un-evaluatable annotations. This is due to structural problems endemic with large code bases (circular dependencies / circular imports). Again I think the Zen's guidance here is right, and I think it's reasonable to expect code bases that deliberately break the rules to work around this change. I realize that this bug fix in the standard library will inconvenience them--but that's why I made sure to have something like eval_str=False. I have empathy for the bind these users find themselves in, and I want to ensure they have the tools they need to succeed. But I think they need to work around bug fixes in the library, rather than preserve the old bug they were implicitly relying on. And there's one more loose thread that I need to tie off here: what about users with objects with manually-entered string annotations that are deliberately not valid Python, who examine these objects with inspect.signature()? I regret that this is collateral damage. "from __future__ import annotations" doesn't give us any way to distinguish between "this annotation was automatically stringized by Python" and "this annotation is a string explicitly entered by the user". My heuristic with the default behavior of inspect.get_annotations() and inspect.signature() (see eval_str=ONLY_IF_STRINGIZED) is an attempt to accommodate such usage. But this heuristic won't do the right thing if the user manually stringizes all the annotations for an object. In this case, this is legitimately permissible code, which will start failing in Python 3.10. I apologize in advance to such users. But my guess is this is exceedingly rare, and again such users can switch to eval_str=False at which point they'll be back in business. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 20:03:29 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 27 Apr 2021 00:03:29 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619481809.14.0.989530428528.issue43817@roundup.psfhosted.org> Eric V. Smith added the comment: I'd like to see the default behavior be to raise an exception if eval fails on any annotation. I think it's reasonable to provide a way to find out which specific keys have problems, but I don't think that should be the default. Wouldn't it be good enough to have a flag which says "just return me a dict which only has keys for items which don't contain errors"? Let's call it silence_errors for discussion sake. You could then figure out which ones contain errors by: getattr(obj, "__annotations__", {}).keys() - get_annotations(obj, silence_errors=True).keys() That is, silence_errors works on a per-key basis, not the call to get_annotations() as a whole. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 20:05:24 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 27 Apr 2021 00:05:24 +0000 Subject: [issue41639] Unpickling derived class of list does not call __init__() In-Reply-To: <1598424659.93.0.553984904692.issue41639@roundup.psfhosted.org> Message-ID: <1619481924.94.0.986603339398.issue41639@roundup.psfhosted.org> Gregory P. Smith added the comment: this looks resolved? ---------- nosy: +gregory.p.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 20:09:22 2021 From: report at bugs.python.org (Larry Hastings) Date: Tue, 27 Apr 2021 00:09:22 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619482162.92.0.714387004874.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: > There may be a (deliberate? :-) misunderstanding. When I wrote about > "you" inspecting code by a "3rd party" I meant that as a symmetric > relationship -- the "you" could be a library and from the library's > POV the "3rd party" could be you (or me). I wasn't deliberately misunderstanding you. And I understand what you're saying. But the relationship isn't perfectly symmetric from a pragmatic perspective. Let's say I write some code, and I also call into a third-party library. I've annotated one of my objects, and the third-party library calls inspect.signature() on my object. If my annotations are strings, and they aren't eval()uatable, then boom! it raises an exception, showing me a bug in my code, and I can fix it straight away. On the other hand: let's say I write some code, and I call into a third-party library. If the third-party library has an annotated object, and I call inspect.signature() on that object, and the annotations happen to be strings that aren't evaluatable, boom! it's showing me a bug in the third-party library. Now I have a much larger headache: I have to notify this third-party vendor, convince them to fix the bug, wait for a new release, etc etc etc. (And in the meantime maybe I add eval_str=False to my inspect.signature() call.) It's my assumption that the former scenario is far more likely than the latter, which is good news because it's way easier to deal with. The latter scenario is plausible, and much more inconvenient, but I think it's far less likely. If I'm wrong, and there are lots of third-party libraries with stringized annotations that could have errors lurking in them, I'd very much like to know that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 20:10:52 2021 From: report at bugs.python.org (Larry Hastings) Date: Tue, 27 Apr 2021 00:10:52 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619482252.36.0.351366126055.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: I like Eric's suggestion best of all. I'd be willing to add a "silence errors on a case-by-case basis" flag to inspect.signature(). I imagine that would add a new field to the Parameter object (as Guido suggested) indicating which objects failed. Would that be acceptable all around? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 20:12:01 2021 From: report at bugs.python.org (Larry Hastings) Date: Tue, 27 Apr 2021 00:12:01 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619482321.39.0.728747440649.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: Just to be clear: I would *not* want this new mode to be the *default* behavior. So far I think ONLY_IF_STRINGIZED is the best compromise for default behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 20:22:20 2021 From: report at bugs.python.org (Larry Hastings) Date: Tue, 27 Apr 2021 00:22:20 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619482940.7.0.727146507953.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: One final thought on that idea. Part of the reason why I didn't go back to the drawing board and re-think the API was because I thought folks were pushing back on the idea of *default* behavior possibly raising exceptions. If I misread it, and the pushback was "we want real Python values when we can get them, and strings when we can't, and it's acceptable if we have to explicitly request that behavior from inspect.signature() and inspect.get_annotations()", then hot diggity!, maybe we've finally found a compromise we can all agree on. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 20:22:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Apr 2021 00:22:53 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1619482973.49.0.45545065416.issue38530@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 284c52da092438522949d6f96d8c1f9ff37f9f00 by Dennis Sweeney in branch 'master': bpo-38530: Require 50% similarity in NameError and AttributeError suggestions (GH-25584) https://github.com/python/cpython/commit/284c52da092438522949d6f96d8c1f9ff37f9f00 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 20:33:02 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 27 Apr 2021 00:33:02 +0000 Subject: [issue43946] unpickling a subclass of list fails when it implements its own extend method Message-ID: <1619483582.32.0.0403635127136.issue43946@roundup.psfhosted.org> New submission from Gregory P. Smith : The changes from https://bugs.python.org/issue29368 are causing a subclass of list trouble: ``` class FieldList(list): ... def extend(...): ... ``` FieldList has its own extend and append methods that implement additional checks. As it is a list subclass, the new `PyList_CheckExact()` from the afformentioned issue's https://github.com/python/cpython/commit/f89fdc29937139b55dd68587759cadb8468d0190 where it used to be a `PyList_Check()` in 3.6 and earlier is causing the unpickling code to call the instance `.extend()` method instead of internally using `PyList_SetSlice()` at the C level. Calling .extend() naturally fails at this point as __setstate__ hasn't yet been called so the FieldList instance is uninitialized. Here's the code in question https://github.com/google/protorpc/blob/master/protorpc/messages.py#L1126 It used it work. 3.7 broke it. What was unpicklable is now not. To work around this logic would be needed in the extend (and append) methods to check if they're being called on an uninitialized instance. That seems unreasonable. _[credit to my colleague Richard L. for the diagnosis]_ ---------- components: Extension Modules, Library (Lib) keywords: 3.7regression messages: 392008 nosy: gregory.p.smith, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: unpickling a subclass of list fails when it implements its own extend method type: behavior versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 20:35:11 2021 From: report at bugs.python.org (Saiyang Gou) Date: Tue, 27 Apr 2021 00:35:11 +0000 Subject: [issue42128] Structural Pattern Matching (PEP 634) In-Reply-To: <1603466540.96.0.7677855399.issue42128@roundup.psfhosted.org> Message-ID: <1619483711.04.0.107045051371.issue42128@roundup.psfhosted.org> Change by Saiyang Gou : ---------- nosy: +gousaiyang nosy_count: 12.0 -> 13.0 pull_requests: +24335 pull_request: https://github.com/python/cpython/pull/25642 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 20:38:24 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 27 Apr 2021 00:38:24 +0000 Subject: [issue29368] Optimize unpickling list-like objects: use extend() instead of append() In-Reply-To: <1485338150.33.0.560817507263.issue29368@psf.upfronthosting.co.za> Message-ID: <1619483904.03.0.150405776721.issue29368@roundup.psfhosted.org> Gregory P. Smith added the comment: The PyList_Check -> PyList_CheckExact change led to bugs where subclasses of list that override extend can no longer be unpickled. https://bugs.python.org/issue43946 ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 20:38:13 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 27 Apr 2021 00:38:13 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1619482321.39.0.728747440649.issue43817@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: I want to be as short as possible. The user may have annotations because they are using mypy. They may be using a library that calls inspect.signature() on some of their functions to retrieve the parameter names conveniently. All this has worked for years, the library never caring about annotations, the user probably adding a few more annotations as they get more value out of mypy. Now one day, using Python 3.9, the user adds "from __future__ import annotations" to their module, and removes the quotes from annotations containing forward references or things imported under "if TYPE_CHECKING". This works in 3.9. But you want to break it in 3.10. This is what I object to. I realize this also broke in the 3.10 alphas where PEP 563 was the default. But that was rolled back for a reason! And we changed inspect.signature() to call get_type_hints() (i.e. call eval() and break if it fails) because it wasn't just affecting users PEP 563, it was affecting everyone who *was* expecting a type object rather than a string in Parameter.annotation. That bug also exists in 3.9, but only for users of PEP 563 (most of whom didn't care about runtime inspection of annotations, so it didn't matter to them that Parameter.annotation got a string. You can draw the matrix of use cases and Python versions yourself. Given that we're not going whole-hog on PEP 563 in 3.10, I think we should either leave sleeping dogs lie, and continue to return a string as Parameter.annotation if PEP 563 was in effect, or else we should at least make inspect.signature() not fail if the string fails to evaluate. Note that the version of inspect.signature() that I remember being checked into 3.10 did catch exceptions from get_type_hints() and used the original __annotations__ dict (i.e. with all strings) if there was an eval error (or any other error, IIRC). Please go look for it if you don't believe me (it would have been rolled back last week in the Great Rollback). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 20:39:05 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 27 Apr 2021 00:39:05 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1619482940.7.0.727146507953.issue43817@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: No, I want the *default* not to raise when eval() fails. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 20:56:37 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 27 Apr 2021 00:56:37 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619484997.78.0.0977494881877.issue43817@roundup.psfhosted.org> Inada Naoki added the comment: > Just to be clear: I would *not* want this new mode to be the *default* behavior. So far I think ONLY_IF_STRINGIZED is the best compromise for default behavior. I don't think ONLY_IF_STRINGIZED is the best compromise. I don't think it solve any issue. ``` if False: from typing import List def f1() -> 'List[str]': pass def f2(a:int) -> 'List[str]': pass ``` In this example, both of help(f1) and help(f2) must show signature, not raise an error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 21:30:32 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 27 Apr 2021 01:30:32 +0000 Subject: [issue3609] does parse_header really belong in CGI module? In-Reply-To: <1219193477.24.0.768590998992.issue3609@psf.upfronthosting.co.za> Message-ID: <1619487032.32.0.0704344326047.issue3609@roundup.psfhosted.org> Senthil Kumaran added the comment: Closing this age old bug in favor of fixing it as part of issue23498. ---------- resolution: -> wont fix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 21:30:40 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 27 Apr 2021 01:30:40 +0000 Subject: [issue23498] Expose http.cookiejar.split_header_words() In-Reply-To: <1424566690.92.0.444204836552.issue23498@psf.upfronthosting.co.za> Message-ID: <1619487040.92.0.167743711283.issue23498@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- assignee: -> orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 21:31:09 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 27 Apr 2021 01:31:09 +0000 Subject: [issue3609] does parse_header really belong in CGI module? In-Reply-To: <1219193477.24.0.768590998992.issue3609@psf.upfronthosting.co.za> Message-ID: <1619487069.96.0.0244907455672.issue3609@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- stage: needs patch -> resolved status: languishing -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 21:33:23 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 27 Apr 2021 01:33:23 +0000 Subject: [issue12966] cookielib.LWPCookieJar breaks on cookie values with a newline In-Reply-To: <1315854880.61.0.95908383563.issue12966@psf.upfronthosting.co.za> Message-ID: <1619487203.65.0.65187196383.issue12966@roundup.psfhosted.org> Senthil Kumaran added the comment: This bug was reported in 2.5 and we don't have a test case attached in this report. Given many changes and age of the bug, I am closing this. A specific report against the latest code will help us to fix this bug. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 21:38:19 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 27 Apr 2021 01:38:19 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1619487499.27.0.046632019283.issue37751@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +24336 pull_request: https://github.com/python/cpython/pull/25643 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 22:12:55 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 27 Apr 2021 02:12:55 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1619489575.71.0.384947430461.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +24337 pull_request: https://github.com/python/cpython/pull/25644 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 22:13:48 2021 From: report at bugs.python.org (Dan Snider) Date: Tue, 27 Apr 2021 02:13:48 +0000 Subject: [issue43947] lambdas stored with assignment expressions are unoptimized Message-ID: <1619489628.98.0.0361601429976.issue43947@roundup.psfhosted.org> New submission from Dan Snider : >>> import dis >>> @dis.dis ... def funcdef(k): return k in {None} ... 2 0 LOAD_FAST 0 (k) 2 LOAD_CONST 1 (frozenset({None})) 4 COMPARE_OP 6 (in) 6 RETURN_VALUE >>> regass = lambda k: k in {None} >>> dis.dis(regass) 1 0 LOAD_FAST 0 (k) 2 LOAD_CONST 1 (frozenset({None})) 4 COMPARE_OP 6 (in) 6 RETURN_VALUE >>> dis.dis(walrus:=lambda k: k in {None}) 1 0 LOAD_FAST 0 (k) 2 LOAD_CONST 0 (None) 4 BUILD_SET 1 6 COMPARE_OP 6 (in) 8 RETURN_VALUE As the third example demonstrates, the code for the anonymous function assigned to walrus by an assignment expression isn't receiving the relatively recent frozenset optimization. ---------- messages: 392015 nosy: bup priority: normal severity: normal status: open title: lambdas stored with assignment expressions are unoptimized type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 22:18:49 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Tue, 27 Apr 2021 02:18:49 +0000 Subject: [issue32891] Add 'Integer' as synonym for 'Integral' in numbers module. In-Reply-To: <1519191292.27.0.467229070634.issue32891@psf.upfronthosting.co.za> Message-ID: <1619489929.63.0.28131514763.issue32891@roundup.psfhosted.org> Sergey B Kirpichev added the comment: > so I'll simply record my -1 for the proposed change and move on Mark, thank you for some PR review, anyway. I hope, we still can count Guido +1 on the change. > If you want to push this change through, the way forward would likely be to find a core developer (maybe Terry?) who's willing to champion the change (and review the PR, of course). I'll try. I've asked Terry for review. For the record, I've tried to find why it was decided to live with Integral class, instead of Integer. Unfortunately, it seems there was no public discussion on this. This one with Integer: https://mail.python.org/pipermail/python-3000/2007-May/007711.html and this without: https://mail.python.org/pipermail/python-3000/2007-August/009068.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 22:49:15 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 27 Apr 2021 02:49:15 +0000 Subject: [issue32891] Add 'Integer' as synonym for 'Integral' in numbers module. In-Reply-To: <1519191292.27.0.467229070634.issue32891@psf.upfronthosting.co.za> Message-ID: <1619491755.42.0.655624150893.issue32891@roundup.psfhosted.org> Jelle Zijlstra added the comment: Like Mark I'm opposed to this change. It requires little work in CPython itself, but numbers.Integral has now been a part of the language for many years and the name is used in numerous third-party projects. Forcing all of them to change doesn't seem particularly valuable. "Integer" is probably a better name in a vacuum, but "Integral" isn't actively misleading. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 23:28:37 2021 From: report at bugs.python.org (Laurie Opperman) Date: Tue, 27 Apr 2021 03:28:37 +0000 Subject: [issue43532] Add keyword-only fields to dataclasses In-Reply-To: <1616002761.92.0.652624260802.issue43532@roundup.psfhosted.org> Message-ID: <1619494117.94.0.823267099397.issue43532@roundup.psfhosted.org> Laurie Opperman added the comment: Will this close https://bugs.python.org/issue36077 ? ---------- nosy: +Epic_Wink _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 23:36:56 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Tue, 27 Apr 2021 03:36:56 +0000 Subject: [issue32891] Add 'Integer' as synonym for 'Integral' in numbers module. In-Reply-To: <1619491755.42.0.655624150893.issue32891@roundup.psfhosted.org> Message-ID: Sergey B Kirpichev added the comment: On Tue, Apr 27, 2021 at 02:49:15AM +0000, Jelle Zijlstra wrote: > Forcing all of them to change doesn't seem particularly valuable. It seems, this will cost very little work on their side, much less than on the CPython side. Do you agree? Something like this change: https://docs.python.org/3.7/whatsnew/3.7.html#id3 - require much more efforts... > but "Integral" isn't actively misleading. Well, sometimes it surprise people, e.g.: https://mail.python.org/archives/list/python-ideas at python.org/message/2KQSRVBUWGBVV2MPTI4J6M4BVO2NYB3V/ BTW, we already have some inconsistencies around this terminology. E.g. recently introduced Decimal.is_integer() vs to_integral(): https://bugs.python.org/issue26680#msg262715 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 23:44:38 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 27 Apr 2021 03:44:38 +0000 Subject: [issue32891] Add 'Integer' as synonym for 'Integral' in numbers module. In-Reply-To: <1519191292.27.0.467229070634.issue32891@psf.upfronthosting.co.za> Message-ID: <1619495078.88.0.319681769445.issue32891@roundup.psfhosted.org> Raymond Hettinger added the comment: I concur with Serhiy, Mark and Jelle for the reasons they listed. Am marking this as closed. If there were a greenfield exercise, Integer would be a mildly better choice. However, this code has long been deployed and changing it would create more disruption than benefit. Thank you for the suggestion but it doesn't make sense for us. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 23:46:32 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 27 Apr 2021 03:46:32 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1619495192.61.0.0761343559983.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 9dfefbe3e2dc548ad306870b56cc0cb475aa20a2 by Inada Naoki in branch 'master': bpo-43651: Fix EncodingWarning in `pydoc`. (GH-25644) https://github.com/python/cpython/commit/9dfefbe3e2dc548ad306870b56cc0cb475aa20a2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 26 23:55:50 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 27 Apr 2021 03:55:50 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1619495750.39.0.333760530092.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +24338 pull_request: https://github.com/python/cpython/pull/25645 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 00:00:15 2021 From: report at bugs.python.org (Richard Levasseur) Date: Tue, 27 Apr 2021 04:00:15 +0000 Subject: [issue43946] unpickling a subclass of list fails when it implements its own extend method In-Reply-To: <1619483582.32.0.0403635127136.issue43946@roundup.psfhosted.org> Message-ID: <1619496015.26.0.401923173582.issue43946@roundup.psfhosted.org> Richard Levasseur added the comment: Here's a self-contained repro: ``` import pickle class MyList(list): def __init__(self, required, values): self.required = required super().__init__(values) def __getstate__(self): return self.required def __setstate__(self, state): self.required = state def extend(self, values): assert self.required super().extend(values) mylist = MyList('foo', [1, 2]) pickled = pickle.dumps(mylist) unpickled = pickle.loads(pickled) print(mylist) ``` The above will raise an AttributeError when self.required is accessed in extend(). Oddly, defining a `__reduce__()` function that simply calls and returns `super().__reduce__()` seems to restore the previous behavior and things work again. ---------- nosy: +richardlev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 00:05:23 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Tue, 27 Apr 2021 04:05:23 +0000 Subject: [issue32891] Add 'Integer' as synonym for 'Integral' in numbers module. In-Reply-To: <1519191292.27.0.467229070634.issue32891@psf.upfronthosting.co.za> Message-ID: <1619496323.68.0.549732590354.issue32891@roundup.psfhosted.org> Sergey B Kirpichev added the comment: > Thank you for the suggestion Raymond, that was Guido's suggestion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 00:16:31 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 27 Apr 2021 04:16:31 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1619496991.69.0.840430871004.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset cfe523b49280cdc8c239c807121ad3f33552f638 by Inada Naoki in branch 'master': bpo-43651: PEP 597: Fix `socket.makefile()` (GH-25645) https://github.com/python/cpython/commit/cfe523b49280cdc8c239c807121ad3f33552f638 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 00:16:45 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 27 Apr 2021 04:16:45 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1619497005.48.0.540513681292.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +24339 pull_request: https://github.com/python/cpython/pull/25648 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 00:20:15 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 27 Apr 2021 04:20:15 +0000 Subject: [issue43945] [Enum] standardize format() behavior In-Reply-To: <1619478272.35.0.783754187217.issue43945@roundup.psfhosted.org> Message-ID: <1619497215.2.0.88624147487.issue43945@roundup.psfhosted.org> Change by Ethan Furman : ---------- keywords: +patch pull_requests: +24340 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25649 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 00:48:22 2021 From: report at bugs.python.org (Roy Smith) Date: Tue, 27 Apr 2021 04:48:22 +0000 Subject: [issue24258] BZ2File objects do not have name attribute In-Reply-To: <1432199816.0.0.178283144298.issue24258@psf.upfronthosting.co.za> Message-ID: <1619498902.68.0.874493460868.issue24258@roundup.psfhosted.org> Change by Roy Smith : ---------- nosy: +roysmith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 01:02:52 2021 From: report at bugs.python.org (junpengruan) Date: Tue, 27 Apr 2021 05:02:52 +0000 Subject: [issue27820] Possible bug in smtplib when initial_response_ok=False In-Reply-To: <1471739698.94.0.271523306415.issue27820@psf.upfronthosting.co.za> Message-ID: <1619499772.74.0.693910345514.issue27820@roundup.psfhosted.org> junpengruan <632077280 at qq.com> added the comment: Hi I think there is another bug when initial_response_ok=False. When using AUTH PLAIN, the server will response like: ------------------ C: AUTH PLAIN S: 334 ok. go on ------------------ and it's not base64 encoding, while in the auth() it will decode the resp(here is "ok, go on") which will cause a binascii.Error: Traceback (most recent call last): File "/usr/lib/python3.6/smtplib.py", line 644, in auth challenge = base64.decodebytes(resp) File "/usr/lib/python3.6/base64.py", line 553, in decodebytes return binascii.a2b_base64(s) binascii.Error: Incorrect padding I think this fit the title "a bug in smtplib when initial_response_ok=False", should I just comment on this issue or open a new issue? Thanks! ---------- nosy: +junpengruan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 01:03:58 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 27 Apr 2021 05:03:58 +0000 Subject: [issue27820] Possible bug in smtplib when initial_response_ok=False In-Reply-To: <1619499772.74.0.693910345514.issue27820@roundup.psfhosted.org> Message-ID: Senthil Kumaran added the comment: Please open a new issue. It has better chances of being fixed quickly. On Mon, Apr 26, 2021 at 10:02 PM junpengruan wrote: > > junpengruan <632077280 at qq.com> added the comment: > > Hi > I think there is another bug when initial_response_ok=False. When using > AUTH PLAIN, the server will response like: > ------------------ > C: AUTH PLAIN > S: 334 ok. go on > ------------------ > and it's not base64 encoding, while in the auth() it will decode the > resp(here is "ok, go on") which will cause a binascii.Error: > > Traceback (most recent call last): > File "/usr/lib/python3.6/smtplib.py", line 644, in auth > challenge = base64.decodebytes(resp) > File "/usr/lib/python3.6/base64.py", line 553, in decodebytes > return binascii.a2b_base64(s) > binascii.Error: Incorrect padding > > I think this fit the title "a bug in smtplib when > initial_response_ok=False", should I just comment on this issue or open a > new issue? > Thanks! > > ---------- > nosy: +junpengruan > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 01:10:55 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 27 Apr 2021 05:10:55 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1619500255.53.0.550264086945.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +24341 pull_request: https://github.com/python/cpython/pull/25650 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 01:29:40 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Apr 2021 05:29:40 +0000 Subject: [issue43946] unpickling a subclass of list fails when it implements its own extend method In-Reply-To: <1619483582.32.0.0403635127136.issue43946@roundup.psfhosted.org> Message-ID: <1619501380.79.0.911229586945.issue43946@roundup.psfhosted.org> Serhiy Storchaka added the comment: >From PEP 307: listitems Optional, and new in this PEP. If this is not None, it should be an iterator (not a sequence!) yielding successive list items. These list items will be pickled, and appended to the object using either obj.append(item) or obj.extend(list_of_items). This is primarily used for list subclasses, but may be used by other classes as long as they have append() and extend() methods with the appropriate signature. (Whether append() or extend() is used depends on which pickle protocol version is used as well as the number of items to append, so both must be supported.) It says that obj.extend(list_of_items) should be called, not list.extend(obj, list_of_items). Changing it now can break classes which rely on overridden extend(). The special check in the C code is only for optimization, we can inline extend() if it was not overridden. Unfortunately __setstate__() is called after extend(), so there is no way to set the validator in FieldList before it will be used in extend(). As a clever hack (if you do not want to do runtime check in every call of extend()) you can set self.extend = lambda items: list.extend(self, items) in the __new__ method and add del self.extend in __init__ and __setstate__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 01:37:35 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Apr 2021 05:37:35 +0000 Subject: [issue43947] lambdas stored with assignment expressions are unoptimized In-Reply-To: <1619489628.98.0.0361601429976.issue43947@roundup.psfhosted.org> Message-ID: <1619501855.74.0.27231471148.issue43947@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- components: +Interpreter Core versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 01:39:06 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Tue, 27 Apr 2021 05:39:06 +0000 Subject: [issue26092] doctest should allow custom sys.displayhook In-Reply-To: <1452622857.37.0.137754453324.issue26092@psf.upfronthosting.co.za> Message-ID: <1619501946.13.0.921611482082.issue26092@roundup.psfhosted.org> Change by Sergey B Kirpichev : ---------- pull_requests: +24342 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25651 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 01:43:08 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 27 Apr 2021 05:43:08 +0000 Subject: [issue43945] [Enum] standardize format() behavior In-Reply-To: <1619478272.35.0.783754187217.issue43945@roundup.psfhosted.org> Message-ID: <1619502188.39.0.3366485019.issue43945@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 5987b8c463892e0ab7a63cdae92f34b5eb79732d by Ethan Furman in branch 'master': bpo-43945: [Enum] Deprecate non-standard mixin format() behavior (GH-25649) https://github.com/python/cpython/commit/5987b8c463892e0ab7a63cdae92f34b5eb79732d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 02:05:51 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 27 Apr 2021 06:05:51 +0000 Subject: [issue8077] cgi handling of POSTed files is broken in Windows In-Reply-To: <1267839820.97.0.586792235494.issue8077@psf.upfronthosting.co.za> Message-ID: <1619503551.87.0.116118928387.issue8077@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- title: cgi handling of POSTed files is broken -> cgi handling of POSTed files is broken in Windows versions: +Python 3.10 -Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 02:09:56 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 27 Apr 2021 06:09:56 +0000 Subject: [issue8077] cgi handling of POSTed files is broken in Windows In-Reply-To: <1267839820.97.0.586792235494.issue8077@psf.upfronthosting.co.za> Message-ID: <1619503796.29.0.0814068775291.issue8077@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- pull_requests: +24343 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/25652 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 02:24:43 2021 From: report at bugs.python.org (Shatabarto Bhattacharya) Date: Tue, 27 Apr 2021 06:24:43 +0000 Subject: [issue24258] BZ2File objects do not have name attribute In-Reply-To: <1432199816.0.0.178283144298.issue24258@psf.upfronthosting.co.za> Message-ID: <1619504683.83.0.0384153360046.issue24258@roundup.psfhosted.org> Change by Shatabarto Bhattacharya : ---------- nosy: +hrik2001 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 02:31:30 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 27 Apr 2021 06:31:30 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619505090.64.0.375698845584.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: I ran the test suite without the changes and they still fail. Therefore apply-to-all.diff does not have any bug at all. But the test failures are also a major issue not only for this change but also for others. I'm opening a new issue for those test failures. (apply-to-all.diff is outdated because Erlend changed the flag name from Py_TPFLAGS_IMMUTABLE to Py_TPFLAGS_IMMUTABLETYPE in the PR. I'm attaching the modified apply-to-all.diff) ---------- Added file: https://bugs.python.org/file49990/apply-to-all.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 02:45:39 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 27 Apr 2021 06:45:39 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1619505939.94.0.0300705649509.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset caae717c2903fff4704b59714bc0c65d60108321 by Inada Naoki in branch 'master': bpo-43651: Fix EncodingWarning in zipfile (GH-25650) https://github.com/python/cpython/commit/caae717c2903fff4704b59714bc0c65d60108321 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 02:47:23 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 27 Apr 2021 06:47:23 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1619506043.38.0.681427564573.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 878bc8b6c2051cf344c594636fa957ce6c9d2188 by Inada Naoki in branch 'master': bpo-43651: Fix EncodingWarning in fileinput and its test (GH-25648) https://github.com/python/cpython/commit/878bc8b6c2051cf344c594636fa957ce6c9d2188 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 02:57:02 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 27 Apr 2021 06:57:02 +0000 Subject: [issue34463] Discrepancy between traceback.print_exception and sys.__excepthook__ In-Reply-To: <1534964466.61.0.56676864532.issue34463@psf.upfronthosting.co.za> Message-ID: <1619506622.38.0.000445365578957.issue34463@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 03:01:22 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 27 Apr 2021 07:01:22 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619506882.34.0.948343032256.issue43492@roundup.psfhosted.org> Shreyan Avigyan added the comment: Updating the source. https://github.com/python/cpython-source-deps/pull/24 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 03:15:50 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 27 Apr 2021 07:15:50 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619507750.52.0.204035955795.issue43492@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Thanks Shreyan, but Steve prefers to update it himself: https://github.com/python/cpython-source-deps/pull/22#issuecomment-705234459 Just having the sources in place does not really help; you need a new git tag, which can only be pushed by core devs. Better to wait for the Windows team to fix this (also less noise for them) :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 03:19:59 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 27 Apr 2021 07:19:59 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619507999.73.0.921232524554.issue43492@roundup.psfhosted.org> Shreyan Avigyan added the comment: Ok. I'm closing https://github.com/python/cpython-source-deps/pull/24 then. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 03:20:32 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 27 Apr 2021 07:20:32 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619508032.8.0.990608094157.issue43916@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24344 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25653 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 03:23:47 2021 From: report at bugs.python.org (Hasan Diwan) Date: Tue, 27 Apr 2021 07:23:47 +0000 Subject: [issue24258] BZ2File objects do not have name attribute In-Reply-To: <1432199816.0.0.178283144298.issue24258@psf.upfronthosting.co.za> Message-ID: <1619508227.38.0.0319699728497.issue24258@roundup.psfhosted.org> Hasan Diwan added the comment: Patch adds a bz2.BZ2File.name property corresponding to the filename passed in. ---------- keywords: +patch nosy: +Hasan Diwan versions: +Python 3.10, Python 3.11, Python 3.8, Python 3.9 -Python 3.6 Added file: https://bugs.python.org/file49991/bz2.name.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 03:26:17 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 27 Apr 2021 07:26:17 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619508377.22.0.383485807184.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > These tests should also be added when new types are converted in the future. We should have a checklist for static to heap type conversion. I'm pretty sure I've seen something like that in one of Victor's blogs. A new section in the Dev Guide, maybe? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 03:53:25 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Tue, 27 Apr 2021 07:53:25 +0000 Subject: =?utf-8?q?=5Bissue43948=5D_sysconfig=E2=80=99s_osx=5Fframework=5Fuser_put?= =?utf-8?q?s_headers_in_different_locations_from_distutils?= Message-ID: <1619510005.78.0.165065669518.issue43948@roundup.psfhosted.org> New submission from Tzu-ping Chung : When built in framework mode on macOS, distutils puts user-site headers under `{userbase}/include/python{py_version_short}{abiflags}`: >>> import sys >>> print(sys.platform, sys._framework) darwin Python >>> from distutils.dist import Distribution >>> c = Distribution().get_command_obj('install') >>> c.user = True >>> c.finalize_options() >>> print(c.install_headers) /Users/uranusjr/Library/Python/3.9/include/python3.9/UNKNOWN But sysconfig lacks the `pythonX.Y` part: >>> import sysconfig >>> print(sysconfig.get_path('include', scheme='osx_framework_user')) /Users/uranusjr/Library/Python/3.9/include This is inconsistent to all other schemes, such as `posix_user` (tested on the `python:3.9-slim` OCI image): >>> import sys >>> print(sys.platform, sys._framework) linux >>> from distutils.dist import Distribution >>> c = Distribution().get_command_obj('install') >>> c.user = True >>> c.finalize_options() >>> print(c.install_headers) /root/.local/include/python3.9/UNKNOWN >>> import sysconfig >>> print(sysconfig.get_path('include', scheme='posix_user')) /root/.local/include/python3.9 Note that the paths on `posix_user` only differs by one component (`UNKNOWN`, which is the distribution name), but `osx_framework_user` differs by two. ---------- components: Library (Lib) messages: 392037 nosy: uranusjr priority: normal severity: normal status: open title: sysconfig?s osx_framework_user puts headers in different locations from distutils versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 03:55:51 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 27 Apr 2021 07:55:51 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619510151.2.0.77279004113.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: Re-running the failed tests doesn't trigger the errors but running the whole test suite does. And some errors I described are fixed in any of the last 22 commits and PRs. Therefore should we actually look into this matter or should we leave it as it is? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 03:57:58 2021 From: report at bugs.python.org (junpengruan) Date: Tue, 27 Apr 2021 07:57:58 +0000 Subject: [issue43949] binascii.Error raised in smtplib when initial_response_ok=False Message-ID: <1619510278.38.0.0405436447685.issue43949@roundup.psfhosted.org> New submission from junpengruan <632077280 at qq.com>: Hi I think there is a bug when initial_response_ok=False and using AUTH PLAIN, the server will response like: ------------------ C: AUTH PLAIN S: 334 ok. go on ------------------ and it's not base64 encoding, while in the auth() it will base64 decode the resp(here is "ok, go on") which will cause a binascii.Error: Traceback (most recent call last): File "/usr/lib/python3.6/smtplib.py", line 644, in auth challenge = base64.decodebytes(resp) File "/usr/lib/python3.6/base64.py", line 553, in decodebytes return binascii.a2b_base64(s) binascii.Error: Incorrect padding I am using Magic Winmail Server2.4(build 0530) as a SMTP server, which appears dont support initial_response, so I set initial_response_ok=False and got this Error. currently I catch this error and ignore it to evade program failed, it works fine. Is there better way to fix this problem? Thanks! ---------- components: email messages: 392039 nosy: barry, junpengruan, r.david.murray priority: normal severity: normal status: open title: binascii.Error raised in smtplib when initial_response_ok=False type: behavior versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 04:20:33 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Tue, 27 Apr 2021 08:20:33 +0000 Subject: =?utf-8?q?=5Bissue43948=5D_sysconfig=E2=80=99s_osx=5Fframework=5Fuser_put?= =?utf-8?q?s_headers_in_different_locations_from_distutils?= In-Reply-To: <1619510005.78.0.165065669518.issue43948@roundup.psfhosted.org> Message-ID: <1619511633.03.0.991469544446.issue43948@roundup.psfhosted.org> Change by Tzu-ping Chung : ---------- components: +macOS nosy: +ned.deily, ronaldoussoren type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 04:20:43 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 27 Apr 2021 08:20:43 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1619511643.99.0.736723428764.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +24345 pull_request: https://github.com/python/cpython/pull/25654 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 04:23:03 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 27 Apr 2021 08:23:03 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619511783.52.0.913802082657.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Alternative approach: Add _PyType_DisabledNew to Include/cpython, and add {Py_tp_new, _PyType_DisabledNew} slot to affected types. Diff attached. See GH discussion: - https://github.com/python/cpython/pull/25653#issuecomment-827383246 - https://github.com/python/cpython/pull/25653#issuecomment-827390034 ---------- Added file: https://bugs.python.org/file49992/disablednew.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 04:24:36 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 27 Apr 2021 08:24:36 +0000 Subject: [issue39812] Avoid daemon threads in concurrent.futures In-Reply-To: <1583071410.96.0.599538732629.issue39812@roundup.psfhosted.org> Message-ID: <1619511876.09.0.237634832702.issue39812@roundup.psfhosted.org> Antoine Pitrou added the comment: @Jan, without taking a look, I'd answer that indeed you should avoid using the "fork" method if you're doing any kind of multithreading in the parent process. "forkserver" is a good choice nowadays on Linux and will result in more robust code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 04:30:34 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 27 Apr 2021 08:30:34 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619512234.98.0.589433481847.issue43916@roundup.psfhosted.org> Christian Heimes added the comment: LGTM ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 04:31:35 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 27 Apr 2021 08:31:35 +0000 Subject: [issue32891] Add 'Integer' as synonym for 'Integral' in numbers module. In-Reply-To: <1519191292.27.0.467229070634.issue32891@psf.upfronthosting.co.za> Message-ID: <1619512295.13.0.00401673826841.issue32891@roundup.psfhosted.org> Raymond Hettinger added the comment: > that was Guido's suggestion. Well, that complicated things ;-) I suppose he can revive this if he wants. Perhaps after seeing how pervasive the change is he will be less inclined. Jelle, Mark, and I have all thought about it and don't think it is worth the disruption. In 14 years we hadn't had user reports or any other evidence that word Integral is problematic, so it isn't that there is any problem to be solved. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 04:32:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 08:32:30 +0000 Subject: [issue39812] Avoid daemon threads in concurrent.futures In-Reply-To: <1583071410.96.0.599538732629.issue39812@roundup.psfhosted.org> Message-ID: <1619512350.47.0.528032950205.issue39812@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 04:36:52 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Apr 2021 08:36:52 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619512612.6.0.626640459957.issue43916@roundup.psfhosted.org> Serhiy Storchaka added the comment: Alternatively we can make PyType_FromSpec() setting tp_new to NULL if there is explicit {Py_tp_new, NULL} in slots. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 04:37:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 27 Apr 2021 08:37:33 +0000 Subject: [issue41735] Thread locks in zlib module may go wrong in rare case In-Reply-To: <1599448486.98.0.401518384343.issue41735@roundup.psfhosted.org> Message-ID: <1619512653.34.0.349287945195.issue41735@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks! ? ? ? ---------- nosy: +lukasz.langa resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 04:38:04 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 27 Apr 2021 08:38:04 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1619512684.0.0.740861074702.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +24346 pull_request: https://github.com/python/cpython/pull/25655 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 04:41:25 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 27 Apr 2021 08:41:25 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619512885.3.0.797145506387.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > Alternatively we can make PyType_FromSpec() setting tp_new to NULL if there is explicit {Py_tp_new, NULL} in slots. Yes. It's not as explicit (and self-documenting) as _PyType_DisabledNew, though. But it avoids expanding the C API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 04:46:04 2021 From: report at bugs.python.org (Paul Moore) Date: Tue, 27 Apr 2021 08:46:04 +0000 Subject: [issue43312] Interface to select preferred "user" or "home" sysconfig scheme for an environment In-Reply-To: <1614158800.84.0.101101658017.issue43312@roundup.psfhosted.org> Message-ID: <1619513164.94.0.99836985282.issue43312@roundup.psfhosted.org> Paul Moore added the comment: New changeset d92513390a1a0da781bb08c284136f4d7abea36d by Tzu-ping Chung in branch 'master': bpo-43312: Functions returning default and preferred sysconfig schemes (GH-24644) https://github.com/python/cpython/commit/d92513390a1a0da781bb08c284136f4d7abea36d ---------- nosy: +paul.moore _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 04:58:32 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 27 Apr 2021 08:58:32 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619513912.66.0.158738133905.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: For that to work, you'd have to add a flag in PyType_FromModuleAndSpec, set the flag if (slot->slot == Py_tp_new && slot->pfunc == NULL) in the slots for loop, and then reset tp_new _after_ PyType_Ready. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 05:03:07 2021 From: report at bugs.python.org (Ma Lin) Date: Tue, 27 Apr 2021 09:03:07 +0000 Subject: [issue41735] Thread locks in zlib module may go wrong in rare case In-Reply-To: <1599448486.98.0.401518384343.issue41735@roundup.psfhosted.org> Message-ID: <1619514187.83.0.887971416571.issue41735@roundup.psfhosted.org> Ma Lin added the comment: Thanks for review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 05:04:17 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 27 Apr 2021 09:04:17 +0000 Subject: [issue43864] [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead In-Reply-To: <1618578775.46.0.785924432695.issue43864@roundup.psfhosted.org> Message-ID: <1619514257.65.0.254367285096.issue43864@roundup.psfhosted.org> Shreyan Avigyan added the comment: Can you reopen this issue? Brett forgot to silence another warning in WindowsRegistryFinderTests class. I'm opening a PR for that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 05:10:14 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 27 Apr 2021 09:10:14 +0000 Subject: [issue43864] [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead In-Reply-To: <1618578775.46.0.785924432695.issue43864@roundup.psfhosted.org> Message-ID: <1619514614.22.0.278235653781.issue43864@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- pull_requests: +24347 pull_request: https://github.com/python/cpython/pull/25656 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 05:49:00 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 27 Apr 2021 09:49:00 +0000 Subject: [issue42739] Crash when try to disassemble bogus code object In-Reply-To: <1608897358.97.0.834158885511.issue42739@roundup.psfhosted.org> Message-ID: <1619516940.94.0.745306884215.issue42739@roundup.psfhosted.org> Mark Shannon added the comment: Using sentinels as a marker to terminate the line number table, might be a problem if we want to use a different format. So I'm fixing this for 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 05:52:05 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 27 Apr 2021 09:52:05 +0000 Subject: [issue42739] Crash when try to disassemble bogus code object In-Reply-To: <1608897358.97.0.834158885511.issue42739@roundup.psfhosted.org> Message-ID: <1619517125.4.0.427373953814.issue42739@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +24348 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25657 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 06:09:39 2021 From: report at bugs.python.org (Ma Lin) Date: Tue, 27 Apr 2021 10:09:39 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1619518179.96.0.0618480159571.issue41486@roundup.psfhosted.org> Ma Lin added the comment: The above changes were made in this commit: split core code and wrappers 55705f6dc28ff4dc6183e0eb57312c885d19090a After that commit, there is a new commit, it resolves the code conflicts introduced by PR 22126 one hour ago. Merge branch 'master' into blocks_output_buffer 45d752649925765b1b3cf39e9045270e92082164 Sorry to complicate the review again. I should ask ?ukasz Langa to merge PR 22126 after this issue is resolved, since resolving code conflicts in PR 22126 is easier. For the change from 55705f6 to 45d7526, see the uploaded file (45d7526.diff), it can also be easily seen with a Git client. ---------- Added file: https://bugs.python.org/file49993/45d7526.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 06:21:06 2021 From: report at bugs.python.org (Jens) Date: Tue, 27 Apr 2021 10:21:06 +0000 Subject: [issue43911] Queue.get() memory leak In-Reply-To: <1619082802.82.0.467723490819.issue43911@roundup.psfhosted.org> Message-ID: <1619518866.66.0.229370048721.issue43911@roundup.psfhosted.org> Jens added the comment: Raymond, thanks for your suggestions. My deployed applications don't hold up 20m items at a time, that was a way to show the leak. I was able to resolve the threading, queue-based leaks on my instances by modifying the Queue, Event and Conditions classes to use external doubly linked list library in the following manner (python3.7), not the clearest rewrite, but just to get the idea: class DllistCondition(threading.Condition): def __init__(self, lock=None): if lock is None: lock = threading.RLock() self._lock = lock self.acquire = lock.acquire self.release = lock.release try: self._release_save = lock._release_save except AttributeError: pass try: self._acquire_restore = lock._acquire_restore except AttributeError: pass try: self._is_owned = lock._is_owned except AttributeError: pass self._waiters = dllist() def notify(self, n=1): if not self._is_owned(): raise RuntimeError("cannot notify on un-acquired lock") all_waiters = self._waiters waiters_to_notify = all_waiters #_islize would be empty only if there are no waiters avail, for any n if len(waiters_to_notify) < 1: return node = waiters_to_notify.first i = 1 while True: #simulate _islice if i > n: return waiter = node.value #get next node before release node_next = node.next waiter.release() try: all_waiters.remove(node) except ValueError: pass i += 1 node = node_next #if it's the last node, return if node is None: return def wait(self, timeout=None): if not self._is_owned(): raise RuntimeError("cannot wait on un-acquired lock") waiter = threading._allocate_lock() waiter.acquire() node = self._waiters.append(waiter) saved_state = self._release_save() gotit = False try: # restore state no matter what (e.g., KeyboardInterrupt) if timeout is None: waiter.acquire() gotit = True else: if timeout > 0: gotit = waiter.acquire(True, timeout) else: gotit = waiter.acquire(False) return gotit finally: self._acquire_restore(saved_state) if not gotit: try: self._waiters.remove(node) except ValueError: pass class DllistEvent(threading.Event): def __init__(self): self._cond = DllistCondition(threading.Lock()) self._flag = False class DllistQueue(queue.Queue): def __init__(self, maxsize=0): self.maxsize = maxsize self._init(maxsize) self.mutex = threading.Lock() self.not_empty = DllistCondition(self.mutex) self.not_full = DllistCondition(self.mutex) self.all_tasks_done = DllistCondition(self.mutex) self.unfinished_tasks = 0 def _init(self, maxsize): self.queue = dllist() Now, I'm not exactly sure that the Queue itself required the `self.queue = deque()`modification, but I'm sure that conditions required getting rid of the stock `self._waiters = deque()` and the consequent use of it. Memory profiling constantly showed a leak at waiters_to_notify = _deque(_islice(all_waiters, n) in the threading.Condition class, which is both employed by threading.Queue and treading.Event classes. After the modifiction this leak is gone and I suspect it has to do something with reiniting the deque at `waiters_to_notify = _deque(_islice(all_waiters, n)` In any cases, I'm leaving this out here in case anyone get to deal with it as well and it might be helpful. Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 06:33:24 2021 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 27 Apr 2021 10:33:24 +0000 Subject: [issue43312] Interface to select preferred "user" or "home" sysconfig scheme for an environment In-Reply-To: <1614158800.84.0.101101658017.issue43312@roundup.psfhosted.org> Message-ID: <1619519604.78.0.809649832011.issue43312@roundup.psfhosted.org> Change by Nick Coghlan : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 06:58:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Apr 2021 10:58:38 +0000 Subject: [issue43950] Include column offsets for bytecode instructions Message-ID: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : If we could include column offsets from the AST nodes for every bytecode instructions we could leverage these to offer much better tracebacks and a lot more information to debuggers and similar tools. For instance, in an expression such as: z['aaaaaa']['bbbbbb']['cccccc']['dddddd].sddfsdf.sdfsdf where one of these elements is None, we could tell exactly what of these pieces is the actual None and we could do some cool highlighting on tracebacks. Similarly, coverage tools and debuggers could also make this distinction and therefore could offer reports with more granularity. The cost is not 0: it would be two integers per bytecode instruction, but I think it may be worth the effort. ---------- messages: 392054 nosy: Mark.Shannon, pablogsal priority: normal severity: normal status: open title: Include column offsets for bytecode instructions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 06:58:54 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Apr 2021 10:58:54 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1619521134.43.0.546175752442.issue43950@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +nedbat, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 07:06:19 2021 From: report at bugs.python.org (Larry Hastings) Date: Tue, 27 Apr 2021 11:06:19 +0000 Subject: [issue43951] Two minor fixes for C module object Message-ID: <1619521579.23.0.324189494651.issue43951@roundup.psfhosted.org> New submission from Larry Hastings : While working on another issue, I noticed two minor nits in the C implementation of the module object. Both are related to getting a module's name. -- First, the C function module_dir() (module.__dir__) starts by ensuring the module dict is valid. If the module dict is invalid, it wants to format an exception using the name of the module, which it gets from PyModule_GetName(). However, PyModule_GetName() gets the name of the module from the dict. So getting the name in this circumstance will never succeed. When module_dir() wants to format the error but can't get the name, it knows that PyModule_GetName() must have already raised an exception. So it leaves that exception alone and returns an error. The end result is that the exception raised here is kind of useless and misleading: dir(module) on a module with no __dict__ raises SystemError("nameless module"). I changed the code to actually raise the exception it wanted to raise, just without a real module name: TypeError(".__dict__ is not a dictionary"). This seems more useful, and would do a better job putting the programmer who encountered this on the right track of figuring out what was going on. -- Second, the C API function PyModule_GetNameObject() checks to see if the module has a dict. If m->md_dict is not NULL, it calls _PyDict_GetItemIdWithError(). However, it's possible for m->md_dict to be None. And if you call _PyDict_GetItemIdWithError(Py_None, ...) it will *crash*. Unfortunately, this crash was due to my own bug in the other branch. Fixing my code made the crash go away. I assert that this is still possible at the API level. The fix is easy: add a PyDict_Check() to PyModule_GetNameObject(). Unfortunately, I don't know how to add a unit test for this. Having changed module_dir() above, I can't find any other interfaces callable from Python that eventually call PyModule_GetNameObject(). So I don't know how to trick the runtime into reproducing this error. ---------- assignee: larry components: Interpreter Core messages: 392055 nosy: larry priority: normal severity: normal stage: needs patch status: open title: Two minor fixes for C module object type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 07:11:02 2021 From: report at bugs.python.org (Larry Hastings) Date: Tue, 27 Apr 2021 11:11:02 +0000 Subject: [issue43951] Two minor fixes for C module object In-Reply-To: <1619521579.23.0.324189494651.issue43951@roundup.psfhosted.org> Message-ID: <1619521862.96.0.643018955177.issue43951@roundup.psfhosted.org> Change by Larry Hastings : ---------- keywords: +patch pull_requests: +24349 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25658 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 07:45:15 2021 From: report at bugs.python.org (anon01) Date: Tue, 27 Apr 2021 11:45:15 +0000 Subject: [issue43952] Multiprocessing UNIX socket connection: client freeze if authkey is an empty byte string Message-ID: <1619523915.52.0.163488043908.issue43952@roundup.psfhosted.org> New submission from anon01 : When I run this code (on a UNIX system with temporary directory `/tmp/`): ``` from multiprocessing import connection import threading key=b"1" def run(): c=connection.Client("/tmp/xxx", authkey=key) c.send("data") l=connection.Listener("/tmp/xxx", authkey=key) threading.Thread(target=run).start() c=l.accept() print("receive", c.recv()) ``` it prints out "receive data" normally. However, in the special case that `key=b""` the doesn't print anything, and can only be interrupted with Ctrl+C. `key=None` doesn't have that issue. Note that this issue does happen when the client uses the key `b""` and the server uses the key `None`, but the program works normally if the reverse situation. Python version: Python 3.9.3. ---------- components: Library (Lib) messages: 392056 nosy: anon01 priority: normal severity: normal status: open title: Multiprocessing UNIX socket connection: client freeze if authkey is an empty byte string versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 07:45:55 2021 From: report at bugs.python.org (anon01) Date: Tue, 27 Apr 2021 11:45:55 +0000 Subject: [issue43952] Multiprocessing UNIX socket connection: client freeze if authkey is an empty byte string In-Reply-To: <1619523915.52.0.163488043908.issue43952@roundup.psfhosted.org> Message-ID: <1619523955.37.0.119669801879.issue43952@roundup.psfhosted.org> Change by anon01 : ---------- nosy: -anon01 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 07:46:25 2021 From: report at bugs.python.org (anon01) Date: Tue, 27 Apr 2021 11:46:25 +0000 Subject: [issue43952] Multiprocessing UNIX socket connection: client freeze if authkey is an empty byte string In-Reply-To: <1619523915.52.0.163488043908.issue43952@roundup.psfhosted.org> Message-ID: <1619523985.35.0.966639584093.issue43952@roundup.psfhosted.org> Change by anon01 : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 07:48:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 11:48:08 +0000 Subject: [issue43951] Two minor fixes for C module object In-Reply-To: <1619521579.23.0.324189494651.issue43951@roundup.psfhosted.org> Message-ID: <1619524088.8.0.149039055812.issue43951@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 07:53:09 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 27 Apr 2021 11:53:09 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619524389.05.0.702793597092.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > The second most important part here is also adding regression tests so this doesn't happen. I've started adding tests. I'm not sure if I need to wrap them with @cpython_only. Some of the types are hidden deep inside the implementations, and I have a hard time fetching them. For example _functools._lru_list_elem and _thread._localdummy. Is it ok to leave those out? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 07:54:00 2021 From: report at bugs.python.org (Sergei Lebedev) Date: Tue, 27 Apr 2021 11:54:00 +0000 Subject: [issue43953] InitVar should not be available on a @dataclass-decorated class Message-ID: <1619524440.38.0.385093329161.issue43953@roundup.psfhosted.org> New submission from Sergei Lebedev : Motivating example: >>> @dataclass ... class A: ... x: InitVar[int] = 0 ... y: int = 1 ... >>> a = A() >>> a.x 0 >>> a.y 1 PEP-557 does not specify if fields annotated with InitVar[...] are available on the resulting dataclass. However, they are not part of the dataclass structure and are only used for __*init__ generation, so perhaps they shouldn't be? Wdyt? ---------- components: Library (Lib) messages: 392058 nosy: eric.smith, superbobry priority: normal severity: normal status: open title: InitVar should not be available on a @dataclass-decorated class versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 08:17:05 2021 From: report at bugs.python.org (Steve Stagg) Date: Tue, 27 Apr 2021 12:17:05 +0000 Subject: [issue24258] BZ2File objects do not have name attribute In-Reply-To: <1432199816.0.0.178283144298.issue24258@psf.upfronthosting.co.za> Message-ID: <1619525825.38.0.767709692112.issue24258@roundup.psfhosted.org> Steve Stagg added the comment: Please may you add a test that uses "io.BytesIO()" as the filename argument. BytesIO() objects do not have a 'name' attribute ---------- nosy: +stestagg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 08:21:08 2021 From: report at bugs.python.org (Julien Palard) Date: Tue, 27 Apr 2021 12:21:08 +0000 Subject: [issue43954] Possible missing word on unittest doc Message-ID: <1619526068.5.0.0964164100817.issue43954@roundup.psfhosted.org> New submission from Julien Palard : In https://docs.python.org/3/library/unittest.html I see: > Note that you need to the top level directory too. Trying to guess, the missing word may be "specify": > Changed in version 3.4: Test discovery supports namespace packages for start directory. Note that you need to specify the top level directory too. (e.g. python -m unittest discover -s root/namespace -t root). Am I right? ---------- assignee: docs at python components: Documentation messages: 392060 nosy: docs at python, mdk, methane priority: normal severity: normal status: open title: Possible missing word on unittest doc versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 08:26:45 2021 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 27 Apr 2021 12:26:45 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1619526405.01.0.285530659945.issue41682@roundup.psfhosted.org> Change by Nick Coghlan : ---------- pull_requests: -24157 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 08:28:11 2021 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 27 Apr 2021 12:28:11 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1619526491.9.0.107416371875.issue41682@roundup.psfhosted.org> Change by Nick Coghlan : ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 08:27:58 2021 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 27 Apr 2021 12:27:58 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1619526478.19.0.296193536385.issue41682@roundup.psfhosted.org> Nick Coghlan added the comment: Another instance at https://github.com/python/cpython/pull/25585/checks?check_run_id=2447701034 I unlinked the previously linked PR, as that looked to be for bpo-43539 rather than this issue. ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 08:33:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Apr 2021 12:33:31 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1619526811.9.0.387529818835.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I'm going to prepare a PEP since the discussion regarding if the two integers per bytecode are worth enough is going to be eternal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 08:36:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Apr 2021 12:36:22 +0000 Subject: [issue43941] Unit test failure in test_gdb only with -O0 In-Reply-To: <1619413336.26.0.680975027921.issue43941@roundup.psfhosted.org> Message-ID: <1619526982.75.0.105323482905.issue43941@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks, Larry for pinging me! What compiler / gdb version are you using? I tried to reproduce but I don't see any failure: master on ? master [$] ? pyenv 3.9.1 took 9s ? ./python -m sysconfig | grep CFLAGS BASECFLAGS = "-Wno-unused-result -Wsign-compare" CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g3 -O0 -g3 -O0" CFLAGSFORSHARED = "" CFLAGS_ALIASING = "" CFLAGS_NODIST = "" CONFIGURE_CFLAGS = "-g3 -O0" CONFIGURE_CFLAGS_NODIST = "-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden" CONFIG_ARGS = "'-C' 'CFLAGS=-g3 -O0'" EXTRA_CFLAGS = "" PY_BUILTIN_MODULE_CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g3 -O0 -g3 -O0 -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include -DPy_BUILD_CORE_BUILTIN" PY_CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g3 -O0 -g3 -O0" PY_CFLAGS_NODIST = "-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal" PY_CORE_CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g3 -O0 -g3 -O0 -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include -DPy_BUILD_CORE" PY_STDMODULE_CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g3 -O0 -g3 -O0 -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include" master on ? master [$] ? pyenv 3.9.1 ? ./python -m test test_gdb -m test_wrapper_call -v == CPython 3.10.0a7+ (heads/master:d92513390a, Apr 27 2021, 13:20:32) [GCC 10.2.0] == Linux-5.11.16-arch1-1-x86_64-with-glibc2.33 little-endian == cwd: /home/pablogsal/github/python/master/build/test_python_27393? == CPU count: 36 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 1.47 Run tests sequentially 0:00:00 load avg: 1.47 [1/1] test_gdb GDB version 10.1: GNU gdb (GDB) 10.1 Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. test_wrapper_call (test.test_gdb.PyBtTests) ... ok ---------------------------------------------------------------------- Ran 1 test in 8.752s OK == Tests result: SUCCESS == 1 test OK. Total duration: 9.2 sec Tests result: SUCCESS These are my versions: ? gcc --version gcc (GCC) 10.2.0 Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. master on ? master [$] ? pyenv 3.9.1 ? gdb --version GNU gdb (GDB) 10.1 Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 08:40:39 2021 From: report at bugs.python.org (Larry Hastings) Date: Tue, 27 Apr 2021 12:40:39 +0000 Subject: [issue43941] Unit test failure in test_gdb only with -O0 In-Reply-To: <1619413336.26.0.680975027921.issue43941@roundup.psfhosted.org> Message-ID: <1619527239.26.0.775217995277.issue43941@roundup.psfhosted.org> Larry Hastings added the comment: I'm on "Pop!_OS 20.10". Current versions: * Linux kernel 5.11.0-7612 * gcc version 10.2.0 (Ubuntu 10.2.0-13ubuntu1) * GNU gdb (Ubuntu 9.2-0ubuntu2) 9.2 % ./python -m sysconfig | grep CFLAGS BASECFLAGS = "-Wno-unused-result -Wsign-compare" CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O0 -Wall" CFLAGSFORSHARED = "" CFLAGS_ALIASING = "" CFLAGS_NODIST = "" CONFIGURE_CFLAGS = "" CONFIGURE_CFLAGS_NODIST = "-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden" EXTRA_CFLAGS = "" PY_BUILTIN_MODULE_CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O0 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include -DPy_BUILD_CORE_BUILTIN" PY_CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O0 -Wall" PY_CFLAGS_NODIST = "-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal" PY_CORE_CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O0 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include -DPy_BUILD_CORE" PY_STDMODULE_CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O0 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 08:46:28 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 27 Apr 2021 12:46:28 +0000 Subject: [issue43953] InitVar should not be available on a @dataclass-decorated class In-Reply-To: <1619524440.38.0.385093329161.issue43953@roundup.psfhosted.org> Message-ID: <1619527588.69.0.386433738767.issue43953@roundup.psfhosted.org> Eric V. Smith added the comment: This is just how Python works. The default values for .x and .y are set on the class A, not its instances. Here's the equivalent without dataclasses: >>> class A: ... x = 0 ... y = 1 ... >>> a = A() >>> a.x 0 >>> a.y 1 >>> a.__dict__ {} >>> A.__dict__ mappingproxy({'__module__': '__main__', 'x': 0, 'y': 1, '__dict__': , '__weakref__': , '__doc__': None}) Note that the instance "a" has nothing in its __dict__, but the values A.x and A.y are none the less available through the instance "a". The only way to avoid this would be for @dataclass to delete the values from A, but that's not a change I'd be willing to make. Is this causing some actual problem in any code? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 08:53:47 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 27 Apr 2021 12:53:47 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619528027.61.0.752124751708.issue43933@roundup.psfhosted.org> Petr Viktorin added the comment: Please don't lose the big picture here. Previously, the reported line number was *somewhere close* to the currently executing code. That's typically all I need from a traceback: the fix for a bug often needs to go a few lines above/below where it's reported. If, in an effort to make line numbers *exact*, we determine that there's no good line number to report and use -1 or None, we're introducing a regression. > We could give it the line number of the `with` keyword, but that might break coverage and profiling tools. That sounds like a reasonable idea, despite the drawback. As we can see from the report, *any* change will probably break *some* tools. ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 08:54:23 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Apr 2021 12:54:23 +0000 Subject: [issue43941] Unit test failure in test_gdb only with -O0 In-Reply-To: <1619413336.26.0.680975027921.issue43941@roundup.psfhosted.org> Message-ID: <1619528063.72.0.678355651878.issue43941@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Can you try to do this: % make distclean % export CFLAGS='-O0 -g3' % ./configure % make -j % ./python -m test test_gdb -m test_wrapper_call -v My guess is that the DWARF generated is not sufficient for whatever reason (hence the -g3) in my proposal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 08:57:34 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 27 Apr 2021 12:57:34 +0000 Subject: [issue43953] InitVar should not be available on a @dataclass-decorated class In-Reply-To: <1619524440.38.0.385093329161.issue43953@roundup.psfhosted.org> Message-ID: <1619528254.92.0.287132664151.issue43953@roundup.psfhosted.org> Change by Eric V. Smith : ---------- assignee: -> eric.smith type: -> behavior versions: -Python 3.11, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 09:01:58 2021 From: report at bugs.python.org (Larry Hastings) Date: Tue, 27 Apr 2021 13:01:58 +0000 Subject: [issue43941] Unit test failure in test_gdb only with -O0 In-Reply-To: <1619413336.26.0.680975027921.issue43941@roundup.psfhosted.org> Message-ID: <1619528518.93.0.632052213827.issue43941@roundup.psfhosted.org> Larry Hastings added the comment: Did that. Well, technically, I replaced two lines with the equivalent: % CFLAGS='-O0 -g3' ./configure I do see this in the Makefile: CONFIGURE_CFLAGS= -O0 -g3 so, I didn't screw it up! The test still failed: ===================================================================== FAIL: test_wrapper_call (test.test_gdb.PyBtTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/larry/src/python/buildtrunk/Lib/test/test_gdb.py", line 947, in test_wrapper_call self.assertRegex(gdb_output, AssertionError: Regex didn't match: ", v=) at Python/bltinmodule.c:1207\n1207\t{\nBreakpoint 2: file Objects/descrobject.c, line 1386.\n\nBreakpoint 2, wrapper_call (wp=, args=, kwds=) at Objects/descrobject.c:1386\n1386\t{\nTraceback (most recent call first):\n \n File "", line 4, in __init__\n File "", line 7, in \n' ---------------------------------------------------------------------- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 09:05:23 2021 From: report at bugs.python.org (Roy Smith) Date: Tue, 27 Apr 2021 13:05:23 +0000 Subject: [issue24258] BZ2File objects do not have name attribute In-Reply-To: <1432199816.0.0.178283144298.issue24258@psf.upfronthosting.co.za> Message-ID: <1619528723.76.0.994509240222.issue24258@roundup.psfhosted.org> Roy Smith added the comment: The https://bitbucket.org/cliff/cpython#python24258 URL 404's Looking at the attached bz2.py diff, I would change: if isinstance(filename, (str, bytes, os.PathLike)): self._fp = _builtin_open(filename, mode) + self.filename = filename self._closefp = True self._mode = mode_code to special-case os.PathLike and do: self.filename = str(filename) I would expect BZ2File.name to be a string. Returning a PathLike means lots of legitimate string methods will not work on it. Also, it should be "name" as an attribute, not "name()" as a method, to match other existing interfaces. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 09:17:51 2021 From: report at bugs.python.org (Sergei Lebedev) Date: Tue, 27 Apr 2021 13:17:51 +0000 Subject: [issue43953] InitVar should not be available on a @dataclass-decorated class In-Reply-To: <1619524440.38.0.385093329161.issue43953@roundup.psfhosted.org> Message-ID: <1619529471.43.0.436724550704.issue43953@roundup.psfhosted.org> Sergei Lebedev added the comment: I understand that this is a side-effect of having a default value, but I was hoping we could delattr InitVar's in @dataclass. I'm not aware of this causing problems, but it does feel a bit unsatisfying that InitVar's with defaults are kept in the class namespace. Do you see what could go wrong if we delete them? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 09:22:38 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 27 Apr 2021 13:22:38 +0000 Subject: [issue43953] InitVar should not be available on a @dataclass-decorated class In-Reply-To: <1619524440.38.0.385093329161.issue43953@roundup.psfhosted.org> Message-ID: <1619529758.61.0.601542546305.issue43953@roundup.psfhosted.org> Eric V. Smith added the comment: I'm not aware of what problems it would cause, but there's no doubt someone who's relying on it. Since it's a behavior of normal classes, changing it would violate dataclasses desire (not always realized) to have as little impact as possible on the class that it's decorating. You could add another decorator to do this, or handle it in a __post_init__ function if needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 09:40:33 2021 From: report at bugs.python.org (PEAR) Date: Tue, 27 Apr 2021 13:40:33 +0000 Subject: [issue43743] BlockingIOError: [Errno 11] Resource temporarily unavailable: on GPFS. In-Reply-To: <1617697291.82.0.0904085621091.issue43743@roundup.psfhosted.org> Message-ID: <1619530833.68.0.01935216884.issue43743@roundup.psfhosted.org> Change by PEAR : ---------- nosy: +PEAR _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 09:46:45 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Apr 2021 13:46:45 +0000 Subject: [issue43941] Unit test failure in test_gdb only with -O0 In-Reply-To: <1619413336.26.0.680975027921.issue43941@roundup.psfhosted.org> Message-ID: <1619531205.52.0.583841776417.issue43941@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I will try to reproduce this in other systems this afternoon. I trust that this fails, but we must know exactly what triggers this first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 09:47:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Apr 2021 13:47:19 +0000 Subject: [issue43636] test_descr fails randomly when executed with -R : In-Reply-To: <1616802835.56.0.699111570038.issue43636@roundup.psfhosted.org> Message-ID: <1619531239.58.0.840523416611.issue43636@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:11:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 14:11:19 +0000 Subject: [issue43864] [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead In-Reply-To: <1618578775.46.0.785924432695.issue43864@roundup.psfhosted.org> Message-ID: <1619532679.05.0.0559284468548.issue43864@roundup.psfhosted.org> STINNER Victor added the comment: commit 22556d84bca68a16e030e2337dcad80069d06f6b Author: Brett Cannon Date: Fri Apr 23 14:40:18 2021 -0700 Silence find_module() DeprecationWarning on Windows tests (GH-25563) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:12:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 14:12:08 +0000 Subject: [issue43864] [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead In-Reply-To: <1618578775.46.0.785924432695.issue43864@roundup.psfhosted.org> Message-ID: <1619532728.72.0.555104389244.issue43864@roundup.psfhosted.org> STINNER Victor added the comment: I reopen the issue for PR 25656. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:13:48 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Apr 2021 14:13:48 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1619532828.62.0.549000425458.issue37751@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +24350 pull_request: https://github.com/python/cpython/pull/25659 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:17:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 14:17:07 +0000 Subject: [issue26215] Make GC_Head a compile-time option In-Reply-To: <1453892927.49.0.620193472963.issue26215@psf.upfronthosting.co.za> Message-ID: <1619533027.59.0.329154914784.issue26215@roundup.psfhosted.org> STINNER Victor added the comment: I only saw yuriy_levchenko's request in 2016, it doesn't sound like a popular request. Disabling completely the GC is an invasive change, the GC is part of the Python semantics. I agree with Irit, this idea should be discussed on python-ideas first. I close this issue. Note: I moved the PyGC_Head structure to the internal C API in Python 3.9, see bpo-40241. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:17:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 14:17:45 +0000 Subject: [issue43868] Remove PyOS_ReadlineFunctionPointer from the stable ABI list In-Reply-To: <1618584508.44.0.195246221039.issue43868@roundup.psfhosted.org> Message-ID: <1619533065.4.0.84975810566.issue43868@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:19:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 14:19:43 +0000 Subject: [issue43520] Make Fraction(string) handle non-ascii slashes In-Reply-To: <1615918144.03.0.939769511159.issue43520@roundup.psfhosted.org> Message-ID: <1619533183.89.0.715077811802.issue43520@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:20:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 14:20:31 +0000 Subject: [issue28874] test_logging fails and freezes In-Reply-To: <1480923682.41.0.106352881958.issue28874@psf.upfronthosting.co.za> Message-ID: <1619533231.46.0.393873395487.issue28874@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:21:34 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 14:21:34 +0000 Subject: [issue43925] Add hangul syllables to unicodedata.decomposititon In-Reply-To: <1619199570.5.0.82333265185.issue43925@roundup.psfhosted.org> Message-ID: <1619533294.13.0.781893730429.issue43925@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:21:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 14:21:46 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1619533306.64.0.295504219065.issue43882@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:22:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 14:22:08 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1619533328.18.0.821402221986.issue38605@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:23:19 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 27 Apr 2021 14:23:19 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619533399.27.0.742097917462.issue43908@roundup.psfhosted.org> Guido van Rossum added the comment: Pablo, there seems to be some instability in the tests. Shreyan, Erlend, maybe merging in master would help? ---------- nosy: +Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:24:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 14:24:08 +0000 Subject: [issue8077] [Windows] cgi handling of POSTed files is broken in Windows In-Reply-To: <1267839820.97.0.586792235494.issue8077@psf.upfronthosting.co.za> Message-ID: <1619533448.89.0.475861101224.issue8077@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +Windows -Library (Lib) nosy: +paul.moore, steve.dower, tim.golden, zach.ware -vstinner title: cgi handling of POSTed files is broken in Windows -> [Windows] cgi handling of POSTed files is broken in Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:25:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 14:25:30 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1619533530.34.0.0613317268852.issue37751@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 531c81038e28b6cfa0f9791467bf671c88c6f4c4 by Miss Islington (bot) in branch '3.9': bpo-37751: Document codecs.lookup() change in What's New in Python 3.9 (GH-23096) (GH-25659) https://github.com/python/cpython/commit/531c81038e28b6cfa0f9791467bf671c88c6f4c4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:31:15 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 27 Apr 2021 14:31:15 +0000 Subject: [issue43766] Implement PEP 647 (User-Defined Type Guards) in typing.py In-Reply-To: <1617805670.27.0.185154049077.issue43766@roundup.psfhosted.org> Message-ID: <1619533875.86.0.805340686631.issue43766@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 05ab4b60ab3dae61ee75692b6624537d4f3fdf85 by Ken Jin in branch 'master': bpo-43766: Implement PEP 647 (User-Defined Type Guards) in typing.py (#25282) https://github.com/python/cpython/commit/05ab4b60ab3dae61ee75692b6624537d4f3fdf85 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:38:33 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 27 Apr 2021 14:38:33 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619534313.38.0.845287606978.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: I've not seen any failing tests for GH-25653 on the CI or on my computer. The PR is based off of 1b1f9852bda85c01ef124858f293e9c13e04ffce, which is pretty recent. I can rebase onto master, but I don't see any need for it as long as the tests suite passes and there's no conflicts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:40:46 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 27 Apr 2021 14:40:46 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1619534446.52.0.130420996081.issue43950@roundup.psfhosted.org> Mark Shannon added the comment: The additional cost will not only be the line number table, but we need to store the line for exceptions that are reraised after cleanup. Adding a column will mean more stack consumption. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:40:44 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 27 Apr 2021 14:40:44 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619534313.38.0.845287606978.issue43908@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Sure. What do you think is causing the failures for Shreyan then? (Are you two collaborating?) -- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:44:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Apr 2021 14:44:12 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1619534652.91.0.688635172857.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Yup, but I still think is worth the cost, giving that debugging improvements are usually extremely popular among users. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:44:57 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 27 Apr 2021 14:44:57 +0000 Subject: [issue43766] Implement PEP 647 (User-Defined Type Guards) in typing.py In-Reply-To: <1617805670.27.0.185154049077.issue43766@roundup.psfhosted.org> Message-ID: <1619534697.26.0.900052737817.issue43766@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +24351 pull_request: https://github.com/python/cpython/pull/25660 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:47:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Apr 2021 14:47:09 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619534829.13.0.353297947793.issue43908@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Pablo, there seems to be some instability in the tests. Apart from the typical test_asyncio random timeouts I don't see anything on the buildbots or the CI. What are those failing test? Maybe I can try to reproduce on my side ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 10:51:57 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 27 Apr 2021 14:51:57 +0000 Subject: [issue43947] lambdas stored with assignment expressions are unoptimized In-Reply-To: <1619489628.98.0.0361601429976.issue43947@roundup.psfhosted.org> Message-ID: <1619535117.75.0.401112996337.issue43947@roundup.psfhosted.org> Ken Jin added the comment: I'm unable to reproduce it on 3.10: >>> regass = lambda k: k in {None} >>> dis.dis(regass) 1 0 LOAD_FAST 0 (k) 2 LOAD_CONST 1 (frozenset({None})) 4 CONTAINS_OP 0 6 RETURN_VALUE >>> dis.dis(walrus:=lambda k: k in {None}) 1 0 LOAD_FAST 0 (k) 2 LOAD_CONST 1 (frozenset({None})) 4 CONTAINS_OP 0 6 RETURN_VALUE On 3.9 and 3.8, I'm able to reproduce your bug. ---------- nosy: +kj versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 11:01:55 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 27 Apr 2021 15:01:55 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619535715.32.0.180564255766.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: Let me re-run the test suite again and see if the tests have been fixed in the most recent commits. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 11:06:19 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 27 Apr 2021 15:06:19 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619535979.22.0.961793716433.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Shreyan, are you running the tests against the PR, or something else? Have you tried make clean (or git clean -fdx)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 11:08:09 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 27 Apr 2021 15:08:09 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619536089.92.0.16667344494.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > Are you two collaborating? No, but any help is of course appreciated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 11:12:32 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 27 Apr 2021 15:12:32 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619536352.41.0.771641661563.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: > Shreyan, are you running the tests against the PR, or something else? Have you tried make clean (or git clean -fdx)? I always have a clean branch checked out but the last time I ran the tests it was unsuccessful. I'm re-running the tests now and hoping that the tests will be successful this time. However lot of tests have been fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 11:36:20 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 27 Apr 2021 15:36:20 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619537780.34.0.0565379728243.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > I've not seen any failing tests for GH-25653 on the CI or on my computer. That would be GH-25520. GH-25653 is the slightly related issue/PR. Both are passing CI, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 11:37:16 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 27 Apr 2021 15:37:16 +0000 Subject: [issue17659] no way to determine First weekday (based on locale) In-Reply-To: <1365410883.64.0.172005963141.issue17659@psf.upfronthosting.co.za> Message-ID: <1619537836.85.0.731786137134.issue17659@roundup.psfhosted.org> ?ric Araujo added the comment: A core dev review is needed to get this feature into 3.10 before the freeze. ---------- nosy: +methane stage: patch review -> commit review versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 11:50:19 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 27 Apr 2021 15:50:19 +0000 Subject: [issue43954] Possible missing word on unittest doc In-Reply-To: <1619526068.5.0.0964164100817.issue43954@roundup.psfhosted.org> Message-ID: <1619538619.08.0.957740859377.issue43954@roundup.psfhosted.org> Raymond Hettinger added the comment: Yes, "specify" is likely the missing word. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 11:52:27 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 27 Apr 2021 15:52:27 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619538747.67.0.0676703698013.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: Re-running tests complete. I'm attaching the results. If the errors are not reproducible then please tell. I'll then rebuild and rerun the tests once more. ---------- Added file: https://bugs.python.org/file49994/tests_log.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 11:54:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 15:54:05 +0000 Subject: [issue43216] Removal of @asyncio.coroutine in Python 3.11 In-Reply-To: <1613234875.25.0.783359316655.issue43216@roundup.psfhosted.org> Message-ID: <1619538845.76.0.763303057046.issue43216@roundup.psfhosted.org> STINNER Victor added the comment: I suggest to wait for Python 3.11 to remove it. See the thread on python-dev: https://mail.python.org/archives/list/python-dev at python.org/thread/PLSLFTJXY2JUIRGJARBER4SRUWDXX2AQ/ ---------- nosy: +vstinner title: Removal of @asyncio.coroutine in Python 3.10 -> Removal of @asyncio.coroutine in Python 3.11 versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 11:55:09 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 27 Apr 2021 15:55:09 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619538909.69.0.0427270080935.issue43492@roundup.psfhosted.org> Steve Dower added the comment: I've pushed the new sources and retriggered the PR (a bit messily, because I tagged/labelled the wrong version number initially, but it's there now). So if it all passes then we're good from my POV. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 11:55:22 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 27 Apr 2021 15:55:22 +0000 Subject: [issue43766] Implement PEP 647 (User-Defined Type Guards) in typing.py In-Reply-To: <1617805670.27.0.185154049077.issue43766@roundup.psfhosted.org> Message-ID: <1619538922.31.0.199260309278.issue43766@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 99fdd782007db86f20aeb302b2ceaf79ce1ae2ba by Ken Jin in branch 'master': bpo-43766: Fix TypeGuard docs (#25660) https://github.com/python/cpython/commit/99fdd782007db86f20aeb302b2ceaf79ce1ae2ba ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 11:56:17 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 27 Apr 2021 15:56:17 +0000 Subject: [issue43864] [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead In-Reply-To: <1618578775.46.0.785924432695.issue43864@roundup.psfhosted.org> Message-ID: <1619538977.04.0.264827485845.issue43864@roundup.psfhosted.org> Steve Dower added the comment: New changeset e3bf179642a3445fb079454f382b93d0177f5012 by Shreyan Avigyan in branch 'master': bpo-43864: Silence deprecation warning in test_importlib.test_module_found and test_importlib.test_module_not_found (GH-25656) https://github.com/python/cpython/commit/e3bf179642a3445fb079454f382b93d0177f5012 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 11:56:23 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 27 Apr 2021 15:56:23 +0000 Subject: [issue43864] [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead In-Reply-To: <1618578775.46.0.785924432695.issue43864@roundup.psfhosted.org> Message-ID: <1619538983.91.0.343936458696.issue43864@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 11:59:43 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 27 Apr 2021 15:59:43 +0000 Subject: [issue43766] Implement PEP 647 (User-Defined Type Guards) in typing.py In-Reply-To: <1617805670.27.0.185154049077.issue43766@roundup.psfhosted.org> Message-ID: <1619539183.76.0.947743745585.issue43766@roundup.psfhosted.org> Ken Jin added the comment: Guido, thanks so much for reviewing the docs for TypeGuard so thoroughly even with how busy you are. I hope you enjoy your upcoming vacation :). I'm closing this issue as all PRs have landed. Please don't hesitate to re-open this if you feel something's amiss. Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 12:03:33 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 27 Apr 2021 16:03:33 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619538747.67.0.0676703698013.issue43908@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: I don't think I've ever successfully managed to complete the test on my Windows 10 box either (not even in "production" mode -- you seem to be using debug mode). I recommend using creating a new PR and having the CI machinery run the tests. It's more reliable that way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 12:04:45 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 27 Apr 2021 16:04:45 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619539485.15.0.29413705326.issue43492@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Thank you, Steve! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 12:05:29 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 27 Apr 2021 16:05:29 +0000 Subject: [issue43946] unpickling a subclass of list fails when it implements its own extend method In-Reply-To: <1619483582.32.0.0403635127136.issue43946@roundup.psfhosted.org> Message-ID: <1619539529.53.0.106788815629.issue43946@roundup.psfhosted.org> Gregory P. Smith added the comment: Thanks, that makes sense. And it at least less ugly than the __new__ hack I was thinking of as a workaround. though similar in spirit. presumably self.append should get the same treatment for completeness given the PEP 307 text. I didn't notice a place in the Python pickle docs that mentioned this specific thing about listitems and the need for append/extend. I didn't do a thorough read though, maybe I overlooked something? If not, it'd be worth figuring out how to get this uninitialized class calling of append/extend/__setitem__ for list and dict objects detailed in the main docs rather than off in the PEP. It's semi-mentioned https://docs.python.org/3/library/pickle.html#object.__reduce__ here which is what the PEP added I suppose, but given this code has no custom __reduce__, we need to explicitly mention that list and dict subclasses supporting pickling/copying may need to be prepared to handle this situation. With a versionchanged:: 3.7 noting that it now always applies to list subclasses without their own __reduce__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 12:18:17 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 27 Apr 2021 16:18:17 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619540297.93.0.184713748305.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: There are no errors in apply-to-all.diff because I've ran the tests both with and without the changes and both give me the same output. It's safe to proceed with apply-to-all.diff. The only problem is why are the tests failing at all? I ran the tests a few days earlier on this machine only (Windows 10) and it was successful then. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 12:24:12 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 27 Apr 2021 16:24:12 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619540652.63.0.507079252171.issue43492@roundup.psfhosted.org> Steve Dower added the comment: New changeset bf0c7c0147b73738cac63eb27ef48430284ff121 by Erlend Egeberg Aasland in branch 'master': bpo-43492: Upgrade Windows installer to use SQLite 3.35.5 (GH-25641) https://github.com/python/cpython/commit/bf0c7c0147b73738cac63eb27ef48430284ff121 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 12:56:16 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 27 Apr 2021 16:56:16 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619542576.38.0.820962658833.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: Since, these changes and the test failures are not related to each other at all, I'm opening a new issue addressing the test failures only. I'm adding everyone in this issue's nosy to the new issue's nosy as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:03:07 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 27 Apr 2021 17:03:07 +0000 Subject: [issue43955] Test Failures on Windows 10 Message-ID: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> New submission from Shreyan Avigyan : Recent test failures have been noticed on Windows 10. The full test log has been attached. The tests test_distutils, test_pdb, test_signal and test_threading require a little bit of attention since there seems to be some kind of error. ---------- components: Windows files: tests_log.txt messages: 392104 nosy: Guido.van.Rossum, Mark.Shannon, christian.heimes, corona10, erlendaasland, gvanrossum, pablogsal, paul.moore, serhiy.storchaka, shihai1991, shreyanavigyan, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: Test Failures on Windows 10 versions: Python 3.10 Added file: https://bugs.python.org/file49995/tests_log.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:04:33 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 27 Apr 2021 17:04:33 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619543073.29.0.319532024389.issue43955@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- nosy: -erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:07:31 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 27 Apr 2021 17:07:31 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619543251.78.0.715616391075.issue43955@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: -christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:08:03 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 27 Apr 2021 17:08:03 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619543283.49.0.841199579277.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: See issue https://bugs.python.org/issue43955 for the test failures. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:14:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Apr 2021 17:14:37 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619543677.0.0.802273912568.issue43955@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:19:24 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 27 Apr 2021 17:19:24 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619543964.97.0.751175960111.issue43492@roundup.psfhosted.org> Ned Deily added the comment: New changeset ce827816442613f982c356aa2f434c3c8a0c8917 by Erlend Egeberg Aasland in branch 'master': bpo-43492: Update macOS installer to use SQLite 3.35.5 (GH-25640) https://github.com/python/cpython/commit/ce827816442613f982c356aa2f434c3c8a0c8917 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:19:37 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Apr 2021 17:19:37 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619543977.73.0.876631020773.issue43492@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24353 pull_request: https://github.com/python/cpython/pull/25663 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:19:31 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Apr 2021 17:19:31 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619543971.75.0.866736336173.issue43492@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 10.0 -> 11.0 pull_requests: +24352 pull_request: https://github.com/python/cpython/pull/25662 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:22:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 27 Apr 2021 17:22:26 +0000 Subject: [issue19348] Building _testcapimodule as a builtin results in compile error In-Reply-To: <1382442846.46.0.759535198419.issue19348@psf.upfronthosting.co.za> Message-ID: <1619544146.35.0.291484866727.issue19348@roundup.psfhosted.org> Irit Katriel added the comment: I think this was fixed by https://github.com/python/cpython/commit/5c75f37d473140f0e0b7d9bf3a8c08343447ded1 which added "#undef Py_BUILD_CORE_MODULE" to _testcapimodule.c. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:24:06 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Apr 2021 17:24:06 +0000 Subject: [issue43947] lambdas stored with assignment expressions are unoptimized In-Reply-To: <1619489628.98.0.0361601429976.issue43947@roundup.psfhosted.org> Message-ID: <1619544246.63.0.44713189565.issue43947@roundup.psfhosted.org> Serhiy Storchaka added the comment: It was fixed in issue42282. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Constant folding is skipped in named expressions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:24:57 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 27 Apr 2021 17:24:57 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619544297.56.0.945343710208.issue43955@roundup.psfhosted.org> Guido van Rossum added the comment: I wonder if these four tests do something that affects all threads? The test driver module runs tests in parallel (if you ask it to run all or most tests, like the default). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:37:06 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Apr 2021 17:37:06 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619545026.84.0.493518862929.issue43492@roundup.psfhosted.org> miss-islington added the comment: New changeset e013d8df2c9b6ea5bc9ae92a10950157e6cb46d6 by Miss Islington (bot) in branch '3.8': bpo-43492: Update macOS installer to use SQLite 3.35.5 (GH-25640) https://github.com/python/cpython/commit/e013d8df2c9b6ea5bc9ae92a10950157e6cb46d6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:39:07 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Apr 2021 17:39:07 +0000 Subject: [issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib In-Reply-To: <1276292933.37.0.137444086026.issue8978@psf.upfronthosting.co.za> Message-ID: <1619545147.16.0.927214486224.issue8978@roundup.psfhosted.org> miss-islington added the comment: New changeset 9aea31deddf7458be3546f72185740f3cd06687f by Anthony Sottile in branch 'master': bpo-8978: improve tarfile.open error message when lzma / bz2 are missing (GH-24850) https://github.com/python/cpython/commit/9aea31deddf7458be3546f72185740f3cd06687f ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:42:19 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Apr 2021 17:42:19 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619545339.72.0.248108004163.issue43492@roundup.psfhosted.org> miss-islington added the comment: New changeset bf0736db455517412b0702b023dc71ed9de05d70 by Miss Islington (bot) in branch '3.9': [3.9] bpo-43492: Update macOS installer to use SQLite 3.35.5 (GH-25640) (GH-25662) https://github.com/python/cpython/commit/bf0736db455517412b0702b023dc71ed9de05d70 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:45:29 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 27 Apr 2021 17:45:29 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619545529.12.0.152606066671.issue43492@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24354 pull_request: https://github.com/python/cpython/pull/25665 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:49:41 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Tue, 27 Apr 2021 17:49:41 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619545781.49.0.496190109612.issue43492@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24355 pull_request: https://github.com/python/cpython/pull/25666 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 13:57:00 2021 From: report at bugs.python.org (Jouke Witteveen) Date: Tue, 27 Apr 2021 17:57:00 +0000 Subject: [issue43956] C-API: Incorrect default value for Py_SetProgramName Message-ID: <1619546220.77.0.781822360652.issue43956@roundup.psfhosted.org> New submission from Jouke Witteveen : The default program name is hardcoded in Python/initconfig.c:config_init_program_name. It is "python" on Windows, and "python3" elsewhere. The documentation currently suggests that it is "python" everywhere. Additionally, the documentation currently says: > The argument should point to a zero-terminated wide character string in static storage whose contents will not change for the duration of the program?s execution. The code, however, duplicates the string, so I am not sure this is true. ---------- assignee: docs at python components: Documentation messages: 392113 nosy: docs at python, joukewitteveen priority: normal pull_requests: 24356 severity: normal status: open title: C-API: Incorrect default value for Py_SetProgramName versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 14:13:55 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 27 Apr 2021 18:13:55 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619547235.45.0.864144563153.issue43955@roundup.psfhosted.org> Shreyan Avigyan added the comment: Pdb error source - https://github.com/python/cpython/blob/9aea31deddf7458be3546f72185740f3cd06687f/Lib/test/test_pdb.py#L1270 This is where the error in Pdb is originating from. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 14:21:29 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 27 Apr 2021 18:21:29 +0000 Subject: [issue43532] Add keyword-only fields to dataclasses In-Reply-To: <1616002761.92.0.652624260802.issue43532@roundup.psfhosted.org> Message-ID: <1619547689.67.0.818180242301.issue43532@roundup.psfhosted.org> Eric V. Smith added the comment: > Will this close https://bugs.python.org/issue36077 ? No, not directly, although I'm going to close that issue as "won't fix". But you can specify that the child class requires all params as kw_only. Continuing the example: >>> @dataclass(kw_only=True) ... class Child(Parent): ... y: int ... >>> Child(0, y=1) Child(x=0, y=1) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 14:23:03 2021 From: report at bugs.python.org (Vladimir Matveev) Date: Tue, 27 Apr 2021 18:23:03 +0000 Subject: [issue43563] Use dedicated opcodes to speed up calls/attribute lookups with super() as receiver In-Reply-To: <1616187477.95.0.162642980766.issue43563@roundup.psfhosted.org> Message-ID: <1619547783.79.0.475666436904.issue43563@roundup.psfhosted.org> Vladimir Matveev added the comment: Apologies for the delay in reply: in more concrete numbers for IG codebase enabling this optimization resulted in 0.2% CPU win. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 14:23:05 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 27 Apr 2021 18:23:05 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619547785.26.0.368624117749.issue43955@roundup.psfhosted.org> Shreyan Avigyan added the comment: The test expects the but gets sigint_handler method of a pdb.Pdb instance instead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 14:37:18 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 27 Apr 2021 18:37:18 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619547785.26.0.368624117749.issue43955@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Can you submit a PR that fixes it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 14:47:00 2021 From: report at bugs.python.org (Tim Peters) Date: Tue, 27 Apr 2021 18:47:00 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619549220.07.0.271232108667.issue43955@roundup.psfhosted.org> Tim Peters added the comment: I expect parallelism is a red herring: early in the test output attached to this report: 0:00:04 Run tests sequentially and there's no other evidence in the output that multiple tests are running simultaneously. Also on Win10, the 4 failing tests here pass for me if I run them one at a time, so it's not obvious. I _suspect_ that what's going wrong with test_pdb is the root cause: every now & again, for some weeks now, when I try to run tests on Windows I come back to the cmd.exe window and see that it's just sitting there, waiting at a pdb prompt. In the output attached to this report, note that after test_threading starts, (Pdb) continue (Pdb) continue (Pdb) continue (Pdb) continue appears out of the blue. But test_pdb is long finished by that time. But I'm clueless about current pdb internals. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 14:55:51 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 27 Apr 2021 18:55:51 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619549751.64.0.464799092322.issue43955@roundup.psfhosted.org> Shreyan Avigyan added the comment: Yes you're right. Running the failed tests individually does not trigger the errors. And the (Pdb) continue (Pdb) continue (Pdb) continue (Pdb) continue actually is manually entered by me. My tests also stop at that prompt but somehow entering these commands again allow us to continue. Why are the errors triggering at all? The tests that are failing when ran alongside the test suite haven't been messed with for a very long time now and still somehow out of the blue they are failing. Any thoughts? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 15:08:44 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 27 Apr 2021 19:08:44 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619549751.64.0.464799092322.issue43955@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Yes, I also see that pdb prompt. I recommend looking at what different configurations are used by test.libregrtest.main() when no tests are passed on the command line. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 15:11:08 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 27 Apr 2021 19:11:08 +0000 Subject: [issue43957] [Enum] update __contains__ to return True for valid values Message-ID: <1619550668.75.0.616141985831.issue43957@roundup.psfhosted.org> New submission from Ethan Furman : In 3.12 `__contains__` will check for both members and values: Color.RED in Color --> True 1 in Color --> True 'RED' in Color --> False Add DeprecationWarning for now. ---------- assignee: ethan.furman messages: 392122 nosy: ethan.furman priority: normal severity: normal stage: needs patch status: open title: [Enum] update __contains__ to return True for valid values type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 15:21:17 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 27 Apr 2021 19:21:17 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1619551277.39.0.614341545108.issue43795@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +24357 pull_request: https://github.com/python/cpython/pull/25668 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 15:25:40 2021 From: report at bugs.python.org (Paul Moore) Date: Tue, 27 Apr 2021 19:25:40 +0000 Subject: [issue43958] Importlib.metadata docs claim PackagePath is a Path subclass Message-ID: <1619551540.42.0.304542326488.issue43958@roundup.psfhosted.org> New submission from Paul Moore : The importlib.metadata documentation states that the PackagePath class is "a pathlib.Path derived object". This isn't true - it's a PurePath subclass, and in particular it does not have a resolve() method. In fact, it has an undocumented custom locate() method that converts it into a Path object. I propose changing the documentation to make it clear that it is a PurePath subclass, and explicitly documenting the locate() method. ---------- assignee: docs at python components: Documentation messages: 392123 nosy: docs at python, paul.moore priority: normal severity: normal status: open title: Importlib.metadata docs claim PackagePath is a Path subclass type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 15:26:19 2021 From: report at bugs.python.org (Paul Moore) Date: Tue, 27 Apr 2021 19:26:19 +0000 Subject: [issue43958] Importlib.metadata docs claim PackagePath is a Path subclass In-Reply-To: <1619551540.42.0.304542326488.issue43958@roundup.psfhosted.org> Message-ID: <1619551579.89.0.528817434047.issue43958@roundup.psfhosted.org> Change by Paul Moore : ---------- keywords: +patch pull_requests: +24358 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25669 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 15:37:13 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 27 Apr 2021 19:37:13 +0000 Subject: [issue42957] os.readlink produces wrong result on windows In-Reply-To: <1610997189.12.0.447653130689.issue42957@roundup.psfhosted.org> Message-ID: <1619552233.04.0.0271170247845.issue42957@roundup.psfhosted.org> Change by Ethan Furman : ---------- nosy: +ethan.furman nosy_count: 6.0 -> 7.0 pull_requests: +24359 pull_request: https://github.com/python/cpython/pull/25670 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 15:57:13 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 27 Apr 2021 19:57:13 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619553433.11.0.383849910695.issue43492@roundup.psfhosted.org> Steve Dower added the comment: New changeset 5cadcec5ecf6f95cc771e509ad98c3e3533b32bb by Erlend Egeberg Aasland in branch '3.9': [3.9] bpo-43492: Upgrade Windows installer to use SQLite 3.35.5 (GH-25641) https://github.com/python/cpython/commit/5cadcec5ecf6f95cc771e509ad98c3e3533b32bb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 15:57:28 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 27 Apr 2021 19:57:28 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619553448.51.0.43239562845.issue43492@roundup.psfhosted.org> Steve Dower added the comment: New changeset 7f7cfc41185b651be9cb4d2759c40c3abf738485 by Erlend Egeberg Aasland in branch '3.8': [3.8] bpo-43492: Upgrade Windows installer to use SQLite 3.35.5 (GH-25641) https://github.com/python/cpython/commit/7f7cfc41185b651be9cb4d2759c40c3abf738485 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 15:57:52 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 27 Apr 2021 19:57:52 +0000 Subject: [issue43492] Upgrade to SQLite 3.35.5 in macOS and Windows In-Reply-To: <1615752732.27.0.278073347477.issue43492@roundup.psfhosted.org> Message-ID: <1619553472.37.0.560584459034.issue43492@roundup.psfhosted.org> Steve Dower added the comment: Thanks for the backports! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 15:58:45 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 27 Apr 2021 19:58:45 +0000 Subject: [issue42957] os.readlink produces wrong result on windows In-Reply-To: <1610997189.12.0.447653130689.issue42957@roundup.psfhosted.org> Message-ID: <1619553525.46.0.162779086186.issue42957@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: -24359 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 16:02:20 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 27 Apr 2021 20:02:20 +0000 Subject: [issue42957] os.readlink produces wrong result on windows In-Reply-To: <1610997189.12.0.447653130689.issue42957@roundup.psfhosted.org> Message-ID: <1619553740.71.0.501164576946.issue42957@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +24360 pull_request: https://github.com/python/cpython/pull/25670 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 16:04:10 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 27 Apr 2021 20:04:10 +0000 Subject: [issue43957] [Enum] update __contains__ to return True for valid values In-Reply-To: <1619550668.75.0.616141985831.issue43957@roundup.psfhosted.org> Message-ID: <1619553850.07.0.446860124836.issue43957@roundup.psfhosted.org> Change by Ethan Furman : ---------- keywords: +patch pull_requests: +24361 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25670 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 16:05:15 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 27 Apr 2021 20:05:15 +0000 Subject: [issue43957] [Enum] update __contains__ to return True for valid values In-Reply-To: <1619550668.75.0.616141985831.issue43957@roundup.psfhosted.org> Message-ID: <1619553915.53.0.430144926932.issue43957@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 6bd9288b805c765ec2433f66aa4d82e05767325f by Ethan Furman in branch 'master': bpo-43957: [Enum] Deprecate ``TypeError`` from containment checks. (GH-25670) https://github.com/python/cpython/commit/6bd9288b805c765ec2433f66aa4d82e05767325f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 16:06:34 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 27 Apr 2021 20:06:34 +0000 Subject: [issue42957] os.readlink produces wrong result on windows In-Reply-To: <1610997189.12.0.447653130689.issue42957@roundup.psfhosted.org> Message-ID: <1619553994.46.0.292337239838.issue42957@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: -24360 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 16:13:25 2021 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 27 Apr 2021 20:13:25 +0000 Subject: [issue43959] Improve documentation of PyContextVar C-API Message-ID: <1619554405.65.0.363572398331.issue43959@roundup.psfhosted.org> New submission from Stefan Behnel : The documentation of the PyContextVar C-API is unclear in a couple of places. - It's not clear whether PyContextVar_Get() always returns an owned reference also for default values or only if a value was found. - It's not explicit that "optional" actually means "pass an object reference or NULL". - The return value of PyContextVar_Set() is not explained. ---------- assignee: docs at python components: Documentation messages: 392128 nosy: docs at python, scoder priority: normal severity: normal status: open title: Improve documentation of PyContextVar C-API type: enhancement versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 16:17:00 2021 From: report at bugs.python.org (DaRoee) Date: Tue, 27 Apr 2021 20:17:00 +0000 Subject: [issue43939] Deadlock in logging In-Reply-To: <1619369926.8.0.917759570645.issue43939@roundup.psfhosted.org> Message-ID: <1619554620.79.0.973091396127.issue43939@roundup.psfhosted.org> DaRoee added the comment: Ha! Already gave them my analysis, and stopped using that package since. While I certainly think this is not the trivial, basic usage, and that the pattern used for the lock is common (and part of some PEP if I remember correctly), I'm kind of puzzled on that fact that context manager solves it. The test will pass constantly once the change is made (even though it looks like RLock __enter__ is just calling the acquire function), and I overall think this is a good change to do in the Handler class, even it's just for self.lock (can we find and understand why the last proposal was rejected?). I'll submit a PR in a few days, but was wondering on the usage of the lock, and that it doesn't always exists on `self`. Anyway, I assume these are questions that we can continue discussing in the PR if you also think this is a good direction.. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 16:20:21 2021 From: report at bugs.python.org (Stefan Behnel) Date: Tue, 27 Apr 2021 20:20:21 +0000 Subject: [issue43959] Improve documentation of PyContextVar C-API In-Reply-To: <1619554405.65.0.363572398331.issue43959@roundup.psfhosted.org> Message-ID: <1619554821.89.0.231443506695.issue43959@roundup.psfhosted.org> Change by Stefan Behnel : ---------- keywords: +patch pull_requests: +24362 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25671 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 16:46:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 20:46:45 +0000 Subject: [issue19348] Building _testcapimodule as a builtin results in compile error In-Reply-To: <1382442846.46.0.759535198419.issue19348@psf.upfronthosting.co.za> Message-ID: <1619556405.79.0.656626263995.issue19348@roundup.psfhosted.org> STINNER Victor added the comment: The C API was deeply reworked since 2013. This issue was reported in Python 2.7. I'm confident that it has been fixed in the meanwhile. ---------- resolution: out of date -> fixed stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 16:54:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 20:54:24 +0000 Subject: [issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib In-Reply-To: <1276292933.37.0.137444086026.issue8978@psf.upfronthosting.co.za> Message-ID: <1619556864.16.0.38962862623.issue8978@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 17:01:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 21:01:37 +0000 Subject: [issue43960] test_pdb fails when only some tests are run Message-ID: <1619557297.65.0.395512110368.issue43960@roundup.psfhosted.org> New submission from STINNER Victor : test_pdb fails with the following commands. I tested on Linux, same/similar failure on Windows. See also bpo-41914: "test_pdb fails". $ cat bisect test.test_pdb.PdbTestCase.test_run_module test.test_pdb.test_next_until_return_at_return_event test.test_pdb.test_pdb_next_command_in_generator_for_loop $ ./python -m test test_pdb --matchfile=bisect -v == CPython 3.10.0a7+ (heads/master:6bd9288b80, Apr 27 2021, 22:16:25) [GCC 11.0.1 20210324 (Red Hat 11.0.1-0)] == Linux-5.11.15-300.fc34.x86_64-x86_64-with-glibc2.33 little-endian == cwd: /home/vstinner/python/master/build/test_python_7720? == CPU count: 8 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 1.31 Run tests sequentially 0:00:00 load avg: 1.31 [1/1] test_pdb test_run_module (test.test_pdb.PdbTestCase) ... ok test_next_until_return_at_return_event (test.test_pdb) Doctest: test.test_pdb.test_next_until_return_at_return_event ... ok test_pdb_next_command_in_generator_for_loop (test.test_pdb) Doctest: test.test_pdb.test_pdb_next_command_in_generator_for_loop ... FAIL ====================================================================== FAIL: test_pdb_next_command_in_generator_for_loop (test.test_pdb) Doctest: test.test_pdb.test_pdb_next_command_in_generator_for_loop ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/python/master/Lib/doctest.py", line 2205, in runTest raise self.failureException(self.format_failure(new.getvalue())) AssertionError: Failed doctest test for test.test_pdb.test_pdb_next_command_in_generator_for_loop File "/home/vstinner/python/master/Lib/test/test_pdb.py", line 1182, in test_pdb_next_command_in_generator_for_loop ---------------------------------------------------------------------- File "/home/vstinner/python/master/Lib/test/test_pdb.py", line 1195, in test.test_pdb.test_pdb_next_command_in_generator_for_loop Failed example: with PdbTestInput(['break test_gen', 'continue', 'next', 'next', 'next', 'continue']): test_function() Expected: > (3)test_function() -> for i in test_gen(): (Pdb) break test_gen Breakpoint 1 at :1 (Pdb) continue > (2)test_gen() -> yield 0 (Pdb) next value 0 > (3)test_gen() -> return 1 (Pdb) next Internal StopIteration: 1 > (3)test_function() -> for i in test_gen(): (Pdb) next > (5)test_function() -> x = 123 (Pdb) continue Got: > (3)test_function() -> for i in test_gen(): (Pdb) break test_gen Breakpoint 2 at :1 (Pdb) continue > (2)test_gen() -> yield 0 (Pdb) next value 0 > (3)test_gen() -> return 1 (Pdb) next Internal StopIteration: 1 > (3)test_function() -> for i in test_gen(): (Pdb) next > (5)test_function() -> x = 123 (Pdb) continue ---------------------------------------------------------------------- Ran 3 tests in 0.186s FAILED (failures=1) test test_pdb failed test_pdb failed == Tests result: FAILURE == 1 test failed: test_pdb Total duration: 480 ms Tests result: FAILURE ---------- components: Tests messages: 392131 nosy: vstinner priority: normal severity: normal status: open title: test_pdb fails when only some tests are run versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 17:03:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 21:03:15 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619557395.87.0.676415260623.issue43955@roundup.psfhosted.org> STINNER Victor added the comment: File "C:\github\cpython\lib\test\test_distutils.py", line 15, in import distutils.tests File "C:\github\cpython\lib\contextlib.py", line 140, in __exit__ next(self.gen) File "C:\github\cpython\lib\test\support\warnings_helper.py", line 179, in _filterwarnings raise AssertionError("filter (%r, %s) did not catch any warning" % AssertionError: filter ('The distutils package is deprecated', DeprecationWarning) did not catch any warning Ah, test_distutils fails if distutils was already imported previously. The test should be fixed. """ test test_pdb failed -- Traceback (most recent call last): File "C:\github\cpython\lib\doctest.py", line 2205, in runTest raise self.failureException(self.format_failure(new.getvalue())) AssertionError: Failed doctest test for test.test_pdb.test_pdb_issue_20766 File "C:\github\cpython\lib\test\test_pdb.py", line 1270, in test_pdb_issue_20766 """ This is a surprising failure. No clue why test_pdb fails when other tests are run previously (when tests are run sequentially). See also bpo-43960 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 17:05:44 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 21:05:44 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619557544.53.0.753366957011.issue43955@roundup.psfhosted.org> STINNER Victor added the comment: Shreyan Avigyan: > And the "(Pdb) continue (...) actually is manually entered by me. Do you mean that you modified the Python source code? Does the issue go away if you revert your change or if you test a newly installed Python? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 17:15:39 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 27 Apr 2021 21:15:39 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619558139.71.0.951890134466.issue43955@roundup.psfhosted.org> Steve Dower added the comment: I think the test failures cascade, and some state is not being cleaned up. I'm trying to work through them now, but if someone else is as well, do say so and I'll find something else to do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 17:16:06 2021 From: report at bugs.python.org (Tim Peters) Date: Tue, 27 Apr 2021 21:16:06 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619558166.24.0.619381368195.issue43955@roundup.psfhosted.org> Tim Peters added the comment: Shreyan Avigyan: > And the "(Pdb) continue (...) actually is manually entered by me. Victor Stinner: Do you mean that you modified the Python source code? Me: Doubt it. For me, with more words: the "(Pdb) " prompt appears all by itself, by magic, and the test run is stuck then. I bet Shreyan meant to say "so I manually entered 'continue [RETURN]' at the pdb prompt to get it unstuck again". > Does the issue go away if you revert your change or > if you test a newly installed Python? For me, I was using Win10 x64 CPython built from yesterday's github master/main. And thanks for the distutils clue! I bet that one is a distinct issue. To make it more confusing, all 4 tests passed when I ran with `-j` (to force parallel test execution) - but then test_compileall failed instead :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 17:24:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 21:24:57 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619558697.98.0.326156088129.issue43955@roundup.psfhosted.org> STINNER Victor added the comment: > To make it more confusing, all 4 tests passed when I ran with `-j` (to force parallel test execution) - but then test_compileall failed instead :-) bpo-37387 "test_compileall fails randomly on Windows when tests are run in parallel" about random PermissionError. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 17:25:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 21:25:51 +0000 Subject: [issue43961] test_logging.test_namer_rotator_inheritance() logs a logging error Message-ID: <1619558751.24.0.0962393290712.issue43961@roundup.psfhosted.org> New submission from STINNER Victor : vstinner at DESKTOP-DK7VBIL C:\vstinner\python\master>python -m test test_logging -m test_namer_rotator_inheritance Running Debug|x64 interpreter... 0:00:00 Run tests sequentially 0:00:00 [1/1] test_logging --- Logging error --- Traceback (most recent call last): File "C:\vstinner\python\master\lib\logging\handlers.py", line 74, in emit self.doRollover() File "C:\vstinner\python\master\lib\logging\handlers.py", line 179, in doRollover self.rotate(self.baseFilename, dfn) File "C:\vstinner\python\master\lib\logging\handlers.py", line 117, in rotate self.rotator(source, dest) File "C:\vstinner\python\master\lib\test\test_logging.py", line 5222, in rotator os.rename(source, dest + ".rotated") FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\Users\\vstinner\\AppData\\Local\\Temp\\test_logging-2-tj71b t8k.log' -> 'C:\\Users\\vstinner\\AppData\\Local\\Temp\\test_logging-2-tj71bt8k.log.1.test.rotated' Call stack: File "C:\vstinner\python\master\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\vstinner\python\master\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\vstinner\python\master\lib\test\__main__.py", line 2, in main() File "C:\vstinner\python\master\lib\test\libregrtest\main.py", line 719, in main Regrtest().main(tests=tests, **kwargs) File "C:\vstinner\python\master\lib\test\libregrtest\main.py", line 641, in main self._main(tests, kwargs) File "C:\vstinner\python\master\lib\test\libregrtest\main.py", line 694, in _main self.run_tests() File "C:\vstinner\python\master\lib\test\libregrtest\main.py", line 521, in run_tests self.run_tests_sequential() File "C:\vstinner\python\master\lib\test\libregrtest\main.py", line 423, in run_tests_sequential result = runtest(self.ns, test_name) File "C:\vstinner\python\master\lib\test\libregrtest\runtest.py", line 194, in runtest return _runtest(ns, test_name) File "C:\vstinner\python\master\lib\test\libregrtest\runtest.py", line 154, in _runtest result = _runtest_inner(ns, test_name, File "C:\vstinner\python\master\lib\test\libregrtest\runtest.py", line 282, in _runtest_inner refleak = _runtest_inner2(ns, test_name) File "C:\vstinner\python\master\lib\test\libregrtest\runtest.py", line 246, in _runtest_inner2 test_runner() File "C:\vstinner\python\master\lib\test\support\__init__.py", line 682, in inner return func(*args, **kwds) File "C:\vstinner\python\master\lib\test\test_logging.py", line 5503, in test_main support.run_unittest(*tests) File "C:\vstinner\python\master\lib\test\support\__init__.py", line 1082, in run_unittest _run_suite(suite) File "C:\vstinner\python\master\lib\test\support\__init__.py", line 959, in _run_suite result = runner.run(suite) File "C:\vstinner\python\master\lib\test\support\testresult.py", line 169, in run test(self.result) File "C:\vstinner\python\master\lib\unittest\suite.py", line 84, in __call__ return self.run(*args, **kwds) File "C:\vstinner\python\master\lib\unittest\suite.py", line 122, in run test(result) File "C:\vstinner\python\master\lib\unittest\suite.py", line 84, in __call__ return self.run(*args, **kwds) File "C:\vstinner\python\master\lib\unittest\suite.py", line 122, in run test(result) File "C:\vstinner\python\master\lib\unittest\case.py", line 652, in __call__ return self.run(*args, **kwds) File "C:\vstinner\python\master\lib\unittest\case.py", line 592, in run self._callTestMethod(testMethod) File "C:\vstinner\python\master\lib\unittest\case.py", line 549, in _callTestMethod method() File "C:\vstinner\python\master\lib\test\test_logging.py", line 5229, in test_namer_rotator_inheritance rh.emit(self.next_rec()) Message: '2' Arguments: None == Tests result: SUCCESS == 1 test OK. Total duration: 1.1 sec Tests result: SUCCESS ---------- components: Tests messages: 392137 nosy: vinay.sajip, vstinner priority: normal severity: normal status: open title: test_logging.test_namer_rotator_inheritance() logs a logging error versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 17:27:02 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 21:27:02 +0000 Subject: [issue43961] test_logging.test_namer_rotator_inheritance() logs a logging error In-Reply-To: <1619558751.24.0.0962393290712.issue43961@roundup.psfhosted.org> Message-ID: <1619558822.43.0.567045559282.issue43961@roundup.psfhosted.org> STINNER Victor added the comment: Ah, I only see this output on Windows. On Linux, I don't see it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 17:27:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 21:27:14 +0000 Subject: [issue43961] [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error In-Reply-To: <1619558751.24.0.0962393290712.issue43961@roundup.psfhosted.org> Message-ID: <1619558834.64.0.593188770245.issue43961@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware title: test_logging.test_namer_rotator_inheritance() logs a logging error -> [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 17:27:34 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 21:27:34 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619558854.58.0.360022668427.issue43955@roundup.psfhosted.org> STINNER Victor added the comment: For test_logging test_namer_rotator_inheritance() error: I created bpo-43961 "[Windows] test_logging.test_namer_rotator_inheritance() logs a logging error". It doesn't like like an error and it only happens on Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 17:45:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 21:45:37 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619559937.56.0.863029587005.issue43955@roundup.psfhosted.org> STINNER Victor added the comment: Oh. I also got this surprising (Pdb) prompt when running "python -m test" on Windows. The prompt doesn't display any output, I only get the prompt display (...) 0:34:05 load avg: 1.06 [300/426/2] test_select 0:34:08 load avg: 1.03 [301/426/2] test_selectors 0:34:13 load avg: 0.94 [302/426/2] test_set 0:34:24 load avg: 0.80 [303/426/2] test_setcomps 0:34:26 load avg: 0.78 [304/426/2] test_shelve 0:34:30 load avg: 0.74 [305/426/2] test_shlex 0:34:32 load avg: 0.70 [306/426/2] test_shutil 0:34:36 load avg: 0.66 [307/426/2] test_signal (Pdb) help (Pdb) l (Pdb) ? (Pdb) help (Pdb) where (Pdb) down (Pdb) p 1 (Pdb) p 2 (Pdb) *But* I managed to get more info about that issue: (Pdb) f=open("debug.txt", "w") (Pdb) import traceback (Pdb) traceback.print_stack(file=f) (Pdb) f.flush() C:\vstinner\python\master\build\test_python_6260?\debug.txt content: (...) File "C:\vstinner\python\master\lib\test\libregrtest\runtest.py", line 154, in _runtest result = _runtest_inner(ns, test_name, (...) File "C:\vstinner\python\master\lib\unittest\case.py", line 549, in _callTestMethod method() File "C:\vstinner\python\master\lib\test\test_signal.py", line 1345, in test_sigint signal.raise_signal(signal.SIGINT) File "C:\vstinner\python\master\lib\unittest\case.py", line 216, in __exit__ def __exit__(self, exc_type, exc_value, tb): File "C:\vstinner\python\master\lib\bdb.py", line 92, in trace_dispatch return self.dispatch_call(frame, arg) File "C:\vstinner\python\master\lib\bdb.py", line 136, in dispatch_call self.user_call(frame, arg) File "C:\vstinner\python\master\lib\pdb.py", line 252, in user_call self.interaction(frame, None) File "C:\vstinner\python\master\lib\pdb.py", line 357, in interaction self._cmdloop() File "C:\vstinner\python\master\lib\pdb.py", line 322, in _cmdloop self.cmdloop() File "C:\vstinner\python\master\lib\cmd.py", line 138, in cmdloop stop = self.onecmd(line) File "C:\vstinner\python\master\lib\pdb.py", line 423, in onecmd return cmd.Cmd.onecmd(self, line) File "C:\vstinner\python\master\lib\cmd.py", line 216, in onecmd return self.default(line) File "C:\vstinner\python\master\lib\pdb.py", line 381, in default exec(code, globals, locals) File "", line 1, in Using debug.txt, I also see that in test_signal, sys.gettrace() = >. Lib/test/libregrtest/save_env.py is supposed to mark a test as "env changed" (ENV_CHANGED) if sys.gettrace() is changed between two tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 17:50:25 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 27 Apr 2021 21:50:25 +0000 Subject: [issue43955] Test Failures on Windows 10 In-Reply-To: <1619559937.56.0.863029587005.issue43955@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Doesn't the pdb prompt use the builtin input()? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 18:04:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 27 Apr 2021 22:04:50 +0000 Subject: [issue25817] modsupport: 'countformat' does not handle strings without bracket levels correctly In-Reply-To: <1449525315.43.0.771475082927.issue25817@psf.upfronthosting.co.za> Message-ID: <1619561090.26.0.13489146404.issue25817@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 18:14:14 2021 From: report at bugs.python.org (Zackery Spytz) Date: Tue, 27 Apr 2021 22:14:14 +0000 Subject: [issue43954] Possible missing word on unittest doc In-Reply-To: <1619526068.5.0.0964164100817.issue43954@roundup.psfhosted.org> Message-ID: <1619561654.46.0.956707037605.issue43954@roundup.psfhosted.org> Change by Zackery Spytz : ---------- keywords: +patch nosy: +ZackerySpytz nosy_count: 4.0 -> 5.0 pull_requests: +24363 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25672 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 18:14:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 27 Apr 2021 22:14:21 +0000 Subject: [issue26629] Need an ability to build standard DLLs with distutils In-Reply-To: <1458766467.89.0.930968148514.issue26629@psf.upfronthosting.co.za> Message-ID: <1619561661.7.0.595050794025.issue26629@roundup.psfhosted.org> Irit Katriel added the comment: distutils is deprecated and python 2.7 is past EOL. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 18:18:43 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 27 Apr 2021 22:18:43 +0000 Subject: [issue43954] Possible missing word on unittest doc In-Reply-To: <1619526068.5.0.0964164100817.issue43954@roundup.psfhosted.org> Message-ID: <1619561923.02.0.334171480472.issue43954@roundup.psfhosted.org> Inada Naoki added the comment: namespace package support is broken since Python 3.7. See https://bugs.python.org/issue23882#msg387549 We can not use namespace package even if top level directory is specified. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 18:30:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 22:30:03 +0000 Subject: [issue43955] Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619562603.16.0.958989041671.issue43955@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Test Failures on Windows 10 -> Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 18:47:30 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 27 Apr 2021 22:47:30 +0000 Subject: [issue43960] test_pdb fails when only some tests are run In-Reply-To: <1619557297.65.0.395512110368.issue43960@roundup.psfhosted.org> Message-ID: <1619563650.1.0.523951380092.issue43960@roundup.psfhosted.org> Irit Katriel added the comment: I have a fix, I'll make a PR in a bit. The issue here is the breakpoint number: Breakpoint 1 at _______________________________________ From report at bugs.python.org Tue Apr 27 18:52:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 27 Apr 2021 22:52:18 +0000 Subject: [issue43960] test_pdb fails when only some tests are run In-Reply-To: <1619557297.65.0.395512110368.issue43960@roundup.psfhosted.org> Message-ID: <1619563938.18.0.599753360052.issue43960@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +24364 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25673 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 18:55:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 22:55:01 +0000 Subject: [issue43962] test_interpreters: when test_id_type() is run alone, it fails with an assertion error Message-ID: <1619564101.64.0.809403769547.issue43962@roundup.psfhosted.org> New submission from STINNER Victor : Example on Linux. $ ./python -m test test_interpreters -m test.test_interpreters.TestInterpreterAttrs.test_id_type 0:00:00 load avg: 1.20 Run tests sequentially 0:00:00 load avg: 1.20 [1/1] test_interpreters python: Python/pystate.c:561: _PyInterpreterState_IDDecref: Assertion `interp->id_refcount != 0' failed. Fatal Python error: Aborted Current thread 0x00007f05eab42740 (most recent call first): File "/home/vstinner/python/master/Lib/unittest/case.py", line 549 in _callTestMethod File "/home/vstinner/python/master/Lib/unittest/case.py", line 592 in run File "/home/vstinner/python/master/Lib/unittest/case.py", line 652 in __call__ File "/home/vstinner/python/master/Lib/unittest/suite.py", line 122 in run File "/home/vstinner/python/master/Lib/unittest/suite.py", line 84 in __call__ File "/home/vstinner/python/master/Lib/unittest/suite.py", line 122 in run File "/home/vstinner/python/master/Lib/unittest/suite.py", line 84 in __call__ File "/home/vstinner/python/master/Lib/unittest/suite.py", line 122 in run File "/home/vstinner/python/master/Lib/unittest/suite.py", line 84 in __call__ File "/home/vstinner/python/master/Lib/test/support/testresult.py", line 169 in run File "/home/vstinner/python/master/Lib/test/support/__init__.py", line 959 in _run_suite File "/home/vstinner/python/master/Lib/test/support/__init__.py", line 1082 in run_unittest File "/home/vstinner/python/master/Lib/test/libregrtest/runtest.py", line 210 in _test_module File "/home/vstinner/python/master/Lib/test/libregrtest/runtest.py", line 246 in _runtest_inner2 File "/home/vstinner/python/master/Lib/test/libregrtest/runtest.py", line 282 in _runtest_inner File "/home/vstinner/python/master/Lib/test/libregrtest/runtest.py", line 154 in _runtest File "/home/vstinner/python/master/Lib/test/libregrtest/runtest.py", line 194 in runtest File "/home/vstinner/python/master/Lib/test/libregrtest/main.py", line 423 in run_tests_sequential File "/home/vstinner/python/master/Lib/test/libregrtest/main.py", line 521 in run_tests File "/home/vstinner/python/master/Lib/test/libregrtest/main.py", line 694 in _main File "/home/vstinner/python/master/Lib/test/libregrtest/main.py", line 641 in main File "/home/vstinner/python/master/Lib/test/libregrtest/main.py", line 719 in main File "/home/vstinner/python/master/Lib/test/__main__.py", line 2 in File "/home/vstinner/python/master/Lib/runpy.py", line 86 in _run_code File "/home/vstinner/python/master/Lib/runpy.py", line 196 in _run_module_as_main Extension modules: _testcapi, _xxsubinterpreters (total: 2) Abandon (core dumped) When the whole test case is run, it's fine: $ ./python -m test test_interpreters -m TestInterpreterAttrs -v == CPython 3.10.0a7+ (heads/master:6bd9288b80, Apr 27 2021, 22:16:25) [GCC 11.0.1 20210324 (Red Hat 11.0.1-0)] == Linux-5.11.15-300.fc34.x86_64-x86_64-with-glibc2.33 little-endian == cwd: /home/vstinner/python/master/build/test_python_16394? == CPU count: 8 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 1.39 Run tests sequentially 0:00:00 load avg: 1.39 [1/1] test_interpreters test_custom_id (test.test_interpreters.TestInterpreterAttrs) ... ok test_custom_isolated_default (test.test_interpreters.TestInterpreterAttrs) ... skipped 'not ready yet (see bpo-32604)' test_custom_isolated_explicit (test.test_interpreters.TestInterpreterAttrs) ... ok test_equality (test.test_interpreters.TestInterpreterAttrs) ... ok test_id_readonly (test.test_interpreters.TestInterpreterAttrs) ... ok test_id_type (test.test_interpreters.TestInterpreterAttrs) ... ok test_isolated_readonly (test.test_interpreters.TestInterpreterAttrs) ... ok test_main_id (test.test_interpreters.TestInterpreterAttrs) ... ok test_main_isolated (test.test_interpreters.TestInterpreterAttrs) ... skipped 'not ready yet (see bpo-32604)' test_subinterpreter_isolated_default (test.test_interpreters.TestInterpreterAttrs) ... skipped 'not ready yet (see bpo-32604)' test_subinterpreter_isolated_explicit (test.test_interpreters.TestInterpreterAttrs) ... ok ---------------------------------------------------------------------- Ran 11 tests in 0.159s OK (skipped=3) == Tests result: SUCCESS == 1 test OK. Total duration: 285 ms Tests result: SUCCESS ---------- components: Tests messages: 392145 nosy: eric.snow, nanjekyejoannah, vstinner priority: normal severity: normal status: open title: test_interpreters: when test_id_type() is run alone, it fails with an assertion error versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 18:55:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 22:55:36 +0000 Subject: [issue43962] test_interpreters: when TestInterpreterAttrs.test_id_type() is run alone, it fails with an assertion error In-Reply-To: <1619564101.64.0.809403769547.issue43962@roundup.psfhosted.org> Message-ID: <1619564136.34.0.0611840829124.issue43962@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: test_interpreters: when test_id_type() is run alone, it fails with an assertion error -> test_interpreters: when TestInterpreterAttrs.test_id_type() is run alone, it fails with an assertion error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 18:57:51 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 27 Apr 2021 22:57:51 +0000 Subject: [issue43960] test_pdb fails when only some tests are run In-Reply-To: <1619557297.65.0.395512110368.issue43960@roundup.psfhosted.org> Message-ID: <1619564271.53.0.878004797884.issue43960@roundup.psfhosted.org> Irit Katriel added the comment: I scanned the file and I think this was the only test where this was missing. test_pdb_continue_in_bottomframe doesn't have a reset, but it doesn't expect a specific breakpoint number, it does: Breakpoint ... at _______________________________________ From report at bugs.python.org Tue Apr 27 18:58:44 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 22:58:44 +0000 Subject: [issue43963] test_interpreters has side effects on test_signal Message-ID: <1619564324.1.0.88409924964.issue43963@roundup.psfhosted.org> New submission from STINNER Victor : vstinner at DESKTOP-DK7VBIL C:\vstinner\python\master>type bisect3 test.test_signal.RaiseSignalTest.test_handler test.test_interpreters.TestInterpreterAttrs.test_main_id test.test_interpreters.TestInterpreterClose.test_from_sibling vstinner at DESKTOP-DK7VBIL C:\vstinner\python\master>python -m test test_interpreters test_signal --matchfile=bisect3 -v Running Debug|x64 interpreter... == CPython 3.10.0a7+ (heads/master:6bd9288b80, Apr 27 2021, 22:54:42) [MSC v.1928 64 bit (AMD64)] == Windows-10-10.0.19042-SP0 little-endian == cwd: C:\vstinner\python\master\build\test_python_5756? == CPU count: 2 == encodings: locale=cp1252, FS=utf-8 0:00:00 Run tests sequentially 0:00:00 [1/2] test_interpreters test_main_id (test.test_interpreters.TestInterpreterAttrs) ... ok test_from_sibling (test.test_interpreters.TestInterpreterClose) ... ok ---------------------------------------------------------------------- Ran 2 tests in 0.277s OK 0:00:00 [2/2] test_signal test_handler (test.test_signal.RaiseSignalTest) ... ERROR ====================================================================== ERROR: test_handler (test.test_signal.RaiseSignalTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\vstinner\python\master\lib\signal.py", line 47, in signal handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler)) TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object ---------------------------------------------------------------------- Ran 1 test in 0.004s FAILED (errors=1) test test_signal failed test_signal failed == Tests result: FAILURE == 1 test OK. 1 test failed: test_signal Total duration: 689 ms Tests result: FAILURE ---------- components: Tests messages: 392147 nosy: vstinner priority: normal severity: normal status: open title: test_interpreters has side effects on test_signal versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 18:59:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 22:59:18 +0000 Subject: [issue43963] test_interpreters has side effects on test_signal In-Reply-To: <1619564324.1.0.88409924964.issue43963@roundup.psfhosted.org> Message-ID: <1619564358.97.0.432381538598.issue43963@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-43962: "test_interpreters: when TestInterpreterAttrs.test_id_type() is run alone, it fails with an assertion error". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 18:59:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 22:59:33 +0000 Subject: [issue43955] Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619564373.7.0.19996653882.issue43955@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-43963: "test_interpreters has side effects on test_signal". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 19:26:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 23:26:09 +0000 Subject: [issue43963] test_interpreters has side effects on test_signal In-Reply-To: <1619564324.1.0.88409924964.issue43963@roundup.psfhosted.org> Message-ID: <1619565969.37.0.941705042922.issue43963@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +24365 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25674 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 19:32:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 23:32:24 +0000 Subject: [issue43955] Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619566344.22.0.842846714184.issue43955@roundup.psfhosted.org> STINNER Victor added the comment: Running these 3 tests is enough to reproduce the issue: ------------------- vstinner at DESKTOP-DK7VBIL C:\vstinner\python\master>python -m test test_interpreters test_pdb test_threading Running Debug|x64 interpreter... 0:00:00 Run tests sequentially 0:00:00 [1/3] test_interpreters 0:00:04 [2/3] test_pdb test test_pdb failed -- Traceback (most recent call last): File "C:\vstinner\python\master\lib\doctest.py", line 2205, in runTest raise self.failureException(self.format_failure(new.getvalue())) AssertionError: Failed doctest test for test.test_pdb.test_pdb_issue_20766 File "C:\vstinner\python\master\lib\test\test_pdb.py", line 1270, in test_pdb_issue_20766 (...) 0:00:10 load avg: 0.03 [3/3/1] test_threading -- test_pdb failed (Pdb) ------------------- Moreover, my PR 25674 (bpo-43963) fix these tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 19:32:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 23:32:50 +0000 Subject: [issue43963] test_interpreters has side effects on test_signal In-Reply-To: <1619564324.1.0.88409924964.issue43963@roundup.psfhosted.org> Message-ID: <1619566370.09.0.884129198994.issue43963@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-43955: "Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 19:34:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 23:34:10 +0000 Subject: [issue43963] test_interpreters has side effects on test_signal In-Reply-To: <1619564324.1.0.88409924964.issue43963@roundup.psfhosted.org> Message-ID: <1619566450.25.0.895721081095.issue43963@roundup.psfhosted.org> STINNER Victor added the comment: This issue is a follow-up of bpo-41713: commit 7f9b25a21ab95f8cf8d663396993766307be475c Author: Victor Stinner Date: Tue Nov 17 23:28:25 2020 +0100 bpo-41713: Port _signal module to multi-phase init (GH-23355) Port the _signal extension module to the multi-phase initialization API (PEP 489). Co-Authored-By: Mohamed Koubaa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 19:34:44 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 23:34:44 +0000 Subject: [issue41713] _signal module leak: test_interpreters leaked [1424, 1422, 1424] references In-Reply-To: <1599213221.63.0.522110671593.issue41713@roundup.psfhosted.org> Message-ID: <1619566484.8.0.954284486594.issue41713@roundup.psfhosted.org> STINNER Victor added the comment: > bpo-41713: Port _signal module to multi-phase init (GH-23355) This change caused a regression: bpo-43963. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 19:40:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 23:40:30 +0000 Subject: [issue43955] Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619566830.41.0.414238945619.issue43955@roundup.psfhosted.org> STINNER Victor added the comment: FYI I used the following patch to debug this issue: diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index 872f121127..ee2e1ff77f 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py @@ -546,6 +546,8 @@ def _callSetUp(self): self.setUp() def _callTestMethod(self, method): + if sys.gettrace() is not None: + raise Exception("sys.gettrace() is not None") method() def _callTearDown(self): And I used the following script: --------------- import random import os.path import sys with open("tests") as fp: lines = list(filter(bool, (line.strip() for line in fp))) print(len(lines)) filename = "test" loop = 2 while os.path.exists(filename): filename = "test%s" % loop loop += 1 with open(filename, "w") as fp: for _ in range(5): test = random.choice(lines) print(test, file=fp) print("test_signal", file=fp) with open(filename) as fp: for line in fp: print(line.rstrip()) args = [sys.executable, "-m", "test", "--fromfile=" + filename] print("RUN", args) os.execv(args[0], args) --------------- I created the "tests" file using the command: python -m test --list-tests > tests Then I removed all tests starting at test_signal, including test_signal. I removed slow tests like asyncio and multiprocessing tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 19:50:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 23:50:08 +0000 Subject: [issue43963] test_interpreters has side effects on test_signal In-Reply-To: <1619564324.1.0.88409924964.issue43963@roundup.psfhosted.org> Message-ID: <1619567408.15.0.321876136988.issue43963@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a09766deab5aff549f40f27080895e148af922ed by Victor Stinner in branch 'master': bpo-43963: Fix import _signal in subinterpreters (GH-25674) https://github.com/python/cpython/commit/a09766deab5aff549f40f27080895e148af922ed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 19:51:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 27 Apr 2021 23:51:03 +0000 Subject: [issue43963] test_interpreters has side effects on test_signal In-Reply-To: <1619564324.1.0.88409924964.issue43963@roundup.psfhosted.org> Message-ID: <1619567463.35.0.278250327348.issue43963@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 20:05:17 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 28 Apr 2021 00:05:17 +0000 Subject: [issue43955] Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619568317.7.0.891928929498.issue43955@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +24366 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25675 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 20:07:48 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 28 Apr 2021 00:07:48 +0000 Subject: [issue43961] [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error In-Reply-To: <1619558751.24.0.0962393290712.issue43961@roundup.psfhosted.org> Message-ID: <1619568468.19.0.795280481962.issue43961@roundup.psfhosted.org> Steve Dower added the comment: What does os.rename do on Linux? Does it just overwrite existing files by default? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 20:24:03 2021 From: report at bugs.python.org (Larry Hastings) Date: Wed, 28 Apr 2021 00:24:03 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619569443.2.0.991339125951.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: I think the PR is in good shape. If anybody has the time for a review, I'd appreciate it! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 20:32:18 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 28 Apr 2021 00:32:18 +0000 Subject: [issue43939] Deadlock in logging In-Reply-To: <1619369926.8.0.917759570645.issue43939@roundup.psfhosted.org> Message-ID: <1619569938.31.0.085296364233.issue43939@roundup.psfhosted.org> Raymond Hettinger added the comment: > I'm kind of puzzled on that fact that context manager solves it. It "solves" the problem because of the happenstance rather than because of language guarantees. The current implementation of the with-statement in CPython is to generate a SETUP_WITH opcode that calls both __enter__() and PyFrame_BlockSetup() within a single opcode while the GIL is held. And because RLlock.__enter__() is implemented in C there are no pure python steps before the block frame setup. If we added a pure Python __enter__ and __exit__ to the Handler class (necessary because a user can override createLock), then pure python steps would occur before the frame block setup and the problem would reappear. If RLock were implemented in pure python, the problem would also reappear. If the opcodes were changed so that the call to __enter__() were in a different opcode than setting up the block frame, the problem would reappear. > I'll submit a PR in a few days Let's wait to hear from Vinay and Nick before deciding to work on a PR. Since you are no longer using the package, you no longer have the problem to solve. The programming practice that gave rise to the problem is inherently fragile. The proposed mitigation only helps one module and doesn't solve the problem in general. As described above, the proposed mitigation is fragile and implementation specific. Lastly, it overrides an old decision to not use context managers in the logging module for reasons I no longer remember. ---------- assignee: -> vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 20:33:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 00:33:40 +0000 Subject: [issue43963] test_interpreters has side effects on test_signal In-Reply-To: <1619564324.1.0.88409924964.issue43963@roundup.psfhosted.org> Message-ID: <1619570020.33.0.58485748471.issue43963@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24367 pull_request: https://github.com/python/cpython/pull/25676 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 20:37:19 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Apr 2021 00:37:19 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1619570239.13.0.919717833846.issue37751@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24368 pull_request: https://github.com/python/cpython/pull/25677 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 20:37:09 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 28 Apr 2021 00:37:09 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1619570229.09.0.618175746364.issue37751@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 5c84bb506aaca01f5f750116d8f7a41d41f8124d by Inada Naoki in branch 'master': bpo-37751: Update `codecs.register()` doc. (GH-25643) https://github.com/python/cpython/commit/5c84bb506aaca01f5f750116d8f7a41d41f8124d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 21:03:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 01:03:04 +0000 Subject: [issue43963] test_interpreters has side effects on test_signal In-Reply-To: <1619564324.1.0.88409924964.issue43963@roundup.psfhosted.org> Message-ID: <1619571784.68.0.472516994554.issue43963@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a5e64444e6df7d1d498576bab26deaddc288a7bd by Victor Stinner in branch 'master': bpo-43963: Add _signal module state (GH-25676) https://github.com/python/cpython/commit/a5e64444e6df7d1d498576bab26deaddc288a7bd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 27 22:26:18 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 28 Apr 2021 02:26:18 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1619576778.15.0.221290546519.issue37751@roundup.psfhosted.org> Inada Naoki added the comment: New changeset cf9d65c5af7905d9e9945a297dbbf15d3bcace15 by Miss Islington (bot) in branch '3.9': bpo-37751: Update `codecs.register()` doc. (GH-25643) https://github.com/python/cpython/commit/cf9d65c5af7905d9e9945a297dbbf15d3bcace15 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 00:39:28 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 28 Apr 2021 04:39:28 +0000 Subject: [issue37892] IDLE Shell: isolate user code input In-Reply-To: <1566301123.94.0.491748175182.issue37892@roundup.psfhosted.org> Message-ID: <1619584768.43.0.0115741622169.issue37892@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +24369 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25678 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 01:02:14 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 28 Apr 2021 05:02:14 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619586134.8.0.92306675862.issue43901@roundup.psfhosted.org> Jelle Zijlstra added the comment: For what it's worth, I checked grep.app and found only one usage of del on __annotations__, in a test suite: https://github.com/go-python/gpython/blob/master/py/tests/function.py#L82. Changing its behavior seems very low risk. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 01:07:12 2021 From: report at bugs.python.org (Ammar Askar) Date: Wed, 28 Apr 2021 05:07:12 +0000 Subject: [issue43888] GitHub Actions CI/CD `Coverage` job is broken on master In-Reply-To: <1618833046.45.0.972351861197.issue43888@roundup.psfhosted.org> Message-ID: <1619586432.34.0.650538621795.issue43888@roundup.psfhosted.org> Change by Ammar Askar : ---------- pull_requests: +24370 pull_request: https://github.com/python/cpython/pull/25679 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 02:18:26 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 28 Apr 2021 06:18:26 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1619590705.99.0.259082743779.issue37903@roundup.psfhosted.org> Terry J. Reedy added the comment: The base issue #37892 is about moving the IDLE Shell prompt away from the first line of user code input, so that code starts at the margin where continuation lines start and we can use space indents. I said the prompt could either go left, into a sidebar, or up, on a line by itself. I opened this sub-isssue for the first option and Tal surprised me a few days later with a patch. I expected a few months of development, but we were stuck last fall with mysterious Pipelines failures on Ubuntu and Windows. I discoverer yesterday that the failures were due to Pipelines stealing sys.stdout output that was supposed to go to the Shell being tested. The tests now pass and I believe PR 22682 is about ready for the beta next Monday. Today I implemented the second option; it only took 3 simple changes on 3 lines. PR 25678 for #37892. I have tested with single and multiline statements, without and with debugger on, and all seems ok so far. I am not surprised because indents now use the well-tested editor branch in the newline_and_indent_event method. So I think this is also ready for the beta. For me, either fix is a pleasure to use and a relief, like having tiny thorn removed after 15 years. Anyone with a local repository can make a couple of branch to test now. Or wait until next week. My intention is to merge one or both options into 3.10.0b1 and allow user testing and feedback, further patching, and another beta release before backporting to 3.9 (perhaps late next June). It is too late for 3.8. Tal, I completely agree with not switching between straight margin and space indents versus the mis-design of an uneven margin and tab intents. But I want the option of using either improved mode for myself as well as others. I think Shell will have be cleared and restarted when switching. Raymond, about interactive sessions for the docs: some have secondary prompts, some do not. The sorting how-to uses the former. (Would you like some .rst markup included?) I don't know if the latter always have the same format. I have long thought that there should be several output formats for a shell session, including one ready to run. But no patches yet that I know of, or even any exactly specified requests. Anyway, anything possible before should remain possible. What is needed is a shell parser (for each mode) that would yield a sequence of code, traceback, and output objects. Then various document builders could be written. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 02:18:36 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 28 Apr 2021 06:18:36 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1619590716.78.0.693210097027.issue37903@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 02:28:51 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 28 Apr 2021 06:28:51 +0000 Subject: [issue43955] Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619591331.16.0.837182756635.issue43955@roundup.psfhosted.org> Shreyan Avigyan added the comment: Another issue with the tests is that it has become terribly slow. It's taking about 45 minutes to complete 1 run of the test suite. A few days ago, it took only 10 - 15 minutes. And moreover I think test_threading is also modifying sys.gettrace. The logs have the full error message. --Snippet-- 0:33:17 load avg: 0.80 [307/426/2] test_signal (Pdb) continue Warning -- sys.gettrace was modified by test_signal Before: None After: > test test_signal failed -- Traceback (most recent call last): File "C:\github\cpython\lib\test\test_signal.py", line 1345, in test_sigint signal.raise_signal(signal.SIGINT) AssertionError: KeyboardInterrupt not raised --Snippet-- 0:38:22 load avg: 0.04 [353/426/3] test_threading (Pdb) continue (Pdb) continue (Pdb) continue (Pdb) continue Warning -- sys.gettrace was modified by test_threading Before: None After: > --Snippet-- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 02:55:13 2021 From: report at bugs.python.org (Julien Palard) Date: Wed, 28 Apr 2021 06:55:13 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1619592913.31.0.64504639827.issue42238@roundup.psfhosted.org> Julien Palard added the comment: I should have monitored this more closely, I started monitoring it weekly, then life got over until today when I'm even surprised to see activity on the issue, sry! (Surprise leading me to investigate why I had not received notifications from bpo, leading me to a bug in my sieve filter...) I counted, during your releases `make suspicious` spotted: - 1 true positive in 20ac34772aa9805ccbf082e700f2b033291ff5d2 - 1 false positive in 20ac34772aa9805ccbf082e700f2b033291ff5d2 - 1 true positive in 57f21db3f629649dbd7c4531078b6a2104896411 - 1 false positive in de833b601319da15d90c8f3cd3c44d239d6d5924 if I missed none, the success ratio is not good (which is already known). What I'm aiming to do in this issue is to list the true positives over time, by passing the tool manually from time to time, to try to see what kind of rule is usefull in such a tool, and ultimately try to spot those errors in a reliable way. I'd go for removing it from both release process and the CI, this would lower pressure on RMs and contributors, while easing the study of the tool in this issue. I even consider removing it from the Makefile / tools hierarchy to ensure nobody runs it, because if someone run it locally during its contribution process it may hide true positives from me (leading me to think there's no true positives and the tool is useless). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 02:59:01 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 28 Apr 2021 06:59:01 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1619593141.24.0.316634051523.issue41486@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset f9bedb630e8a0b7d94e1c7e609b20dfaa2b22231 by Ma Lin in branch 'master': bpo-41486: Faster bz2/lzma/zlib via new output buffering (GH-21740) https://github.com/python/cpython/commit/f9bedb630e8a0b7d94e1c7e609b20dfaa2b22231 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 03:03:16 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 28 Apr 2021 07:03:16 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1619593396.91.0.174048102865.issue41486@roundup.psfhosted.org> Gregory P. Smith added the comment: Thanks, this is great work! Especially when living within the constraints of C and the existing code. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 03:12:10 2021 From: report at bugs.python.org (Ma Lin) Date: Wed, 28 Apr 2021 07:12:10 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1619593930.99.0.570335106522.issue41486@roundup.psfhosted.org> Ma Lin added the comment: Thanks for reviewing this big patch. Your review makes the code better. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 03:19:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 28 Apr 2021 07:19:21 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619594361.52.0.0406991103117.issue43916@roundup.psfhosted.org> Serhiy Storchaka added the comment: Is it ok to skip tests if it is too hard to write them. Tests should be decorated with @cpython_only because other Python implementations can have working constructors for these types. It is an implementation detail that these types are implemented in C and instances are not properly initialized by default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 03:20:36 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 28 Apr 2021 07:20:36 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619594436.65.0.540746740057.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Thanks, Serhiy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 03:59:22 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 28 Apr 2021 07:59:22 +0000 Subject: [issue43776] Popen with shell=True yield mangled repr output In-Reply-To: <1617907343.84.0.247878991461.issue43776@roundup.psfhosted.org> Message-ID: <1619596762.55.0.60208970516.issue43776@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- keywords: +3.9regression _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 04:16:44 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Apr 2021 08:16:44 +0000 Subject: [issue43776] Popen with shell=True yield mangled repr output In-Reply-To: <1617907343.84.0.247878991461.issue43776@roundup.psfhosted.org> Message-ID: <1619597804.76.0.0775788960915.issue43776@roundup.psfhosted.org> miss-islington added the comment: New changeset db0c5b786df961785ae8c803f5572ae0c8dadcc7 by M. Kocher in branch 'master': bpo-43776: Remove list call from args in Popen repr (GH-25338) https://github.com/python/cpython/commit/db0c5b786df961785ae8c803f5572ae0c8dadcc7 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 04:17:45 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 28 Apr 2021 08:17:45 +0000 Subject: [issue43954] Possible missing word on unittest doc In-Reply-To: <1619526068.5.0.0964164100817.issue43954@roundup.psfhosted.org> Message-ID: <1619597865.92.0.407589436929.issue43954@roundup.psfhosted.org> Inada Naoki added the comment: I propose to remove the namespace package support entirely. * No user (since it has been broken from Python 3.7) * Hard to maintain (we haven't noted it) * Hard to explain (need to specify the top directory. don't search recursively. See bpo-23882) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 04:39:49 2021 From: report at bugs.python.org (Victor Lazzarini) Date: Wed, 28 Apr 2021 08:39:49 +0000 Subject: [issue43964] ctypes CDLL search path issue on MacOS Message-ID: <1619599189.53.0.161750349555.issue43964@roundup.psfhosted.org> New submission from Victor Lazzarini : With Python 3.9.4 ctypes.CDLL does not appear to find framework libraries installed in /Library/Frameworks. --- With Python 3.6.5: victor at MacBook-Pro ~ % python3 Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 03:03:55) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes >>> ctypes.CDLL('CUDA.framework/CUDA') >>> --- With Python 3.9.4 victor at MacBook-Pro ~ % python3.9 Python 3.9.4 (v3.9.4:1f2e3088f3, Apr 4 2021, 12:32:44) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes >>> ctypes.CDLL('CUDA.framework/CUDA') Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 374, in __init__ self._handle = _dlopen(self._name, mode) OSError: dlopen(CUDA.framework/CUDA, 6): image not found >>> This happens with all frameworks I have installed in /Library/Frameworks. The full path seems to work OK: >>> ctypes.CDLL('/Library/Frameworks/CUDA.framework/CUDA') >>> but that's suboptimal as in MacOS you might have frameworks installed elsewhere. ---------- components: macOS messages: 392173 nosy: Victor.Lazzarini, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: ctypes CDLL search path issue on MacOS versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 05:34:28 2021 From: report at bugs.python.org (Sebastian Speitel) Date: Wed, 28 Apr 2021 09:34:28 +0000 Subject: [issue43965] dataclasses.replace breaks when __init__ is overrriden in subclass Message-ID: <1619602468.72.0.276909030716.issue43965@roundup.psfhosted.org> New submission from Sebastian Speitel : from dataclasses import dataclass, replace @dataclass() class A: a: int class B(A): def __init__(self): super().__init__(a=1) obj1 = B() obj2 = replace(obj1, a=2) File "/usr/lib/python3.9/dataclasses.py", line 1284, in replace return obj.__class__(**changes) TypeError: __init__() got an unexpected keyword argument 'a' When a class extends a dataclass and overrides `__init__`, `replace` still accepts it as a dataclass according to the PEP but fails at constructing, since the `__init__`-signature doesn't match anymore. ---------- components: Library (Lib) messages: 392174 nosy: SebastianSpeitel priority: normal severity: normal status: open title: dataclasses.replace breaks when __init__ is overrriden in subclass type: behavior versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 05:43:54 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 28 Apr 2021 09:43:54 +0000 Subject: [issue43965] dataclasses.replace breaks when __init__ is overrriden in subclass In-Reply-To: <1619602468.72.0.276909030716.issue43965@roundup.psfhosted.org> Message-ID: <1619603034.23.0.00101729566858.issue43965@roundup.psfhosted.org> Eric V. Smith added the comment: I'm open to suggestions on how this could be fixed, but I don't see how it's possible. I guess the best thing to do would be to fail if __init__() isn't the one that was generated by @dataclass. But that might be too pessimistic: the user could have provided a __init__() that does work with replace(), and such a change would start breaking that code. ---------- assignee: -> eric.smith nosy: +eric.smith versions: +Python 3.10 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 05:56:14 2021 From: report at bugs.python.org (Sebastian Speitel) Date: Wed, 28 Apr 2021 09:56:14 +0000 Subject: [issue43965] dataclasses.replace breaks when __init__ is overrriden in subclass In-Reply-To: <1619602468.72.0.276909030716.issue43965@roundup.psfhosted.org> Message-ID: <1619603774.32.0.102140847794.issue43965@roundup.psfhosted.org> Sebastian Speitel added the comment: One solution I thought of was to return not an object of the same instance, but one of the same dataclass, which would allow the implementation to traverse the class hierachy of the object and create an instance of the first dataclass-class (or class with same __init__ signature) it finds with the changes applied. This would at least allow using replace instead of it just failing in more cases. But according to the PEP > Creates a new object of the same type of [the] instance the returned object has to have the same type. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 06:03:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 10:03:10 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1619604190.18.0.149058581194.issue42238@roundup.psfhosted.org> STINNER Victor added the comment: At least, I would suggest to remove it from the release process. If some people working on the documentation want to keep the tool, maybe it can be an optional CI job? IMO the problem is that currently, it's part of a single "Documentation" job. I don't recall if it's mandatory or not. Also, we need maybe more explanation in the CI job result how to mark false positives. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 06:07:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 10:07:12 +0000 Subject: [issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores. In-Reply-To: <1564832053.37.0.298269063007.issue37751@roundup.psfhosted.org> Message-ID: <1619604432.4.0.0415555506815.issue37751@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Inada-san for documenting the change in codecs.register() doc! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 06:14:08 2021 From: report at bugs.python.org (E. Paine) Date: Wed, 28 Apr 2021 10:14:08 +0000 Subject: [issue37892] IDLE Shell: isolate user code input In-Reply-To: <1566301123.94.0.491748175182.issue37892@roundup.psfhosted.org> Message-ID: <1619604848.08.0.894907672326.issue37892@roundup.psfhosted.org> E. Paine added the comment: Personally, I find the change quite weird and will take some getting used to. I hope people read the help at the top of the shell, but if not I can imagine numerous bug reports about the change. I have not used any shell that has the prompt above where you type, so while I think this should be an option for the user, I propose the sidebar is the default for familiarity (instead of the other way around). ---------- nosy: +epaine versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 06:17:45 2021 From: report at bugs.python.org (Sebastian Speitel) Date: Wed, 28 Apr 2021 10:17:45 +0000 Subject: [issue43965] dataclasses.replace breaks when __init__ is overrriden in subclass In-Reply-To: <1619602468.72.0.276909030716.issue43965@roundup.psfhosted.org> Message-ID: <1619605065.16.0.367747318884.issue43965@roundup.psfhosted.org> Sebastian Speitel added the comment: Or maybe a cls argument which defaults to obj.__class__? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 06:38:48 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Apr 2021 10:38:48 +0000 Subject: [issue43960] test_pdb fails when only some tests are run In-Reply-To: <1619557297.65.0.395512110368.issue43960@roundup.psfhosted.org> Message-ID: <1619606328.05.0.969798750444.issue43960@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +24371 pull_request: https://github.com/python/cpython/pull/25681 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 06:38:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 10:38:57 +0000 Subject: [issue43960] test_pdb fails when only some tests are run In-Reply-To: <1619557297.65.0.395512110368.issue43960@roundup.psfhosted.org> Message-ID: <1619606337.54.0.973651262839.issue43960@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 21b02b5f4018474620676be04310f7d230a464ea by Irit Katriel in branch 'master': bpo-43960: test_pdb resets breakpoints (GH-25673) https://github.com/python/cpython/commit/21b02b5f4018474620676be04310f7d230a464ea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 06:39:54 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Apr 2021 10:39:54 +0000 Subject: [issue43960] test_pdb fails when only some tests are run In-Reply-To: <1619557297.65.0.395512110368.issue43960@roundup.psfhosted.org> Message-ID: <1619606394.43.0.951695123794.issue43960@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24372 pull_request: https://github.com/python/cpython/pull/25682 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 06:46:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 10:46:24 +0000 Subject: [issue43955] Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619606784.16.0.733390682862.issue43955@roundup.psfhosted.org> STINNER Victor added the comment: Shreyan Avigyan: please try an up to date version of the master branch, I fixed the Pdb issue with commit a09766deab5aff549f40f27080895e148af922ed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 07:05:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 11:05:17 +0000 Subject: [issue43962] test_interpreters: when TestInterpreterAttrs.test_id_type() is run alone, it fails with an assertion error In-Reply-To: <1619564101.64.0.809403769547.issue43962@roundup.psfhosted.org> Message-ID: <1619607917.62.0.695804614942.issue43962@roundup.psfhosted.org> STINNER Victor added the comment: Creating an _interpreters.InterpreterID object calls newinterpid() which calls _PyInterpreterState_IDIncref(interp). _PyInterpreterState_IDIncref(interp) does nothing if interp->id_mutex is NULL. Calling _interpreters.get_current() calls interp_get_current() which calls _PyInterpreterState_IDInitref(). _PyInterpreterState_IDInitref() creates the id_mutex and initializes id_refcount to 0. Later, when the _interpreters.InterpreterID object is deallocated, interpid_dealloc() calls _PyInterpreterState_IDDecref(). Since id_mutex was created in the meanwhile, _PyInterpreterState_IDDecref() now decrements id_refcnt. ... It doesn't work: _PyInterpreterState_IDIncref() should always increase the reference count. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 07:13:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 11:13:48 +0000 Subject: [issue43962] test_interpreters: when TestInterpreterAttrs.test_id_type() is run alone, it fails with an assertion error In-Reply-To: <1619564101.64.0.809403769547.issue43962@roundup.psfhosted.org> Message-ID: <1619608428.97.0.430138507051.issue43962@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +24373 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25683 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 07:19:26 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 28 Apr 2021 11:19:26 +0000 Subject: [issue37892] IDLE Shell: isolate user code input In-Reply-To: <1566301123.94.0.491748175182.issue37892@roundup.psfhosted.org> Message-ID: <1619608766.12.0.483652693138.issue37892@roundup.psfhosted.org> Terry J. Reedy added the comment: I had a similar reaction, "weird", when I tried the isolated prompt a year or whatever ago. I don't remember if I also changed the indent for that. But when testing this patch, with space indents, a longer time, most of the weird feeling dissipated and I realized that I might possibly prefer this, at least sometimes. Another reason I proposed the isolated prompt as the *current* default is that some (many?) people like to save the shell as a record of their session. With prompts in the sidebar, saving the shell *currently* results in a text record with no prompts. (And, of course, no highlighting.) I can read it, but I expect that most people would prefer isolated prompts to no prompts I discussed the need for shell saving options both above and in msg392163, posted to #37904 a few hours ago. I do not currently expect anything before next Monday. If a followup PR, zipping the sidebar with text when saving, were prepared before then, I would be more favorable to making sidebar the current default. I plan to ask for more opinions on idle-dev and python-list later today. ---------- stage: patch review -> needs patch versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 07:23:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 11:23:48 +0000 Subject: [issue43961] [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error In-Reply-To: <1619558751.24.0.0962393290712.issue43961@roundup.psfhosted.org> Message-ID: <1619609028.01.0.468961860618.issue43961@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +24374 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25684 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 07:24:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 11:24:18 +0000 Subject: [issue43961] [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error In-Reply-To: <1619558751.24.0.0962393290712.issue43961@roundup.psfhosted.org> Message-ID: <1619609058.46.0.932540744329.issue43961@roundup.psfhosted.org> STINNER Victor added the comment: I wrote PR 25684 to fix this issue. > What does os.rename do on Linux? Does it just overwrite existing files by default? os.rename() calls rename(): https://man7.org/linux/man-pages/man2/rename.2.html rename() renames a file, moving it between directories if required. Any other hard links to the file (as created using link(2)) are unaffected. Open file descriptors for oldpath are also unaffected. If newpath already exists, it will be atomically replaced, so that there is no point at which another process attempting to access newpath will find it missing. However, there will probably be a window in which both oldpath and newpath refer to the file being renamed. On Windows, os.rename() is implemented with MoveFileExW(src, dst, 0). Maybe the test should use os.replace() instead of os.rename()? On Windows, os.replace() is implemented with with MoveFileExW(src, dst, MOVEFILE_REPLACE_EXISTING). HandlerWithNamerAndRotator.rotator() of test_logging calls os.rename() when the file already exists: if os.path.exists(source): os.rename(source, dest + ".rotated") And the test fails with "Cannot create a file when that file already exists"... well yes, we just tested that it exists. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 07:30:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 11:30:14 +0000 Subject: [issue43960] test_pdb fails when only some tests are run In-Reply-To: <1619557297.65.0.395512110368.issue43960@roundup.psfhosted.org> Message-ID: <1619609414.81.0.346407432678.issue43960@roundup.psfhosted.org> STINNER Victor added the comment: Irit: the automated backported failed, test_pdb fails with: NameError: name 'reset_Breakpoint' is not defined Do you want to try to backport manually the change to Python 3.9 (and then I can automate the backport to 3.8). test_pdb on Python 3.8 and 3.9 are also affected by this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 07:40:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 11:40:51 +0000 Subject: [issue43962] test_interpreters: when TestInterpreterAttrs.test_id_type() is run alone, it fails with an assertion error In-Reply-To: <1619564101.64.0.809403769547.issue43962@roundup.psfhosted.org> Message-ID: <1619610051.7.0.313867216306.issue43962@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 32c5a174445ec93747240cd8472012276ed27acf by Victor Stinner in branch 'master': bpo-43962: Fix _PyInterpreterState_IDIncref() (GH-25683) https://github.com/python/cpython/commit/32c5a174445ec93747240cd8472012276ed27acf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 07:41:03 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Apr 2021 11:41:03 +0000 Subject: [issue43962] test_interpreters: when TestInterpreterAttrs.test_id_type() is run alone, it fails with an assertion error In-Reply-To: <1619564101.64.0.809403769547.issue43962@roundup.psfhosted.org> Message-ID: <1619610063.04.0.746495407776.issue43962@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24375 pull_request: https://github.com/python/cpython/pull/25685 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 07:43:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 11:43:58 +0000 Subject: [issue43962] test_interpreters: when TestInterpreterAttrs.test_id_type() is run alone, it fails with an assertion error In-Reply-To: <1619564101.64.0.809403769547.issue43962@roundup.psfhosted.org> Message-ID: <1619610238.8.0.21033176367.issue43962@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24376 pull_request: https://github.com/python/cpython/pull/25686 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 08:08:06 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 28 Apr 2021 12:08:06 +0000 Subject: [issue43960] test_pdb fails when only some tests are run In-Reply-To: <1619557297.65.0.395512110368.issue43960@roundup.psfhosted.org> Message-ID: <1619611686.35.0.544603146582.issue43960@roundup.psfhosted.org> Irit Katriel added the comment: We didn't backport PR21989 because it was changing the way breakpoints hare maintained, so reset_Breakpoint is not there before 3.10. I can add that to the test file manually. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 08:17:01 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 28 Apr 2021 12:17:01 +0000 Subject: [issue43955] Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619612221.26.0.617130551087.issue43955@roundup.psfhosted.org> Shreyan Avigyan added the comment: Same errors. (Recompilation was done 1 or 2 hours ago against the then updated master branch. It may not include the latest commit) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 08:22:06 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 28 Apr 2021 12:22:06 +0000 Subject: [issue43955] Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619612526.04.0.0186969800866.issue43955@roundup.psfhosted.org> Shreyan Avigyan added the comment: FYI test_signal is no longer modifying sys.gettrace thanks to your fix. But test_threading still does. Do you have a fix for that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 08:33:57 2021 From: report at bugs.python.org (Amir) Date: Wed, 28 Apr 2021 12:33:57 +0000 Subject: [issue20692] Tutorial and FAQ: how to call a method on an int In-Reply-To: <1392850224.09.0.571764135364.issue20692@psf.upfronthosting.co.za> Message-ID: <1619613237.77.0.0908943040472.issue20692@roundup.psfhosted.org> Amir added the comment: Hi everyone! I'm going to work on it. I have a plan to submit my pull request in the upcoming weeks. Thanks. ---------- components: -Interpreter Core nosy: +Amir.Rastkhadiv20 versions: +Python 3.9 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 08:44:15 2021 From: report at bugs.python.org (GPH) Date: Wed, 28 Apr 2021 12:44:15 +0000 Subject: [issue43966] F String bugs with numpy.float32 Message-ID: <1619613855.19.0.40133405442.issue43966@roundup.psfhosted.org> New submission from GPH : When using F String with numpy.float32 variable, the output is wrong! Example code: ```python import numpy as np floatNumber = 0.00123 print(f"num:{floatNumber}") npFloatNumber = np.float32(0.00123) print(f"num:{npFloatNumber}") ``` The output is: ``` num:0.00123 num:0.001230000052601099 ``` As we can see, the value of np.float32 is wrong! ---------- messages: 392192 nosy: PingHGao priority: normal severity: normal status: open title: F String bugs with numpy.float32 type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 08:56:02 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 28 Apr 2021 12:56:02 +0000 Subject: [issue43966] F String bugs with numpy.float32 In-Reply-To: <1619613855.19.0.40133405442.issue43966@roundup.psfhosted.org> Message-ID: <1619614562.39.0.76021578608.issue43966@roundup.psfhosted.org> Mark Dickinson added the comment: See https://github.com/numpy/numpy/issues/10645. I'll close here (this tracker is for core Python, and NumPy isn't part of core Python). ---------- nosy: +mark.dickinson resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 09:13:05 2021 From: report at bugs.python.org (Stefan Behnel) Date: Wed, 28 Apr 2021 13:13:05 +0000 Subject: [issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled In-Reply-To: <1474611707.66.0.467568151114.issue28254@psf.upfronthosting.co.za> Message-ID: <1619615585.7.0.363702474082.issue28254@roundup.psfhosted.org> Change by Stefan Behnel : ---------- nosy: +scoder nosy_count: 3.0 -> 4.0 pull_requests: +24377 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25687 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 09:19:44 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 28 Apr 2021 13:19:44 +0000 Subject: [issue43955] Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619615984.23.0.798386107424.issue43955@roundup.psfhosted.org> Shreyan Avigyan added the comment: I ran the test again and test_signal still modifies sys.gettrace() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 09:43:16 2021 From: report at bugs.python.org (Stefan Behnel) Date: Wed, 28 Apr 2021 13:43:16 +0000 Subject: [issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled In-Reply-To: <1474611707.66.0.467568151114.issue28254@psf.upfronthosting.co.za> Message-ID: <1619617396.72.0.954930021037.issue28254@roundup.psfhosted.org> Stefan Behnel added the comment: I just remembered that it's usually helpful to return the previous state, so that callers know whether they need to re-enable or disable the GC when they're done. I'll add that. Also, returning an "int" may allow us to add a "-1" error code at some point, if it turns out to become necessary. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 09:44:54 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 28 Apr 2021 13:44:54 +0000 Subject: [issue43955] Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619617494.17.0.175538313384.issue43955@roundup.psfhosted.org> Shreyan Avigyan added the comment: All the test failures are side effects of other tests because when they are ran individually they do not trigger errors. Running sequentially causes the error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 09:48:04 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Apr 2021 13:48:04 +0000 Subject: [issue43961] [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error In-Reply-To: <1619558751.24.0.0962393290712.issue43961@roundup.psfhosted.org> Message-ID: <1619617684.88.0.500972295197.issue43961@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +24378 pull_request: https://github.com/python/cpython/pull/25688 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 09:47:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 13:47:01 +0000 Subject: [issue43962] test_interpreters: when TestInterpreterAttrs.test_id_type() is run alone, it fails with an assertion error In-Reply-To: <1619564101.64.0.809403769547.issue43962@roundup.psfhosted.org> Message-ID: <1619617621.13.0.0658310093007.issue43962@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 77db337f1e69213e62ba79a797540cc4ac23492e by Victor Stinner in branch '3.8': bpo-43962: Fix _PyInterpreterState_IDIncref() (GH-25683) (GH-25686) https://github.com/python/cpython/commit/77db337f1e69213e62ba79a797540cc4ac23492e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 09:47:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 13:47:15 +0000 Subject: [issue43961] [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error In-Reply-To: <1619558751.24.0.0962393290712.issue43961@roundup.psfhosted.org> Message-ID: <1619617635.17.0.844661234187.issue43961@roundup.psfhosted.org> STINNER Victor added the comment: New changeset fe52eb62191e640e720d184a9a1a04e965b8a062 by Victor Stinner in branch 'master': bpo-43961: Fix test_logging.test_namer_rotator_inheritance() (GH-25684) https://github.com/python/cpython/commit/fe52eb62191e640e720d184a9a1a04e965b8a062 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 09:53:21 2021 From: report at bugs.python.org (Simon Aldrich) Date: Wed, 28 Apr 2021 13:53:21 +0000 Subject: [issue43967] Valgrind memcheck on Py_Initialize Message-ID: <1619618001.66.0.42182617734.issue43967@roundup.psfhosted.org> New submission from Simon Aldrich : Running a Valgrind memcheck of Py_Initialize still produces issues even when using the suggested suppressions file. Am I doing something wrong or is this expected? I've attached a simple reproducer which can be run as follows: 1. Extract tarball 2. cmake 3. make memcheck (runs valgrind with suppressions) Gives output similar to: [100%] Built target valgrind-libpython ==2901== Memcheck, a memory error detector ==2901== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==2901== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info ==2901== Command: ./valgrind-libpython ==2901== ==2901== Conditional jump or move depends on uninitialised value(s) ==2901== at 0x5729DB7: __wcsnlen_avx2 (strlen-avx2.S:264) ==2901== by 0x5657CA1: wcsrtombs (wcsrtombs.c:104) ==2901== by 0x55DDC40: wcstombs (wcstombs.c:34) ==2901== by 0x4FB7EB9: _Py_EncodeLocaleRaw (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0) ==2901== by 0x4FB99F7: ??? (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0) ==2901== by 0x4FBB8B2: _PyPathConfig_Calculate (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0) ==2901== by 0x4FDAC8D: _PyConfig_InitPathConfig (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0) ==2901== by 0x4FE4F6E: PyConfig_Read (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0) ==2901== by 0x4FE687A: ??? (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0) ==2901== by 0x4FE79A1: Py_InitializeFromConfig (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0) ==2901== by 0x4FE7A5B: Py_InitializeEx (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0) ==2901== by 0x108758: main (in /home/simon/temp/valgrind-libpython/build/valgrind-libpython) ==2901== ==2901== Conditional jump or move depends on uninitialised value(s) ==2901== at 0x55C14E8: internal_utf8_loop (loop.c:298) ==2901== by 0x55C14E8: __gconv_transform_internal_utf8 (skeleton.c:609) ==2901== by 0x5657CD4: wcsrtombs (wcsrtombs.c:110) ==2901== by 0x55DDC40: wcstombs (wcstombs.c:34) ==2901== by 0x4FB7EB9: _Py_EncodeLocaleRaw (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0) ==2901== by 0x4FB99F7: ??? (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0) ==2901== by 0x4FBB8B2: _PyPathConfig_Calculate (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0) ==2901== by 0x4FDAC8D: _PyConfig_InitPathConfig (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0) ==2901== by 0x4FE4F6E: PyConfig_Read (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0) ==2901== by 0x4FE687A: ??? (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0) ==2901== by 0x4FE79A1: Py_InitializeFromConfig (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0) ==2901== by 0x4FE7A5B: Py_InitializeEx (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0) ==2901== by 0x108758: main (in /home/simon/temp/valgrind-libpython/build/valgrind-libpython)... ---------- components: C API, Library (Lib) files: valgrind-libpython.tar.gz messages: 392199 nosy: simonaldrich priority: normal severity: normal status: open title: Valgrind memcheck on Py_Initialize type: security versions: Python 3.8 Added file: https://bugs.python.org/file49996/valgrind-libpython.tar.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 10:03:31 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Apr 2021 14:03:31 +0000 Subject: [issue43959] Improve documentation of PyContextVar C-API In-Reply-To: <1619554405.65.0.363572398331.issue43959@roundup.psfhosted.org> Message-ID: <1619618611.14.0.958824846532.issue43959@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24379 pull_request: https://github.com/python/cpython/pull/25689 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 10:01:45 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 28 Apr 2021 14:01:45 +0000 Subject: [issue43851] Optimise SQLite builds on macOS and Windows In-Reply-To: <1618442168.97.0.98960637018.issue43851@roundup.psfhosted.org> Message-ID: <1619618505.49.0.458095410861.issue43851@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: I suggest applying the following safe options for the installers: # SQLITE_DEFAULT_MEMSTATUS Memory status is currently not available in the sqlite3 API, so there's no need for SQLite to keep track of this. If we add such an API (not likely, IMO), we can just remove this compile time option. See also bpo-35056. # SQLITE_OMIT_DEPRECATED No deprecated API functions are used by the sqlite3 module. # SQLITE_OMIT_AUTOINIT The sqlite3 module explicitly initialises SQLite; we can safely apply this option. I'll update the PR's. Berker, do you have any opinion about this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 10:02:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 14:02:38 +0000 Subject: [issue43960] test_pdb fails when only some tests are run In-Reply-To: <1619557297.65.0.395512110368.issue43960@roundup.psfhosted.org> Message-ID: <1619618558.46.0.306230043578.issue43960@roundup.psfhosted.org> STINNER Victor added the comment: > We didn't backport PR21989 because it was changing the way breakpoints hare maintained, so reset_Breakpoint is not there before 3.10. I can add that to the test file manually. Ah yes, it sounds reasonable to me to add reset_Breakpoint() to test_pdb with the bdb clearBreakpoints() code from master. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 10:03:26 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Apr 2021 14:03:26 +0000 Subject: [issue43959] Improve documentation of PyContextVar C-API In-Reply-To: <1619554405.65.0.363572398331.issue43959@roundup.psfhosted.org> Message-ID: <1619618606.95.0.778385889106.issue43959@roundup.psfhosted.org> miss-islington added the comment: New changeset 4c49be766897968e509c41397e0e624c25b1675d by scoder in branch 'master': bpo-43959: clarify the documentation of the PyContextVar C-API (GH-25671) https://github.com/python/cpython/commit/4c49be766897968e509c41397e0e624c25b1675d ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 10:03:37 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Apr 2021 14:03:37 +0000 Subject: [issue43959] Improve documentation of PyContextVar C-API In-Reply-To: <1619554405.65.0.363572398331.issue43959@roundup.psfhosted.org> Message-ID: <1619618617.45.0.370978873016.issue43959@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24380 pull_request: https://github.com/python/cpython/pull/25690 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 10:07:39 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 28 Apr 2021 14:07:39 +0000 Subject: [issue43960] test_pdb fails when only some tests are run In-Reply-To: <1619557297.65.0.395512110368.issue43960@roundup.psfhosted.org> Message-ID: <1619618859.77.0.513127576133.issue43960@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +24381 pull_request: https://github.com/python/cpython/pull/25691 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 10:15:42 2021 From: report at bugs.python.org (Kieran Siek) Date: Wed, 28 Apr 2021 14:15:42 +0000 Subject: [issue11975] Fix referencing of built-in types (list, int, ...) In-Reply-To: <1304281262.53.0.265979216697.issue11975@psf.upfronthosting.co.za> Message-ID: <1619619342.22.0.209614658376.issue11975@roundup.psfhosted.org> Kieran Siek added the comment: 7 years later I'd like to bring up essentially point #2 in this issue, which is the fact that additional list methods are :noindex: resulting in it being unlinked in the documentation. Current state of affairs: 1. Common Sequence methods are documented at https://docs.python.org/3/library/stdtypes.html#common-sequence-operations, MutableSequence methods at https://docs.python.org/3/library/stdtypes.html#mutable-sequence-types. 2. Tuple methods do not have method directives and are just referred to the common sequence methods in the documentation text itself. 3. List methods have method directives with :noindex: at https://docs.python.org/3/tutorial/datastructures.html#more-on-lists 4. list.sort() has duplicate documentation at https://docs.python.org/3/library/stdtypes.html#list.sort, and the entry for list.sort() under 3) does not even link to the duplicate It is pretty inconsistent and frankly confusing. > I would be fine with adding mostly empty method directives to make links work, without duplicating the info in the existing ?common sequence operations? table and footnotes. Eric mentions this, but then the situation would either be: 1. Tuple methods link to common sequence methods, list methods link to the More on Lists version of the Data Structures tutorial or 2. Tuple methods and list methods both link to common sequence methods, and ??? to the More on Lists version which is still inconsistent. Another solution would be to move list method documentation to under the list class (where the duplicate list.sort() is), but in this case the tutorial would be affected as well. I don't see a clear solution here, but I think it's very worth rethinking. ---------- nosy: +kosayoda versions: +Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 10:34:17 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 28 Apr 2021 14:34:17 +0000 Subject: [issue43851] Optimise SQLite builds on macOS and Windows In-Reply-To: <1618442168.97.0.98960637018.issue43851@roundup.psfhosted.org> Message-ID: <1619620457.92.0.0491761195678.issue43851@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: As noted in https://github.com/python/cpython/pull/25414#issuecomment-828501078, SQLITE_OMIT_DEPRECATED also leaves out PRAGMA's, which can break applications. I'll update the PR's to leave it out. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 10:36:47 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 14:36:47 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1619620607.74.0.800696776487.issue43725@roundup.psfhosted.org> STINNER Victor added the comment: I cannot merge my PR 25685 because the mandatory ABI CI job fails: --------------- abidiff "libpython3.9.so" ./Doc/data/python3.9.abi --drop-private-types --no-architecture --no-added-syms Functions changes summary: 0 Removed, 1 Changed, 0 Added function Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1 function with some indirect sub-type change: [C]'function int _PyInterpreterState_IDIncref(PyInterpreterState*)' at pystate.c:497:1 has some indirect sub-type changes: return type changed: type name changed from 'int' to 'void' type size changed from 32 to 0 (in bits) --------------- It is correct that my PR changes an internal C API on purpose. Pablo suggests me to regenerate the ABI file but I don't know how to do that. In Python 3.9, the GitHub Action uses: --- check_abi: name: 'Check if the ABI has changed' runs-on: ubuntu-20.04 needs: check_source if: needs.check_source.outputs.run_tests == 'true' steps: - uses: actions/checkout at v2 - uses: actions/setup-python at v2 - name: Install Dependencies run: | sudo ./.github/workflows/posix-deps-apt.sh sudo apt-get install -yq abigail-tools - name: Build CPython env: CFLAGS: -g3 -O0 run: | # Build Python with the libpython dynamic library ./configure --enable-shared make -j4 - name: Check for changes in the ABI run: make check-abidump --- I'm using Fedora 33 with "gcc (GCC) 11.0.1 20210324 (Red Hat 11.0.1-0)". On Fedora, I used: --- $ sudo dnf install -y libabigail $ ./configure --enable-shared CFLAGS="-g3 -O0" && make -j10 $ make regen-abidump $ git diff --stat Doc/data/python3.9.abi | 28478 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 18306 insertions(+), 10172 deletions(-) --- There are tons of changes! Also, "make check-abidump" lists many changes: --- abidiff "libpython3.9.so" ./Doc/data/python3.9.abi --drop-private-types --no-architecture --no-added-syms Functions changes summary: 0 Removed, 13 Changed (171 filtered out), 0 Added functions Variables changes summary: 0 Removed, 6 Changed (2 filtered out), 0 Added variables 13 functions with some indirect sub-type change: (...) [C] 'function PyStatus _PyInterpreterState_Enable(_PyRuntimeState*)' at pystate.c:171:1 has some indirect sub-type changes: [C] 'function int _Py_DecodeLocaleEx(const char*, wchar_t**, size_t*, const char**, int, _Py_error_handler)' at fileutils.c:574:1 has some indirect sub-type changes: parameter 6 of type 'typedef _Py_error_handler' has sub-type changes: [C] 'const unsigned char _Py_ctype_tolower[256]' was changed to 'const unsigned char[256] const _Py_ctype_tolower' at pyctype.h:26:1: type of variable changed: entity changed from 'const unsigned char[256]' to 'const unsigned char[256] const' (...) --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 10:38:11 2021 From: report at bugs.python.org (Berker Peksag) Date: Wed, 28 Apr 2021 14:38:11 +0000 Subject: [issue43851] Optimise SQLite builds on macOS and Windows In-Reply-To: <1618442168.97.0.98960637018.issue43851@roundup.psfhosted.org> Message-ID: <1619620691.46.0.957930490747.issue43851@roundup.psfhosted.org> Berker Peksag added the comment: As long as we don't introduce behavior changes between SQLite versions in mainstream Linux distributions and macOS/Windows (i.e. an application should continue working in Linux, macOS, Windows), it sounds good to me. Maybe it's worth checking what compile options Debian (and others) are using when packaging SQLite. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 10:58:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 28 Apr 2021 14:58:25 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1619621905.41.0.947074290387.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: As I mentioned here: https://bugs.python.org/msg390213 the dump needs to be generated in a docker container using the same compiler version that is used in the CI ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 10:59:07 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 28 Apr 2021 14:59:07 +0000 Subject: [issue43725] Create a release branch ABI stability regression test In-Reply-To: <1617510913.58.0.992460597619.issue43725@roundup.psfhosted.org> Message-ID: <1619621947.05.0.905431604957.issue43725@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: You are using Fedora, which is not the same docker container and likely the same compiler version that is used to check the dump ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:02:03 2021 From: report at bugs.python.org (Michael Felt) Date: Wed, 28 Apr 2021 15:02:03 +0000 Subject: [issue43659] AIX: test_curses crashes buildbot In-Reply-To: <1617040273.92.0.487968447995.issue43659@roundup.psfhosted.org> Message-ID: <1619622123.92.0.678392912456.issue43659@roundup.psfhosted.org> Michael Felt added the comment: Dome some 'dumb' testing - and I hope this helps understand why it is failing: With the the last two func() calls commented out, the function passes: def test_output_string(self): stdscr = self.stdscr encoding = stdscr.encoding # addstr()/insstr() for func in [stdscr.addstr, stdscr.insstr]: with self.subTest(func.__qualname__): stdscr.move(0, 0) func('abcd') func(b'abcd') s = '??^???^?' try: func(s) except UnicodeEncodeError: self.assertRaises(UnicodeEncodeError, s.encode, encoding) func('abcd', curses.A_BOLD) # func(1, 2, 'abcd') # func(2, 3, 'abcd', curses.A_BOLD) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:11:22 2021 From: report at bugs.python.org (Stefan Behnel) Date: Wed, 28 Apr 2021 15:11:22 +0000 Subject: [issue43959] Improve documentation of PyContextVar C-API In-Reply-To: <1619554405.65.0.363572398331.issue43959@roundup.psfhosted.org> Message-ID: <1619622682.96.0.505454885744.issue43959@roundup.psfhosted.org> Stefan Behnel added the comment: New changeset fdb11897d7c8f9e6bdf96fcef802f784ef90f726 by Miss Islington (bot) in branch '3.9': bpo-43959: clarify the documentation of the PyContextVar C-API (GH-25671) (GH-25689) https://github.com/python/cpython/commit/fdb11897d7c8f9e6bdf96fcef802f784ef90f726 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:11:56 2021 From: report at bugs.python.org (Stefan Behnel) Date: Wed, 28 Apr 2021 15:11:56 +0000 Subject: [issue43959] Improve documentation of PyContextVar C-API In-Reply-To: <1619554405.65.0.363572398331.issue43959@roundup.psfhosted.org> Message-ID: <1619622716.79.0.797736447436.issue43959@roundup.psfhosted.org> Stefan Behnel added the comment: New changeset ff7266efd0ef6b42dad30c9c0d210f843cc44f39 by Miss Islington (bot) in branch '3.8': bpo-43959: clarify the documentation of the PyContextVar C-API (GH-25671) (GH-25690) https://github.com/python/cpython/commit/ff7266efd0ef6b42dad30c9c0d210f843cc44f39 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:15:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 15:15:19 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1619622919.2.0.835898860165.issue43795@roundup.psfhosted.org> STINNER Victor added the comment: Right now, running "make regen-limited-abi" adds again functions which were removed from Doc/data/stable_abi.dat: https://github.com/python/cpython/pull/25687#issuecomment-828520575 diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat index cdc7160250..6fe61743d6 100644 --- a/Doc/data/stable_abi.dat +++ b/Doc/data/stable_abi.dat @@ -351,11 +351,17 @@ PyMapping_Length PyMapping_SetItemString PyMapping_Size PyMapping_Values +PyMarshal_ReadObjectFromString +PyMarshal_WriteLongToFile +PyMarshal_WriteObjectToFile +PyMarshal_WriteObjectToString PyMem_Calloc PyMem_Free PyMem_Malloc PyMem_Realloc PyMemberDescr_Type +PyMember_GetOne +PyMember_SetOne PyMemoryView_FromMemory PyMemoryView_FromObject PyMemoryView_GetContiguous I guess that you should not be added until this issue is solved. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:15:31 2021 From: report at bugs.python.org (Julien Palard) Date: Wed, 28 Apr 2021 15:15:31 +0000 Subject: [issue43954] Possible missing word on unittest doc In-Reply-To: <1619526068.5.0.0964164100817.issue43954@roundup.psfhosted.org> Message-ID: <1619622931.28.0.539389594035.issue43954@roundup.psfhosted.org> Julien Palard added the comment: > I propose to remove the namespace package support entirely. I'm no unittest expert, but I have nothing against removing it. I totally agree to at least remove it from the doc while it does not work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:18:17 2021 From: report at bugs.python.org (Stefan Behnel) Date: Wed, 28 Apr 2021 15:18:17 +0000 Subject: [issue43959] Improve documentation of PyContextVar C-API In-Reply-To: <1619554405.65.0.363572398331.issue43959@roundup.psfhosted.org> Message-ID: <1619623097.66.0.406967736478.issue43959@roundup.psfhosted.org> Change by Stefan Behnel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:19:19 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 28 Apr 2021 15:19:19 +0000 Subject: [issue11975] Fix referencing of built-in types (list, int, ...) In-Reply-To: <1304281262.53.0.265979216697.issue11975@psf.upfronthosting.co.za> Message-ID: <1619623159.09.0.625045912743.issue11975@roundup.psfhosted.org> ?ric Araujo added the comment: I don?t think consistency should be the main goal, but usefulness. ---------- versions: -Python 2.7, Python 3.11, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:18:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 15:18:52 +0000 Subject: [issue43955] Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619623132.06.0.325404894129.issue43955@roundup.psfhosted.org> STINNER Victor added the comment: I ran "python -m test" on an up to date master branch (commit fe52eb62191e640e720d184a9a1a04e965b8a062), there is a single remaining issue. test_distutils failed because the deprecation warning was already emited: issue fixed by PR 25675. The other issues are gone. Shreyan Avigyan: "Same errors." IMO it's a mistake on your side. You ran an outdated version or you didn't rebuild Python cleanly. "FYI test_signal is no longer modifying sys.gettrace thanks to your fix. But test_threading still does. (...) I ran the test again and test_signal still modifies sys.gettrace()" It's not my case on my machine, again it sounds like an issue on your side. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:20:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 15:20:25 +0000 Subject: [issue43955] Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619623225.08.0.623522443614.issue43955@roundup.psfhosted.org> STINNER Victor added the comment: > Another issue with the tests is that it has become terribly slow. It's taking about 45 minutes to complete 1 run of the test suite. A few days ago, it took only 10 - 15 minutes. It took 49 minutes on my Windows 10 VM. Are you sure that you ran the test suite sequentially when it was slower? I advice you run using -j0 option to run tests in parallel: it's much faster, and it's also more reliable. == Tests result: FAILURE == 384 tests OK. 1 test failed: test_distutils 41 tests skipped: test_curses test_dbm_gnu test_dbm_ndbm test_devpoll test_epoll test_fcntl test_fork1 test_gdb test_grp test_ioctl test_kqueue test_multiprocessing_fork test_multiprocessing_forkserver test_nis test_openpty test_ossaudiodev test_pipes test_poll test_posix test_pty test_pwd test_readline test_resource test_smtpnet test_socketserver test_spwd test_syslog test_threadsignals test_timeout test_tix test_tk test_ttk_guionly test_urllib2net test_urllibnet test_wait3 test_wait4 test_winsound test_xmlrpc_net test_xxlimited test_xxtestfuzz test_zipfile64 Total duration: 49 min 12 sec Tests result: FAILURE ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:21:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 15:21:20 +0000 Subject: [issue43960] test_pdb fails when only some tests are run In-Reply-To: <1619557297.65.0.395512110368.issue43960@roundup.psfhosted.org> Message-ID: <1619623280.99.0.85349752717.issue43960@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 2dc6b1789ec86dc80ea290fe33edd61140e47f6f by Irit Katriel in branch '3.9': bpo-43960: test_pdb resets breakpoints to make tests deterministic (GH-25691) https://github.com/python/cpython/commit/2dc6b1789ec86dc80ea290fe33edd61140e47f6f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:21:28 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Apr 2021 15:21:28 +0000 Subject: [issue43960] test_pdb fails when only some tests are run In-Reply-To: <1619557297.65.0.395512110368.issue43960@roundup.psfhosted.org> Message-ID: <1619623288.91.0.0664956078978.issue43960@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24382 pull_request: https://github.com/python/cpython/pull/25692 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:21:58 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 28 Apr 2021 15:21:58 +0000 Subject: [issue43955] Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619623318.66.0.618819027323.issue43955@roundup.psfhosted.org> Steve Dower added the comment: New changeset c1a9535989cc7323099725503519a17f79d083f5 by Steve Dower in branch 'master': bpo-43955: Handle the case where the distutils warning has already been triggered (GH-25675) https://github.com/python/cpython/commit/c1a9535989cc7323099725503519a17f79d083f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:27:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 15:27:25 +0000 Subject: [issue43955] Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt In-Reply-To: <1619542987.31.0.479223769103.issue43955@roundup.psfhosted.org> Message-ID: <1619623645.69.0.635049245288.issue43955@roundup.psfhosted.org> STINNER Victor added the comment: Thanks everyone for fixing these issues and thanks Shreyan for the bug report. The main initial is now fixed, so I close the issue. Let's continue the discussions in remaining open issues: * bpo-37387: test_compileall fails randomly on Windows when tests are run in parallel * bpo-43960: test_pdb fails when only some tests are run * bpo-43961 [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:27:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 15:27:55 +0000 Subject: [issue43960] test_pdb fails when only some tests are run In-Reply-To: <1619557297.65.0.395512110368.issue43960@roundup.psfhosted.org> Message-ID: <1619623675.16.0.532700153065.issue43960@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:28:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 15:28:22 +0000 Subject: [issue43961] [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error In-Reply-To: <1619558751.24.0.0962393290712.issue43961@roundup.psfhosted.org> Message-ID: <1619623702.33.0.551433632377.issue43961@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 629ef0fb9cad6ac340d3be884af7b47fb393ae99 by Miss Islington (bot) in branch '3.9': bpo-43961: Fix test_logging.test_namer_rotator_inheritance() (GH-25684) (GH-25688) https://github.com/python/cpython/commit/629ef0fb9cad6ac340d3be884af7b47fb393ae99 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:28:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 15:28:58 +0000 Subject: [issue43961] [Windows] test_logging.test_namer_rotator_inheritance() logs a logging error In-Reply-To: <1619558751.24.0.0962393290712.issue43961@roundup.psfhosted.org> Message-ID: <1619623738.47.0.766865282509.issue43961@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:29:53 2021 From: report at bugs.python.org (Kieran Siek) Date: Wed, 28 Apr 2021 15:29:53 +0000 Subject: [issue11975] Fix referencing of built-in types (list, int, ...) In-Reply-To: <1304281262.53.0.265979216697.issue11975@psf.upfronthosting.co.za> Message-ID: <1619623793.05.0.981329428351.issue11975@roundup.psfhosted.org> Kieran Siek added the comment: I don't disagree, just having linkable directives for lists and tuples would already make the documentation a lot more useful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:37:58 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 28 Apr 2021 15:37:58 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1619622919.2.0.835898860165.issue43795@roundup.psfhosted.org> Message-ID: <31441D83-A262-4B63-89E3-198366AF1E8A@gmail.com> Petr Viktorin added the comment: I hope the PR fixes that. I plan to merge tomorrow if there ar no objections to it. On April 28, 2021 5:15:19 PM GMT+02:00, STINNER Victor wrote: > >STINNER Victor added the comment: > >Right now, running "make regen-limited-abi" adds again functions which >were removed from Doc/data/stable_abi.dat: >https://github.com/python/cpython/pull/25687#issuecomment-828520575 > >diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat >index cdc7160250..6fe61743d6 100644 >--- a/Doc/data/stable_abi.dat >+++ b/Doc/data/stable_abi.dat >@@ -351,11 +351,17 @@ PyMapping_Length > PyMapping_SetItemString > PyMapping_Size > PyMapping_Values >+PyMarshal_ReadObjectFromString >+PyMarshal_WriteLongToFile >+PyMarshal_WriteObjectToFile >+PyMarshal_WriteObjectToString > PyMem_Calloc > PyMem_Free > PyMem_Malloc > PyMem_Realloc > PyMemberDescr_Type >+PyMember_GetOne >+PyMember_SetOne > PyMemoryView_FromMemory > PyMemoryView_FromObject > PyMemoryView_GetContiguous > > >I guess that you should not be added until this issue is solved. > >---------- > >_______________________________________ >Python tracker > >_______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:38:19 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 28 Apr 2021 15:38:19 +0000 Subject: [issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py In-Reply-To: <1597516564.62.0.520187732663.issue41559@roundup.psfhosted.org> Message-ID: <1619624299.5.0.0968191716275.issue41559@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 859577c24981d6b36960d309f99f7fc810fe75c2 by Ken Jin in branch 'master': bpo-41559: Change PEP 612 implementation to pure Python (#25449) https://github.com/python/cpython/commit/859577c24981d6b36960d309f99f7fc810fe75c2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:38:54 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 28 Apr 2021 15:38:54 +0000 Subject: [issue11975] Fix referencing of built-in types (list, int, ...) In-Reply-To: <1304281262.53.0.265979216697.issue11975@psf.upfronthosting.co.za> Message-ID: <1619624334.02.0.358926896748.issue11975@roundup.psfhosted.org> Raymond Hettinger added the comment: > I don't see a clear solution here, but I think > it's very worth rethinking. If you come up with a clear improvement for adding link targets, please open it in a separate tracker issue. The other proposals in this thread have all been mostly voted down. ---------- nosy: +rhettinger resolution: -> rejected stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:43:11 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 28 Apr 2021 15:43:11 +0000 Subject: [issue43954] Possible missing word on unittest doc In-Reply-To: <1619526068.5.0.0964164100817.issue43954@roundup.psfhosted.org> Message-ID: <1619624591.15.0.838982325388.issue43954@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:43:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 15:43:10 +0000 Subject: [issue43960] test_pdb fails when only some tests are run In-Reply-To: <1619557297.65.0.395512110368.issue43960@roundup.psfhosted.org> Message-ID: <1619624590.9.0.651773275062.issue43960@roundup.psfhosted.org> STINNER Victor added the comment: New changeset b52cc7c5f1a6c5b48d51cd718719a766c37d6e38 by Miss Islington (bot) in branch '3.8': bpo-43960: test_pdb resets breakpoints to make tests deterministic (GH-25691) (GH-25692) https://github.com/python/cpython/commit/b52cc7c5f1a6c5b48d51cd718719a766c37d6e38 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:43:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 15:43:32 +0000 Subject: [issue43960] test_pdb fails when only some tests are run In-Reply-To: <1619557297.65.0.395512110368.issue43960@roundup.psfhosted.org> Message-ID: <1619624612.28.0.54925733292.issue43960@roundup.psfhosted.org> STINNER Victor added the comment: Thanks for the fix Irit! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:44:38 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 28 Apr 2021 15:44:38 +0000 Subject: [issue37387] test_compileall fails randomly on Windows when tests are run in parallel In-Reply-To: <1561383626.08.0.320504464802.issue37387@roundup.psfhosted.org> Message-ID: <1619624678.21.0.884859566477.issue37387@roundup.psfhosted.org> Guido van Rossum added the comment: Well, in the normal course of running multiple Python programs on the same machine, pyc files may be rewritten, and this should not cause crashes. So perhaps there?s a real bug here? ---------- nosy: +Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:47:23 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 28 Apr 2021 15:47:23 +0000 Subject: [issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py In-Reply-To: <1597516564.62.0.520187732663.issue41559@roundup.psfhosted.org> Message-ID: <1619624843.85.0.270113485902.issue41559@roundup.psfhosted.org> Ken Jin added the comment: The last of the patches have landed. Guido, thank you so much for helping me through this 5 month long process. Please enjoy your vacation! PS: I need to send in a bugfix for typing.py later to ignore ``ParamSpec`` in the ``__parameters__`` of invalid locations like ``typing.List`` (this just ensures consistency with the builtin ``list``). That can be done as a bugfix patch after the 3.10 beta freeze (as it isn't a new feature at all). I'll open a new issue after beta 1 for that when you're back. Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:50:25 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 28 Apr 2021 15:50:25 +0000 Subject: [issue43757] pathlib: move 'resolve()' logic out of path flavour In-Reply-To: <1617762768.57.0.0406169855145.issue43757@roundup.psfhosted.org> Message-ID: <1619625025.06.0.554716508967.issue43757@roundup.psfhosted.org> Steve Dower added the comment: New changeset baecfbd849dbf42360d3a84af6cc13160838f24d by Barney Gale in branch 'master': bpo-43757: Make pathlib use os.path.realpath() to resolve symlinks in a path (GH-25264) https://github.com/python/cpython/commit/baecfbd849dbf42360d3a84af6cc13160838f24d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:50:36 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 28 Apr 2021 15:50:36 +0000 Subject: [issue43757] pathlib: move 'resolve()' logic out of path flavour In-Reply-To: <1617762768.57.0.0406169855145.issue43757@roundup.psfhosted.org> Message-ID: <1619625036.04.0.0777763871209.issue43757@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 11:53:40 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 28 Apr 2021 15:53:40 +0000 Subject: [issue43847] [Windows] ntpath.realpath() of bytes root directory may raise TypeError in some cases In-Reply-To: <1618404662.92.0.914724176997.issue43847@roundup.psfhosted.org> Message-ID: <1619625220.4.0.00361498515542.issue43847@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 12:12:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 16:12:29 +0000 Subject: [issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled In-Reply-To: <1474611707.66.0.467568151114.issue28254@psf.upfronthosting.co.za> Message-ID: <1619626349.72.0.911297936986.issue28254@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3cc481b9de43c234889c8010e7da3af7c0f42319 by scoder in branch 'master': bpo-28254: Add a C-API for controlling the GC state (GH-25687) https://github.com/python/cpython/commit/3cc481b9de43c234889c8010e7da3af7c0f42319 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 12:14:24 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 28 Apr 2021 16:14:24 +0000 Subject: [issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py In-Reply-To: <1619624843.85.0.270113485902.issue41559@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Thanks for your major contribution, Ken! Agreed, that bugfix can come later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 12:15:19 2021 From: report at bugs.python.org (Stefan Behnel) Date: Wed, 28 Apr 2021 16:15:19 +0000 Subject: [issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled In-Reply-To: <1474611707.66.0.467568151114.issue28254@psf.upfronthosting.co.za> Message-ID: <1619626519.65.0.833219562591.issue28254@roundup.psfhosted.org> Change by Stefan Behnel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 12:18:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 16:18:38 +0000 Subject: [issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled In-Reply-To: <1474611707.66.0.467568151114.issue28254@psf.upfronthosting.co.za> Message-ID: <1619626718.48.0.916481452949.issue28254@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24383 pull_request: https://github.com/python/cpython/pull/25693 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 12:20:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 16:20:49 +0000 Subject: [issue43472] [security][subinterpreters] Add auditing hooks to subinterpreter module In-Reply-To: <1615455062.58.0.468186541544.issue43472@roundup.psfhosted.org> Message-ID: <1619626849.42.0.828802753282.issue43472@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0252ce35712f4a12e824fb8b40a867ec3460443e by Miss Islington (bot) in branch '3.9': bpo-43472: Ensure PyInterpreterState_New audit events are raised when called through _xxsubinterpreters module (GH-25506) (GH-25508) https://github.com/python/cpython/commit/0252ce35712f4a12e824fb8b40a867ec3460443e ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 12:21:43 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Apr 2021 16:21:43 +0000 Subject: [issue43349] [doc] incorrect tuning(7) manpage link In-Reply-To: <1614583989.29.0.630028464305.issue43349@roundup.psfhosted.org> Message-ID: <1619626903.91.0.146581597506.issue43349@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24384 pull_request: https://github.com/python/cpython/pull/25694 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 12:23:33 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Apr 2021 16:23:33 +0000 Subject: [issue43295] datetime.strptime emits IndexError on parsing 'z' as %z In-Reply-To: <1614002299.86.0.551520528109.issue43295@roundup.psfhosted.org> Message-ID: <1619627013.77.0.855765485563.issue43295@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24385 pull_request: https://github.com/python/cpython/pull/25695 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 12:24:37 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 28 Apr 2021 16:24:37 +0000 Subject: [issue43851] Optimise SQLite builds on macOS and Windows In-Reply-To: <1618442168.97.0.98960637018.issue43851@roundup.psfhosted.org> Message-ID: <1619627077.89.0.46624474559.issue43851@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Here's a list of the SQLite recommended compile-time options (only): - macOS (v11.2.3) (SQLite v3.32.3) defines SQLITE_DEFAULT_WAL_SYNCHRONOUS=1 - Homebrew (SQLite v3.35.4) does not define any of the recommended compile-time options - Debian Buster (SQLite v3.27.2) defines SQLITE_LIKE_DOESNT_MATCH_BLOBS - Ubuntu 20.04 (SQLite v3.31.1) defines SQLITE_LIKE_DOESNT_MATCH_BLOBS AFAICS, adding SQLITE_DEFAULT_MEMSTATUS=0 and SQLITE_OMIT_AUTOINIT is safe, as it only affects the C API that we use, and nothing else. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 12:26:16 2021 From: report at bugs.python.org (sfmc) Date: Wed, 28 Apr 2021 16:26:16 +0000 Subject: [issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths Message-ID: <1619627176.09.0.686852454721.issue43968@roundup.psfhosted.org> New submission from sfmc : For example if I mount directory C:\example\dir to Z:\ the os.path.realpath('Z:\\') returns the real directory. Use following commands in Windows to reproduce the issue: md C:\example\dir subst Z: C:\example\dir python.exe -c "import os; print(os.path.realpath('Z:\\'))" Python 3.8 outputs: C:\example\dir Python 3.7 outputs: Z:\ This is unexpected behavior change and it breaks our scripts in many places, because we use mounts in Windows ("subst" command) and Linux ("mount" command). We had to add our own implementation for realpath to our scripts, but it also affects other tools, such as Python debugger (breakpoints stopped working) and IDEs (such as PyCharm). It can be argued whether the behavior to resolve mounts is good. But this change breaks the ability to work with Python scripts in mounts. I hope it can be fixed in Python 3.8.10. I propose to fix it in Python 3.8.10 by adding to function os.path.realpath(path) a new parameter (named for example "resolve_mounts"), like that: os.path.realpath(path, *, resolve_mounts=False) And if resolve_mounts==False, then the function should not resolve mounts in Windows ("subst" command) and Linux ("mount" command). Let me know if you wish to get a Pull Request with the proposed fix. I can try to implement it. ---------- components: Library (Lib) messages: 392234 nosy: sfmc priority: normal severity: normal status: open title: os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 12:40:34 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 28 Apr 2021 16:40:34 +0000 Subject: [issue43851] Optimise SQLite builds on macOS and Windows In-Reply-To: <1618442168.97.0.98960637018.issue43851@roundup.psfhosted.org> Message-ID: <1619628034.39.0.757719705117.issue43851@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Oh, well, SQLITE_DEFAULT_MEMSTATUS=0 does in fact affect PRAGMA soft_heap_limit. Looks like I'm left with only SQLITE_OMIT_AUTOINIT, then :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 12:48:21 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 28 Apr 2021 16:48:21 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619628501.72.0.425893103161.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: Was EVPtype_spec in _hashopenssl.c converted to heap type? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 13:00:53 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 28 Apr 2021 17:00:53 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619629252.98.0.0425841788949.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: See msg391933, Shreyan. I think Christian will take care of his types :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 13:02:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 17:02:50 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619629370.79.0.445725054107.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3b52c8d66b25415f09478ab43f93d59a3547dc13 by Erlend Egeberg Aasland in branch 'master': bpo-43908: Add Py_TPFLAGS_IMMUTABLETYPE flag (GH-25520) https://github.com/python/cpython/commit/3b52c8d66b25415f09478ab43f93d59a3547dc13 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 13:07:08 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 28 Apr 2021 17:07:08 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619629628.01.0.478507111691.issue43908@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24386 pull_request: https://github.com/python/cpython/pull/25696 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 13:07:51 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 28 Apr 2021 17:07:51 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619629671.59.0.867890299922.issue43908@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24387 pull_request: https://github.com/python/cpython/pull/25697 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 13:09:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 28 Apr 2021 17:09:33 +0000 Subject: [issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled In-Reply-To: <1474611707.66.0.467568151114.issue28254@psf.upfronthosting.co.za> Message-ID: <1619629773.28.0.37454672572.issue28254@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 103d5e420dd90489933ad9da8bb1d6008773384d by Victor Stinner in branch 'master': bpo-28254: _posixsubprocess uses PyGC_Enable/PyGC_Disable (GH-25693) https://github.com/python/cpython/commit/103d5e420dd90489933ad9da8bb1d6008773384d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 13:58:46 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 28 Apr 2021 17:58:46 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619632726.75.0.501348213041.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: Is it necessary to add tests just for testing type immutability? We don't have immutability tests for static types then why heap types? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 14:03:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 28 Apr 2021 18:03:55 +0000 Subject: [issue24475] The docs never define what a pool "task" is In-Reply-To: <1434733537.74.0.146405679971.issue24475@psf.upfronthosting.co.za> Message-ID: <1619633035.32.0.00346197936209.issue24475@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Library (Lib) versions: +Python 3.10, Python 3.11, Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 14:07:09 2021 From: report at bugs.python.org (Barney Gale) Date: Wed, 28 Apr 2021 18:07:09 +0000 Subject: [issue42998] pathlib.Path: add `username` argument to `home()` In-Reply-To: <1611287835.84.0.363729514225.issue42998@roundup.psfhosted.org> Message-ID: <1619633229.9.0.677399578274.issue42998@roundup.psfhosted.org> Barney Gale added the comment: So far I've been keen to keep the Path and AbstractPath APIs the same, but perhaps this case warrants an exception. What if AbstractPath lacked both home() and expanduser(), and those methods only existed on Path? Of all the methods on Path, these two are the *least* useful for non-local filesystems. We can then circle back round to this issue when the fate of expanduser() becomes clearer. Does that sound any good? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 14:09:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 28 Apr 2021 18:09:29 +0000 Subject: [issue23750] doc: Clarify difference between os.system/subprocess.call in section "Replacing os.system()" In-Reply-To: <1427120891.65.0.0570880238086.issue23750@psf.upfronthosting.co.za> Message-ID: <1619633369.59.0.569039863774.issue23750@roundup.psfhosted.org> Irit Katriel added the comment: The patch needs to be converted to a github PR. ---------- keywords: +easy nosy: +iritkatriel title: Clarify difference between os.system/subprocess.call in section "Replacing os.system()" -> doc: Clarify difference between os.system/subprocess.call in section "Replacing os.system()" versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 14:19:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 28 Apr 2021 18:19:36 +0000 Subject: [issue1662] [patch] assert tp_traverse in PyType_GenericAlloc() In-Reply-To: <1198084921.68.0.0736452990224.issue1662@psf.upfronthosting.co.za> Message-ID: <1619633976.6.0.488306706753.issue1662@roundup.psfhosted.org> Irit Katriel added the comment: Are you sure this assertion is correct? tp_traverse is optional. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 14:36:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 28 Apr 2021 18:36:13 +0000 Subject: [issue1227748] doc: subprocess: inheritance of std descriptors inconsistent Message-ID: <1619634973.28.0.816858738429.issue1227748@roundup.psfhosted.org> Irit Katriel added the comment: The patch needs to be converted into a github PR. ---------- keywords: +easy nosy: +iritkatriel title: subprocess: inheritance of std descriptors inconsistent -> doc: subprocess: inheritance of std descriptors inconsistent versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 14:54:55 2021 From: report at bugs.python.org (Liel Fridman) Date: Wed, 28 Apr 2021 18:54:55 +0000 Subject: [issue43592] test_importlib: test_multiprocessing_pool_circular_import() fails with "Too many open files" error on os.pipe() In-Reply-To: <1616409182.92.0.0882668450853.issue43592@roundup.psfhosted.org> Message-ID: <1619636095.65.0.675607669587.issue43592@roundup.psfhosted.org> Liel Fridman added the comment: I have the same error when running the tests on my machine (Same macOS version). ---------- nosy: +lielfr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 15:02:53 2021 From: report at bugs.python.org (Yaroslav Nikitenko) Date: Wed, 28 Apr 2021 19:02:53 +0000 Subject: [issue33040] Make itertools.islice supports negative values for start and stop arguments for sized iterable object In-Reply-To: <1520673526.96.0.467229070634.issue33040@psf.upfronthosting.co.za> Message-ID: <1619636573.16.0.314573437202.issue33040@roundup.psfhosted.org> Yaroslav Nikitenko added the comment: I hope it's fine to add to closed topics here. I agree with the decision that islice should not handle a special case of sized containers vs iterables. However, I think that the support of negative indices in islice would be nice. A simple use case would be to get the last element of an iterable. I had to write my own code for that (you may read and/or use it if needed), because I needed this algorithm in my analysis. Here is the link to my function ISlice._run_negative_islice in my architectural framework for data analysis: https://github.com/ynikitenko/lena/blob/master/lena/flow/iterators.py#L150 or on https://lena.readthedocs.io/en/latest/flow.html#lena.flow.iterators.ISlice (I'm afraid the correct link might change later). I also agree that to support negative indices would require more work. Indeed, it seems that for each combination of positive/negative start/stop it required a new algorithm! I didn't implement negative steps. However, I think that because it's not easy to implement, it would be even better to include that in the standard library (because it would save other people from writing that). If we care about code reuse: I think that negative indices make the algorithm more useful, while non-trivial steps are redundant, because they can be implemented by a composition of a slice with step=1 with a simple slice with start, stop=None, None with step!=1. Negative slice fundamentally changes the algorithm: if one wants to have the flow inverted, fflow[0, None, -1], one would have to store it all in memory! Anyway it's easy to make this in a separate function. So I think it's more functional to implement negative indices and discard negative steps (or non-trivial steps at all). About drop_first, drop_last suggested above: I also think that they are redundant and would be better incorporated into islice. ---------- nosy: +ynikitenko _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 15:06:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 28 Apr 2021 19:06:14 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619636774.75.0.139435021407.issue43908@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > We don't have immutability tests for static types then why heap types? Because all static types are immutable, and some have been converted to heap types changing the contract, therefore is a regression and therefore we need regression tests for those. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 15:09:30 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 28 Apr 2021 19:09:30 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619636970.92.0.668164383081.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: Erlend, wouldn't it be easy to apply all the changes in 1 PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 15:16:14 2021 From: report at bugs.python.org (Yaroslav Nikitenko) Date: Wed, 28 Apr 2021 19:16:14 +0000 Subject: [issue33040] Make itertools.islice supports negative values for start and stop arguments for sized iterable object In-Reply-To: <1520673526.96.0.467229070634.issue33040@psf.upfronthosting.co.za> Message-ID: <1619637374.14.0.0389175150307.issue33040@roundup.psfhosted.org> Yaroslav Nikitenko added the comment: Sorry for a typo. The paragraph before the last should read Negative *step* fundamentally changes the algorithm:... flow[-1:None:-1]. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 15:43:42 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Wed, 28 Apr 2021 19:43:42 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619639022.17.0.891419885977.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Shreyan, see msg391954 earlier in this thread: "I also think you should try to separately land small patches that add the IMMUTABLETYPE flag to a few very public types, e.g. array.array and the three in _sre (which are exported by re.py)." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 15:46:24 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 28 Apr 2021 19:46:24 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619639184.16.0.0279136378343.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: ok. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 15:58:23 2021 From: report at bugs.python.org (Evgeny) Date: Wed, 28 Apr 2021 19:58:23 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1619639903.53.0.437592022601.issue14243@roundup.psfhosted.org> Evgeny added the comment: Dear all, thank you very much for the discussion, I will just try to summarize the results of it. In my PR I used solution, proposed by Eryk. My solution involves introduction of the extra flag delete_on_close and making sure, that new situation is fully backwards compatible, because I did not feel I have an authority to propose anything which would break backwards compatibility (as Python 4.0 I think is not on the horizon yet) As I see from the discussion, the following decisions need to be taken: WHICH FLAG TO USE Eryk was proposing that it shall be delete_on_close (which I have implemented) Jason thinks, that we shall introduce flag delete_when, however when I read his proposal, the functionality which he proposes is not that different from what I implemented with delete_on_close. Ethan however thinks, that no extra flags are necessary at all USAGE OF O_TEMPORARY ON WINDOWS Ethan, Steve thinks, it is not needed Eryk prefers to provide a way to omit O_TEMPORARY, but still use it by default, when it's omitted CHANGING OF THE CURRENT BEHAVIOUR / BREAKING BACKWARDS COMPATIBILITY Ethan thinks, that we shall slightly change backwards compatibility in a way that if CM is used, than file is deleted on CM exit and not on close as now Jason thinks that backwards compatibility shall be changed gradually over several releases with the advanced depreciation warning Question: does everybody definitely agree then, that backwards compatibility shall definitely be altered, whether immediately or gradually? Any other decision to be taken which I missed? CONCLUSION: There seems to be still disagreements and I don't really know how to move this forward as I am not sure I understand the decision making mechanism in the Python community (especially when it comes to breaking backwards compatibility). Any thoughts on this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 16:08:15 2021 From: report at bugs.python.org (Evgeny) Date: Wed, 28 Apr 2021 20:08:15 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1619640495.97.0.740133805435.issue14243@roundup.psfhosted.org> Evgeny added the comment: On Mon, Apr 12, 2021 at 12:51 AM Jason R. Coombs wrote: > Jason R. Coombs added the comment: > At least I and Ethan and Martin have expressed a desire for the default, preferred usage work well in a portable environment. Requiring `delete_on_close=False` violates that expectation. Separately to my previous message. If the only issue with my PR is that default solution is not portable, then this can be simply changed within current PR by setting default of delete_on_close to fe equal to False. As I mentioned, I was assuming I cannot break backwards compatibility. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 16:21:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 28 Apr 2021 20:21:18 +0000 Subject: [issue32824] Docs: Using Python on a Macintosh has bad info per Apple site In-Reply-To: <1518392554.24.0.467229070634.issue32824@psf.upfronthosting.co.za> Message-ID: <1619641278.29.0.378171051292.issue32824@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 16:36:52 2021 From: report at bugs.python.org (Mitchell Hentges) Date: Wed, 28 Apr 2021 20:36:52 +0000 Subject: [issue43969] "bad magic number" when Python 2's pyc file exists without py file Message-ID: <1619642212.93.0.461785778702.issue43969@roundup.psfhosted.org> New submission from Mitchell Hentges : Python 3 imports may fail if a Python 2 .pyc file exists without an accompanying .py file. ----- My project vendors code, and we recently updated "requests" to a drastically newer version. As part of this version change, `requests/packages/__init__.py` was removed, and `requests/packages.py` was added. This project is long-lived, and many people have imported `requests` with Python 2. So, `requests/packages/__init__.pyc` exists. After making this update, importing requests with Python 3 fails: `ImportError: bad magic number in 'parent.child': b'\x03\xf3\r\n'` Interestingly, deleting `requests/packages/__init__.pyc` allows Python 3 to work again. ----- I've attached a "reproduction" script that produces the directory structure and tweak required to cause the failure. I'm running Python 2.7.18 and Python 3.9.1. ---------- components: Interpreter Core files: repro.sh messages: 392254 nosy: mitchhentges priority: normal severity: normal status: open title: "bad magic number" when Python 2's pyc file exists without py file type: behavior versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file49997/repro.sh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 16:41:53 2021 From: report at bugs.python.org (Kevin Follstad) Date: Wed, 28 Apr 2021 20:41:53 +0000 Subject: [issue43970] Optimize Path.cwd() in pathlib Message-ID: <1619642513.35.0.170837369842.issue43970@roundup.psfhosted.org> New submission from Kevin Follstad : python3.10 -m timeit -r 5 -n 100000 -s 'from pathlib import Path' 'Path.cwd()' 100000 loops, best of 5: 206 usec per loop python3.10-mypatch -m timeit -r 5 -n 100000 -s 'from pathlib import Path' 'Path.cwd()' 100000 loops, best of 5: 156 usec per loop ---------- components: Library (Lib) messages: 392255 nosy: kfollstad priority: normal severity: normal status: open title: Optimize Path.cwd() in pathlib type: performance versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 16:45:56 2021 From: report at bugs.python.org (Kevin Follstad) Date: Wed, 28 Apr 2021 20:45:56 +0000 Subject: [issue43970] Optimize Path.cwd() in pathlib In-Reply-To: <1619642513.35.0.170837369842.issue43970@roundup.psfhosted.org> Message-ID: <1619642756.66.0.811654817243.issue43970@roundup.psfhosted.org> Change by Kevin Follstad : ---------- keywords: +patch pull_requests: +24388 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25699 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 16:50:37 2021 From: report at bugs.python.org (Paul Moore) Date: Wed, 28 Apr 2021 20:50:37 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1619643037.18.0.813068016487.issue14243@roundup.psfhosted.org> Paul Moore added the comment: To be explicit, I'm +1 on breaking backward compatibility in the minor form described by Ethan: if NamedTemporaryFile is used as a context manager, the file is closed *on context manager exit* and *not* when the file is closed. Breaking compatibility is allowed in minor versions (3.11 at this point, as this won't make it in before 3.10 feature freeze). So this is an acceptable change. I don't personally think this needs a transition period or deprecation, and in particular I don't think that Jason's "gradual transition" proposal is necessary. I'd be sad if we ended up with an over-complicated solution for no better reason than an excess of caution over a backward compatibility issue that we're not sure will impact anyone. Do we have any actual examples of code that needs the current CM behaviour (as opposed to a general concern that someone might be using the functionality)? (My original over-complicated proposal was based on a mistaken belief that it had already been established that backward incompatibility was absolutely not allowed. But I never subscribed to that view myself.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 17:03:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 28 Apr 2021 21:03:55 +0000 Subject: [issue16062] Socket closed prematurely in httplib for https In-Reply-To: <1348762094.47.0.227336838763.issue16062@psf.upfronthosting.co.za> Message-ID: <1619643835.45.0.220596904334.issue16062@roundup.psfhosted.org> Irit Katriel added the comment: Issue5542 was fixed, so if it's the same thing this is also fixed. If it's not the same thing, then python 2.7 is past EOL so please create a new issue if you can reproduce this problem in 3.8+. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 17:15:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 28 Apr 2021 21:15:37 +0000 Subject: [issue18125] Out-of-tree build cannot regenerate Makefile.pre In-Reply-To: <1370251063.05.0.0234543553399.issue18125@psf.upfronthosting.co.za> Message-ID: <1619644537.69.0.964026418618.issue18125@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Build Python outside the source directory _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 17:25:34 2021 From: report at bugs.python.org (Glenn Travis) Date: Wed, 28 Apr 2021 21:25:34 +0000 Subject: [issue32824] Docs: Using Python on a Macintosh has bad info per Apple site In-Reply-To: <1619641278.33.0.843214788813.issue32824@roundup.psfhosted.org> Message-ID: <1AE70ADD-C24C-4744-9A3B-4910BE6109C4@comcast.net> Glenn Travis added the comment: I see that this remains alive. I do have a newer question. Apple continues to say that they are going to drop all their included versions of python and I believe ruby in some future version of macOS. I thought that this would happen in Big Sur, but python versions 2.7.16 still remains with us, why, I don?t know. > On Apr 28, 2021, at 3:21 PM, Irit Katriel wrote: > > > Change by Irit Katriel : > > > ---------- > versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.6, Python 3.7, Python 3.8 > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 17:40:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 28 Apr 2021 21:40:45 +0000 Subject: [issue24247] Docs: "unittest discover" modifies sys.path In-Reply-To: <1432145504.49.0.0792649435806.issue24247@psf.upfronthosting.co.za> Message-ID: <1619646045.94.0.519294021176.issue24247@roundup.psfhosted.org> Irit Katriel added the comment: This is alluded to in the "caution" under https://docs.python.org/3/library/unittest.html#test-discovery But the workaround is not explained. ---------- keywords: +easy nosy: +iritkatriel title: "unittest discover" modifies sys.path -> Docs: "unittest discover" modifies sys.path type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.8, Python 3.9 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 18:03:54 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 28 Apr 2021 22:03:54 +0000 Subject: [issue39232] asyncio crashes when tearing down the proactor event loop In-Reply-To: <1578335360.75.0.333919607495.issue39232@roundup.psfhosted.org> Message-ID: <1619647434.98.0.227310638933.issue39232@roundup.psfhosted.org> Steve Dower added the comment: I'm also seeing (and annoyed by) this. Do we need to do anything more than suppress the error? If we're just failing to notify the event loop that we're closing because the loop is gone, does the notification even matter? ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 18:05:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 28 Apr 2021 22:05:27 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619647527.13.0.187839820474.issue43908@roundup.psfhosted.org> Serhiy Storchaka added the comment: I am not sure tests are needed here. Immutability of the type is mainly an implementation detail. We keep the types immutable because we don't want users to use the feature of mutating these types. I don't think anything bad will happen if in some Python implementation some of these types are Python classes and are mutable. It is not easy to make a Python class immutable. Users will not intentionally write a code depending on mutability of these types because it does not work in CPython. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 18:14:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 28 Apr 2021 22:14:16 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619648056.74.0.863944305099.issue43908@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Immutability of the type is mainly an implementation detail I kindly disagree and based on the title of this issue I think more people have a similar opinion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 18:18:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 28 Apr 2021 22:18:11 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619648291.67.0.0265620613495.issue43908@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: In any case, that's my personal opinion of course. What we should do is decide collectively if immutability is defined behaviour. If we decide that it is, we need regression tests. If we define that as "nice to have" but ultimately "implementation-defined" we don't. In any case, I would argue that having tests is good and allow us to know when the behaviour flips without people intending it to, like what happened in this case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 18:19:40 2021 From: report at bugs.python.org (Roundup Robot) Date: Wed, 28 Apr 2021 22:19:40 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1619648380.93.0.895266720087.issue43913@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 5.0 -> 6.0 pull_requests: +24390 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25700 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 18:22:58 2021 From: report at bugs.python.org (Larry Hastings) Date: Wed, 28 Apr 2021 22:22:58 +0000 Subject: [issue43954] Possible missing word on unittest doc In-Reply-To: <1619526068.5.0.0964164100817.issue43954@roundup.psfhosted.org> Message-ID: <1619648578.1.0.628990683852.issue43954@roundup.psfhosted.org> Change by Larry Hastings : ---------- nosy: -larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 18:23:22 2021 From: report at bugs.python.org (Barney Gale) Date: Wed, 28 Apr 2021 22:23:22 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za> Message-ID: <1619648602.55.0.835772549436.issue24132@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +24392 pull_request: https://github.com/python/cpython/pull/25701 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 18:23:22 2021 From: report at bugs.python.org (Barney Gale) Date: Wed, 28 Apr 2021 22:23:22 +0000 Subject: [issue43012] Remove pathlib accessors In-Reply-To: <1611425755.47.0.494853383169.issue43012@roundup.psfhosted.org> Message-ID: <1619648602.5.0.730856450995.issue43012@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +24391 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25701 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 18:28:16 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 28 Apr 2021 22:28:16 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1619648896.17.0.403217657827.issue37903@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 15d386185659683fc044ccaa300aa8cd7d49cc1a by Tal Einat in branch 'master': bpo-37903: IDLE: Shell sidebar with prompts (GH-22682) https://github.com/python/cpython/commit/15d386185659683fc044ccaa300aa8cd7d49cc1a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 19:01:58 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 28 Apr 2021 23:01:58 +0000 Subject: [issue43970] Optimize Path.cwd() in pathlib In-Reply-To: <1619642513.35.0.170837369842.issue43970@roundup.psfhosted.org> Message-ID: <1619650918.08.0.199808569505.issue43970@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset 4a85718212fd032c922ca7d630b2602dd4b29a35 by kfollstad in branch 'master': bpo-43970: Optimize Path.cwd() in pathlib by not instantiating a class unnecessarily (GH-25699) https://github.com/python/cpython/commit/4a85718212fd032c922ca7d630b2602dd4b29a35 ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 19:03:04 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 28 Apr 2021 23:03:04 +0000 Subject: [issue43970] Optimize Path.cwd() in pathlib In-Reply-To: <1619642513.35.0.170837369842.issue43970@roundup.psfhosted.org> Message-ID: <1619650984.46.0.076089832725.issue43970@roundup.psfhosted.org> Eric V. Smith added the comment: I'm merging this not so much because of the performance aspect, but just to remove some unnecessary code. But in any event, thanks for the contribution! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 19:23:25 2021 From: report at bugs.python.org (Miguel Brito) Date: Wed, 28 Apr 2021 23:23:25 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1619652205.8.0.986262894594.issue43913@roundup.psfhosted.org> Miguel Brito added the comment: Hello, first time here. I created an PR for that. Managed to reproduce the issue both manually and via unit test. I hope there's no edge case but all tests pass on my machine. ---------- nosy: +miguendes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 20:09:28 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 29 Apr 2021 00:09:28 +0000 Subject: [issue43958] Importlib.metadata docs claim PackagePath is a Path subclass In-Reply-To: <1619551540.42.0.304542326488.issue43958@roundup.psfhosted.org> Message-ID: <1619654968.84.0.106009161718.issue43958@roundup.psfhosted.org> Jason R. Coombs added the comment: Thanks Paul! ---------- nosy: +jaraco resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 20:29:32 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 29 Apr 2021 00:29:32 +0000 Subject: [issue1227748] doc: subprocess: inheritance of std descriptors inconsistent Message-ID: <1619656172.1.0.474488628762.issue1227748@roundup.psfhosted.org> Eryk Sun added the comment: > If one calls Popen with stdin = stdout = stderr = None, > the caller's std descriptors are inherited on *x, but > not on Windows In the default case, CreateProcessW() is called with bInheritHandles as false and without explicitly setting the standard-handle values. Also, creationflags is 0 in the default case, not CREATE_NEW_CONSOLE, CREATE_NO_WINDOW, or DETACHED_PROCESS. In this case, the child's standard handles are implicitly duplicated from the parent if the child shares the parent's console session. Contra "1227748.patch", the standard handles are not "attached to the console window". For example, if the parent's stdout is redirected to a handle for an open disk file, the child's stdout will be redirected to the same open file. It has nothing to do with a window, and the console session doesn't even need to have a window (i.e. created with CREATE_NO_WINDOW; or a pseudoconsole session). In particular, if the executable image of the child is a console application, the system duplicates the parent's standard handles to the child, as well as a handle for the parent's console session, if any. If the child can connect to the parent's console at startup, then the duplicated standard handles are used, whatever they are. (In general, they need to be handles for pipe, character, or disk files opened in synchronous mode, as required by C standard I/O.) If the child can't connect to a console session, it allocates a new console and opens the console "Input" and "Output" as its standard handles. On the other hand, if the executable image of the child is not a console application, the system does not implicitly duplicate standard handles from the parent to the child. The window manager and graphical shell even explicitly reuse the standard-handle values (via STARTUPINFO) to implement features that aren't I/O file related when running GUI apps, including configuring an activation hotkey (stdin) or passing a handle for the preferred output monitor (stdout). ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 20:34:52 2021 From: report at bugs.python.org (Mohamed Moselhy) Date: Thu, 29 Apr 2021 00:34:52 +0000 Subject: [issue43971] documentation: no spacing around default args in annotated function Message-ID: <1619656492.65.0.621784631269.issue43971@roundup.psfhosted.org> New submission from Mohamed Moselhy : See https://www.python.org/dev/peps/pep-0008/#function-annotations The first section of https://docs.python.org/3/library/dataclasses.html shows quantity_on_hand: int=0, when there should be spacing around the '=' according to PEP 8 (see link above). ---------- assignee: docs at python components: Documentation files: screen.png messages: 392271 nosy: docs at python, eric.araujo, ezio.melotti, mdk, moselhy, willingc priority: normal severity: normal status: open title: documentation: no spacing around default args in annotated function versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file49998/screen.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 20:35:50 2021 From: report at bugs.python.org (Mohamed Moselhy) Date: Thu, 29 Apr 2021 00:35:50 +0000 Subject: [issue43971] documentation: no spacing around default args in annotated function In-Reply-To: <1619656492.65.0.621784631269.issue43971@roundup.psfhosted.org> Message-ID: <1619656550.3.0.933707486662.issue43971@roundup.psfhosted.org> Change by Mohamed Moselhy : ---------- keywords: +patch pull_requests: +24393 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25702 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 21:06:37 2021 From: report at bugs.python.org (Stephen Rosen) Date: Thu, 29 Apr 2021 01:06:37 +0000 Subject: [issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s Message-ID: <1619658397.03.0.0874955697236.issue43972@roundup.psfhosted.org> New submission from Stephen Rosen : If you use the `http.server` simple server and handler to serve a directory, navigating to a directory name without a trailing slash will trigger a 301 to add the trailing slash. For example, if "foo/" is a directory under the file server, a GET for "/foo" will receive a 301 Moved Permanently response with a Location header pointing at "/foo/". However, the response is sent without a "Content-Length: 0" and the connection is not closed. Unfortunately, certain clients will hang indefinitely and wait under these conditions, without processing the redirect. In my testing, curl 7.68 and Firefox 87 both exhibted this behavior. If a Content-Length header is set, these clients behave correctly. For example, subclass the handler and add def send_response(self, code): super().send_response(code) if code == HTTPStatus.MOVED_PERMANENTLY: self.send_header("Content-Length", "0") ---------- components: Library (Lib) messages: 392272 nosy: sirosen priority: normal severity: normal status: open title: Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 21:10:01 2021 From: report at bugs.python.org (Stephen Rosen) Date: Thu, 29 Apr 2021 01:10:01 +0000 Subject: [issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s In-Reply-To: <1619658397.03.0.0874955697236.issue43972@roundup.psfhosted.org> Message-ID: <1619658601.56.0.62963127131.issue43972@roundup.psfhosted.org> Change by Stephen Rosen : ---------- keywords: +patch pull_requests: +24395 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25705 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 22:06:14 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 29 Apr 2021 02:06:14 +0000 Subject: [issue24275] lookdict_* give up too soon In-Reply-To: <1432444109.96.0.971324850141.issue24275@psf.upfronthosting.co.za> Message-ID: <1619661974.01.0.064299165699.issue24275@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 8557edbfa8f74514de82feea4c62f5963e4e0aa7 by Hristo Venev in branch 'master': bpo-24275: Don't downgrade unicode-only dicts to mixed on lookups (GH-25186) https://github.com/python/cpython/commit/8557edbfa8f74514de82feea4c62f5963e4e0aa7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 22:06:31 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 29 Apr 2021 02:06:31 +0000 Subject: [issue24275] lookdict_* give up too soon In-Reply-To: <1432444109.96.0.971324850141.issue24275@psf.upfronthosting.co.za> Message-ID: <1619661991.73.0.114719495774.issue24275@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: remind -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 22:35:06 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 29 Apr 2021 02:35:06 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1619663706.43.0.788283970133.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset fa51c0c448aca9fe5d4e8bc02e71de528931778b by Inada Naoki in branch 'master': bpo-43651: Fix EncodingWarning in tests. (GH-25655) https://github.com/python/cpython/commit/fa51c0c448aca9fe5d4e8bc02e71de528931778b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 22:35:45 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 29 Apr 2021 02:35:45 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1619663745.25.0.333608075963.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset a69256527f93d2aa32e76658deab829e324d97b6 by Inada Naoki in branch 'master': bpo-43651: Fix EncodingWarning in `os.fdopen()` and test_os (GH-25654) https://github.com/python/cpython/commit/a69256527f93d2aa32e76658deab829e324d97b6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 22:36:12 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 29 Apr 2021 02:36:12 +0000 Subject: [issue41139] cgi uses the locale encoding for log files In-Reply-To: <1593257405.62.0.0746372218017.issue41139@roundup.psfhosted.org> Message-ID: <1619663772.73.0.0180315788008.issue41139@roundup.psfhosted.org> Inada Naoki added the comment: New changeset e52ab42cedd2a5ef4c3c1a47d0cf96a8f06d051f by Inada Naoki in branch 'master': bpo-41139: Deprecate `cgi.log()` (GH-25625) https://github.com/python/cpython/commit/e52ab42cedd2a5ef4c3c1a47d0cf96a8f06d051f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 22:36:58 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 29 Apr 2021 02:36:58 +0000 Subject: [issue41139] cgi uses the locale encoding for log files In-Reply-To: <1593257405.62.0.0746372218017.issue41139@roundup.psfhosted.org> Message-ID: <1619663818.9.0.614913296403.issue41139@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 23:15:04 2021 From: report at bugs.python.org (=?utf-8?b?4Lib4Lie4LiZ4Lie4Lix4LiK4Lij4LmMIOC4muC4o+C4o+C4nuC4iOC4sQ==?= =?utf-8?b?4LiZ4LiX4Lij4LmM?=) Date: Thu, 29 Apr 2021 03:15:04 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1619666104.04.0.693696223434.issue43651@roundup.psfhosted.org> Change by ???????? ?????????? : ---------- nosy: +ttx11529 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 23:44:39 2021 From: report at bugs.python.org (Bryan Silverthorn) Date: Thu, 29 Apr 2021 03:44:39 +0000 Subject: [issue1662] [patch] assert tp_traverse in PyType_GenericAlloc() In-Reply-To: <1198084921.68.0.0736452990224.issue1662@psf.upfronthosting.co.za> Message-ID: <1619667879.77.0.640537895942.issue1662@roundup.psfhosted.org> Bryan Silverthorn added the comment: I submitted this patch 14 years ago and am sure of nothing. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 28 23:57:26 2021 From: report at bugs.python.org (=?utf-8?b?4Lib4Lie4LiZ4Lie4Lix4LiK4Lij4LmMIOC4muC4o+C4o+C4nuC4iOC4sQ==?= =?utf-8?b?4LiZ4LiX4Lij4LmM?=) Date: Thu, 29 Apr 2021 03:57:26 +0000 Subject: [issue41608] IDLE: multiple space deletion by Backspace after non-spaces In-Reply-To: <1598016389.5.0.122509577817.issue41608@roundup.psfhosted.org> Message-ID: <1619668646.63.0.808506094362.issue41608@roundup.psfhosted.org> Change by ???????? ?????????? : ---------- nosy: +ttx11529 Added file: https://bugs.python.org/file49999/pb_tool-3.1.0-py3-none-any.whl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 01:17:17 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 29 Apr 2021 05:17:17 +0000 Subject: [issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths In-Reply-To: <1619627176.09.0.686852454721.issue43968@roundup.psfhosted.org> Message-ID: <1619673437.78.0.815421493144.issue43968@roundup.psfhosted.org> Eryk Sun added the comment: A substitute drive is not a mount point, strictly speaking. It's a symlink in the object namespace that targets an arbitrary path on a device, or even on another mapped/substitute drive. A mapped drive is a similar case that targets an arbitrary path on a UNC share. Any number of these path components may be filesystem symlinks, which can in turn target other substitute drives and mapped drives. The object manager reparses your example substitute drive "Z:" to its target path r"C:\example\dir" before the I/O manager and filesystem ever see the path. Thus, hypothetically, if r"Z:\symlink" targets r"\spam", it resolves to r"C:\spam", not r"Z:\spam", i.e. not r"C:\example\dir\spam". If r"Z:\symlink" targets r"..\spam", it resolves to r"C:\example\spam". Also, substitute drives are almost always defined for the current logon session only. If you think it's not an issue because you're the only user on the machine, there's still typically a linked logon to worry about in the case of a UAC split standard/administrator logon; plus there are service processes running as SYSTEM, NETWORK SERVICE, and LOCAL SERVICE; and maybe also non-interactive tasks running as the user account in a separate logon session. Given that Windows is inherently a multiple-logon system, a path that's only accessible by one logon session in the system is not the best candidate for a real path if it's possible to resolve it further to a path that's globally accessible. --- A mount point, unlike a symlink, is a graft point that behaves like a regular subtree. Classical mount points in Windows are the root paths of volume devices (e.g. "C:\\", where "C:" is a volume device name) and redirected filesystems mounted as UNC shares (e.g. r"\\server\share"). Windows 2000 added support for bind mount points (i.e. junctions, e.g. r"C:\Mount\F"). Unfortunately, switching to junctions probably won't solve your problem. The current design of ntpath.realpath() doesn't always retain a bind mount point in the resolved path, not unless it's the canonical path of a local volume -- or unless it's in a UNC path since it's impossible to resolve a remote junction to an accessible target path. ---------- components: +Windows nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 01:59:03 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 29 Apr 2021 05:59:03 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619675943.7.0.63025784849.issue43892@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset 1e7b858575d0ad782939f86aae4a2fa1c29e9f14 by Nick Coghlan in branch 'master': bpo-43892: Make match patterns explicit in the AST (GH-25585) https://github.com/python/cpython/commit/1e7b858575d0ad782939f86aae4a2fa1c29e9f14 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 02:07:32 2021 From: report at bugs.python.org (Michael Felt) Date: Thu, 29 Apr 2021 06:07:32 +0000 Subject: [issue43659] AIX: test_curses crashes buildbot In-Reply-To: <1617040273.92.0.487968447995.issue43659@roundup.psfhosted.org> Message-ID: <1619676452.77.0.59387096883.issue43659@roundup.psfhosted.org> Change by Michael Felt : ---------- type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 02:12:56 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 29 Apr 2021 06:12:56 +0000 Subject: [issue37903] IDLE Shell sidebar. In-Reply-To: <1566370033.98.0.615651298891.issue37903@roundup.psfhosted.org> Message-ID: <1619676776.71.0.115066947643.issue37903@roundup.psfhosted.org> Change by Tal Einat : ---------- pull_requests: +24396 pull_request: https://github.com/python/cpython/pull/25708 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 02:18:50 2021 From: report at bugs.python.org (Tal Einat) Date: Thu, 29 Apr 2021 06:18:50 +0000 Subject: [issue41608] IDLE: multiple space deletion by Backspace after non-spaces In-Reply-To: <1598016389.5.0.122509577817.issue41608@roundup.psfhosted.org> Message-ID: <1619677130.56.0.0429307356716.issue41608@roundup.psfhosted.org> Change by Tal Einat : Removed file: https://bugs.python.org/file49999/pb_tool-3.1.0-py3-none-any.whl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 02:28:19 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 29 Apr 2021 06:28:19 +0000 Subject: [issue41608] IDLE: multiple space deletion by Backspace after non-spaces In-Reply-To: <1598016389.5.0.122509577817.issue41608@roundup.psfhosted.org> Message-ID: <1619677699.04.0.869078436393.issue41608@roundup.psfhosted.org> Terry J. Reedy added the comment: Tests are needed. See review. Thinking about tests makes me realize that we need to extract an EditorText class that has the methods that only apply to the text component of EditorWindow. That is most of them. This would make testing easier because there would be no need to create a window to test the text methods. ---------- stage: patch review -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 02:29:05 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 29 Apr 2021 06:29:05 +0000 Subject: [issue41608] IDLE: multiple space deletion by Backspace after non-spaces In-Reply-To: <1598016389.5.0.122509577817.issue41608@roundup.psfhosted.org> Message-ID: <1619677745.52.0.182779503522.issue41608@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: +Python 3.11 -Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 02:29:17 2021 From: report at bugs.python.org (Yves Duprat) Date: Thu, 29 Apr 2021 06:29:17 +0000 Subject: [issue43352] Add a Barrier object in asyncio lib In-Reply-To: <1614598796.36.0.0905111746151.issue43352@roundup.psfhosted.org> Message-ID: <1619677757.99.0.0404935233229.issue43352@roundup.psfhosted.org> Yves Duprat added the comment: An update was submitted on PR. Modified python files are: file lib/asyncio/locks.py file lib/test/test_asyncio/test_locks.py And related documentation files file Doc/library/asyncio-api-index.rst file Doc/library/asyncio-sync.rst Please, could you have a look ? ---------- status: open -> pending versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 02:44:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 06:44:45 +0000 Subject: [issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled In-Reply-To: <1474611707.66.0.467568151114.issue28254@psf.upfronthosting.co.za> Message-ID: <1619678685.97.0.848001222463.issue28254@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24398 pull_request: https://github.com/python/cpython/pull/25709 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 02:47:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 06:47:18 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619678838.51.0.772423295256.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5daf70b22e72ea1a88c05975f69120b8c4e4927f by Erlend Egeberg Aasland in branch 'master': bpo-43908: Make re types immutable (GH-25697) https://github.com/python/cpython/commit/5daf70b22e72ea1a88c05975f69120b8c4e4927f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 02:47:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 06:47:54 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619678874.69.0.931609537013.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: New changeset c6ad03fddf4b04c60dca4327140e59fb2dcca8e5 by Erlend Egeberg Aasland in branch 'master': bpo-43908: Make array.array type immutable (GH-25696) https://github.com/python/cpython/commit/c6ad03fddf4b04c60dca4327140e59fb2dcca8e5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 03:01:25 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 29 Apr 2021 07:01:25 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619679685.74.0.163450680871.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: The types converted to heap types in 3.10 are different from 3.9 therefore just backporting wouldn't help. Should we now try to apply the flags on other types? If yes then I'd like to volunteer to apply the flags on the types converted in 3.9. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 03:47:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 07:47:04 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619682424.21.0.929033842076.issue43908@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24399 pull_request: https://github.com/python/cpython/pull/25710 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 04:19:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 08:19:27 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619684367.95.0.380113185289.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: > BTW, slightly related, AFAICT: > - https://github.com/python/cpython/blob/e047239eafefe8b19725efffe7756443495cf78b/Objects/typeobject.c#L4620-L4668 > - bpo-24912 object_set_class() must be changed to check for Py_TPFLAGS_IMMUTABLETYPE flag, rather than Py_TPFLAGS_HEAPTYPE. Erlend: Do you want to write such change? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 04:20:26 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 29 Apr 2021 08:20:26 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619684426.95.0.358595251045.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > Erlend: Do you want to write such change? Sure, I'll have a go at it. Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 04:26:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 08:26:19 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1619684779.05.0.848379819934.issue43774@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24400 pull_request: https://github.com/python/cpython/pull/25711 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 04:26:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 08:26:37 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619684797.88.0.549527925542.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5bd0619533ed6587ce76402e9b0b118eb4d4dd09 by Victor Stinner in branch 'master': bpo-43908: Document Static Types in the C API (GH-25710) https://github.com/python/cpython/commit/5bd0619533ed6587ce76402e9b0b118eb4d4dd09 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 04:26:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 08:26:57 +0000 Subject: [issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled In-Reply-To: <1474611707.66.0.467568151114.issue28254@psf.upfronthosting.co.za> Message-ID: <1619684817.08.0.906418067642.issue28254@roundup.psfhosted.org> STINNER Victor added the comment: New changeset b1f413e6cf63a1c5704fcb47f2095ef5db8970bb by Victor Stinner in branch 'master': bpo-28254: Cleanup test_subprocess.test_preexec_gc_module_failure() (GH-25709) https://github.com/python/cpython/commit/b1f413e6cf63a1c5704fcb47f2095ef5db8970bb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 04:27:05 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 29 Apr 2021 08:27:05 +0000 Subject: [issue43973] Use Py_TPFLAGS_IMMUTABLETYPE in __class__ assignments check Message-ID: <1619684825.72.0.216977603094.issue43973@roundup.psfhosted.org> New submission from Erlend Egeberg Aasland : Use Py_TPFLAGS_IMMUTABLETYPE?iso. Py_TPFLAGS_HEAPTYPE in object_set_class(). See also: - bpo-43908 (particularly msg392286) - bpo-24912 - https://github.com/python/cpython/blob/e047239eafefe8b19725efffe7756443495cf78b/Objects/typeobject.c#L4620-L4668 ---------- messages: 392290 nosy: erlendaasland, gvanrossum, pitrou, vstinner priority: normal severity: normal status: open title: Use Py_TPFLAGS_IMMUTABLETYPE in __class__ assignments check _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 04:35:19 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 29 Apr 2021 08:35:19 +0000 Subject: [issue43973] Use Py_TPFLAGS_IMMUTABLETYPE in __class__ assignments check In-Reply-To: <1619684825.72.0.216977603094.issue43973@roundup.psfhosted.org> Message-ID: <1619685319.39.0.839354323973.issue43973@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: IMO, we can drop most (all?) of the huge comment before the check in object_set_class(). History is preserved in the git log. Contrary to Py_TPFLAGS_HEAPTYPE, using Py_TPFLAGS_IMMUTABLETYPE speaks for itself. We might reduce it to just refer to to bpo-43908 and bpo-24912. Something a la this: /* Historically, only static types were immutable. * Py_TPFLAGS_IMMUTABLETYPE was introduced in Python 3.10. * See bpo-43908 and bpo-24912. */ What do you think? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 04:47:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 08:47:35 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1619686055.43.0.15290858175.issue43774@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24401 pull_request: https://github.com/python/cpython/pull/25712 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 04:47:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 08:47:52 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1619686072.19.0.349284527516.issue43774@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 645ed62fb4c09b7e23887fcca0767b0f2d7d3fd6 by Victor Stinner in branch 'master': bpo-43774: Remove unused PYMALLOC_DEBUG macro (GH-25711) https://github.com/python/cpython/commit/645ed62fb4c09b7e23887fcca0767b0f2d7d3fd6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 05:02:26 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 29 Apr 2021 09:02:26 +0000 Subject: [issue43974] setup.py should set Py_BUILD_CORE_MODULE as defined macro Message-ID: <1619686946.42.0.670507836309.issue43974@roundup.psfhosted.org> New submission from Christian Heimes : CPython's setup.py contains lots of extra_compile_args = ['-DPy_BUILD_CORE_MODULE'] to mark modules as core module. Extra compiler args is the wrong option. It's also tedious and err-prone to define the macro in each and every Extension() class instance. The compiler flag should be set automatically for all core extensions and it should use be set using the correct option define_macros. ---------- assignee: christian.heimes components: Build messages: 392293 nosy: christian.heimes, pablogsal, vstinner priority: normal severity: normal status: open title: setup.py should set Py_BUILD_CORE_MODULE as defined macro type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 05:04:49 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 29 Apr 2021 09:04:49 +0000 Subject: [issue43974] setup.py should set Py_BUILD_CORE_MODULE as defined macro In-Reply-To: <1619686946.42.0.670507836309.issue43974@roundup.psfhosted.org> Message-ID: <1619687089.19.0.500909350369.issue43974@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch pull_requests: +24402 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25713 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 05:15:48 2021 From: report at bugs.python.org (Scott Means) Date: Thu, 29 Apr 2021 09:15:48 +0000 Subject: [issue43975] Incorrect MIME type returned for .js files Windows 10. Message-ID: <1619687748.29.0.910634957661.issue43975@roundup.psfhosted.org> New submission from Scott Means : This isn't *technically* a bug in Python, but it really presents like one. I like to run the http.server for quick-and-dirty web development, but today Chrome refused to load any of my .js files because the server is returning a MIME type of 'text/plain'. I downloaded server.py and played with it for a while, and realized that mimetypes.guess_type() is returning 'text/plain' for .js files. So then I read further into the code and realized that mimetypes is harvesting MIME types from the Windows registry. And for some reason, at least on my machine, HKEY_CLASSES_ROOT\.js\Content Type was 'text/plain'. Changing it to 'application/javascript' fixed my issue, but I'm guessing that a lot of Python devs won't bother to dig this deep. I don't know what an appropriate fix would be, other than to probably trust the built-in MIME types over the ones harvested from Windows. ---------- components: Library (Lib) messages: 392294 nosy: smeans priority: normal severity: normal status: open title: Incorrect MIME type returned for .js files Windows 10. type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 05:22:43 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 29 Apr 2021 09:22:43 +0000 Subject: [issue43974] setup.py should set Py_BUILD_CORE_MODULE as defined macro In-Reply-To: <1619686946.42.0.670507836309.issue43974@roundup.psfhosted.org> Message-ID: <1619688163.98.0.791990186098.issue43974@roundup.psfhosted.org> Christian Heimes added the comment: Related to the change: It looks like we can also cleanup Modules/Setup and remove -DPy_BUILD_CORE_BUILTIN and -DPy_BUILD_CORE_MODULE. Modules/makesetup adds $PY_BUILTIN_MODULE_CFLAGS in the compile step. The variable is defined as PY_BUILTIN_MODULE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 05:30:02 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 29 Apr 2021 09:30:02 +0000 Subject: [issue43973] Use Py_TPFLAGS_IMMUTABLETYPE in __class__ assignments check In-Reply-To: <1619684825.72.0.216977603094.issue43973@roundup.psfhosted.org> Message-ID: <1619688602.13.0.270684620755.issue43973@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch pull_requests: +24403 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25714 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 05:33:23 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 29 Apr 2021 09:33:23 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1619688803.15.0.505369991806.issue43795@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset f6ee4dad589c0953283dacb577a2d808fda7aae9 by Petr Viktorin in branch 'master': bpo-43795: Generate python3dll.c and doc data from manifest (PEP 652) (GH-25315) https://github.com/python/cpython/commit/f6ee4dad589c0953283dacb577a2d808fda7aae9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 05:38:48 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 29 Apr 2021 09:38:48 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619689128.45.0.611625062047.issue43908@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24404 pull_request: https://github.com/python/cpython/pull/25714 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 05:54:26 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 29 Apr 2021 09:54:26 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619690066.26.0.762905658963.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Serhiy, would you mind reviewing the PR? bpo-43974 will clean up the changes introduced to setup.py. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 06:48:25 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 29 Apr 2021 10:48:25 +0000 Subject: [issue37892] IDLE Shell: isolate user code input In-Reply-To: <1566301123.94.0.491748175182.issue37892@roundup.psfhosted.org> Message-ID: <1619693305.4.0.432707342913.issue37892@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 8ec2f0dc0cd096b7a851b1a41e458daa23bf1ffc by Terry Jan Reedy in branch 'master': bpo-37892: Use space indents in IDLE Shell (GH-25678) https://github.com/python/cpython/commit/8ec2f0dc0cd096b7a851b1a41e458daa23bf1ffc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 06:55:35 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 29 Apr 2021 10:55:35 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1619693735.85.0.620243831769.issue43651@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +24405 pull_request: https://github.com/python/cpython/pull/25715 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 07:07:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 11:07:12 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1619694432.61.0.650833425255.issue43774@roundup.psfhosted.org> STINNER Victor added the comment: New changeset abfd6388cdba376a72686df52a9a98b2d558271b by Victor Stinner in branch 'master': bpo-43774: Enhance debug build documentation (GH-25712) https://github.com/python/cpython/commit/abfd6388cdba376a72686df52a9a98b2d558271b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 07:14:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 11:14:57 +0000 Subject: [issue1227748] doc: subprocess: inheritance of std descriptors inconsistent Message-ID: <1619694897.62.0.444712351834.issue1227748@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 07:26:34 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 29 Apr 2021 11:26:34 +0000 Subject: [issue43774] [Doc] Document configure options in the Python documentation In-Reply-To: <1617898687.07.0.687741116683.issue43774@roundup.psfhosted.org> Message-ID: <1619695594.65.0.0153958337201.issue43774@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- nosy: +orsenthil nosy_count: 5.0 -> 6.0 pull_requests: +24406 pull_request: https://github.com/python/cpython/pull/25716 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 07:27:27 2021 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 29 Apr 2021 11:27:27 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619695647.68.0.266015417843.issue43892@roundup.psfhosted.org> Nick Coghlan added the comment: After the next docs build, the documentation for the explicit AST nodes should be available https://docs.python.org/dev/library/ast.html#pattern-matching ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 07:37:41 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 29 Apr 2021 11:37:41 +0000 Subject: [issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib In-Reply-To: <1617243802.32.0.330769768422.issue43651@roundup.psfhosted.org> Message-ID: <1619696261.81.0.700158236868.issue43651@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 53dd6c99b39d90935c00bc1558582e494641248e by Inada Naoki in branch 'master': bpo-43651: Fix test_logging (GH-25715) https://github.com/python/cpython/commit/53dd6c99b39d90935c00bc1558582e494641248e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 07:59:17 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 29 Apr 2021 11:59:17 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1619697557.94.0.253335184342.issue43795@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- nosy: +orsenthil nosy_count: 3.0 -> 4.0 pull_requests: +24407 pull_request: https://github.com/python/cpython/pull/25716 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 08:12:58 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 29 Apr 2021 12:12:58 +0000 Subject: [issue42739] Crash when try to disassemble bogus code object In-Reply-To: <1608897358.97.0.834158885511.issue42739@roundup.psfhosted.org> Message-ID: <1619698378.5.0.293231526464.issue42739@roundup.psfhosted.org> Mark Shannon added the comment: New changeset c76da79b37d2bcbe575cc927ba0a9b7a9ce465db by Mark Shannon in branch 'master': bpo-42739: Don't use sentinels to mark end of line table. (GH-25657) https://github.com/python/cpython/commit/c76da79b37d2bcbe575cc927ba0a9b7a9ce465db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 08:15:11 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 29 Apr 2021 12:15:11 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619698511.28.0.471686965815.issue43933@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +24408 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25717 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 08:20:10 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 29 Apr 2021 12:20:10 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619698810.04.0.696873897131.issue43933@roundup.psfhosted.org> Mark Shannon added the comment: I'm going to set the line number for executing the `__exit__()` function as that of the `with` keyword. This should give a sensible traceback, and not break coverage, as the with statement is already executed. It will impact traces and profiles, which is why the __exit__ call was not given a line number before. Anthony, Ned, please let me know if you disagree. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 08:44:00 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 29 Apr 2021 12:44:00 +0000 Subject: [issue43973] Use Py_TPFLAGS_IMMUTABLETYPE in __class__ assignments check In-Reply-To: <1619684825.72.0.216977603094.issue43973@roundup.psfhosted.org> Message-ID: <1619700240.7.0.159329254448.issue43973@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 08:53:56 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 29 Apr 2021 12:53:56 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1619700836.28.0.783804906919.issue41282@roundup.psfhosted.org> Change by Filipe La?ns : ---------- pull_requests: +24409 pull_request: https://github.com/python/cpython/pull/25718 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 08:54:12 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 29 Apr 2021 12:54:12 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619700852.44.0.524365553478.issue43933@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +24410 pull_request: https://github.com/python/cpython/pull/25719 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 09:16:18 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 29 Apr 2021 13:16:18 +0000 Subject: [issue42739] Crash when try to disassemble bogus code object In-Reply-To: <1608897358.97.0.834158885511.issue42739@roundup.psfhosted.org> Message-ID: <1619702178.43.0.384416758643.issue42739@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 09:19:30 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 29 Apr 2021 13:19:30 +0000 Subject: [issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled In-Reply-To: <1474611707.66.0.467568151114.issue28254@psf.upfronthosting.co.za> Message-ID: <1619702370.57.0.220554222231.issue28254@roundup.psfhosted.org> Change by Petr Viktorin : ---------- nosy: +petr.viktorin nosy_count: 5.0 -> 6.0 pull_requests: +24411 pull_request: https://github.com/python/cpython/pull/25720 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 09:28:45 2021 From: report at bugs.python.org (Larry Hastings) Date: Thu, 29 Apr 2021 13:28:45 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619702925.27.0.967484515431.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: Ie debated about this with myself (and with a friend!) over the last few days, and I've concluded that evaluating strings by default is too opinionated for the standard library. I've changed both inspect.signature() and inspect.get_annotations() so eval_str is False by default (and removed the ONLY_IF_STRINGIZED logic entirely). Both functions will still raise an exception if eval_str=True, but this will only happen if the user explicitly requests evaluating the strings. I've already updated the PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 09:31:19 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 29 Apr 2021 13:31:19 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1619703079.51.0.123502651912.issue40222@roundup.psfhosted.org> Mark Shannon added the comment: > BTW, what are the three POP_TOP op codes in a row popping? When exceptions are pushed to the stack, they are pushed as a triple: (exc, type, traceback) so when we pop them, we need three pops. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 09:37:18 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 29 Apr 2021 13:37:18 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1619703438.07.0.889006998357.issue40222@roundup.psfhosted.org> Mark Shannon added the comment: Responding to Serhiy's suggestions: 1 Add another column: Adding another column makes for lots of repetition in larger try blocks, and pushes useful information further to the right. 2 Add pseudo-instructions I find those misleading, as they aren't really there, and probably won't even correspond to the original SETUP_XXX instructions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 09:39:59 2021 From: report at bugs.python.org (Glenn Travis) Date: Thu, 29 Apr 2021 13:39:59 +0000 Subject: [issue32824] Docs: Using Python on a Macintosh has bad info per Apple site In-Reply-To: <1AE70ADD-C24C-4744-9A3B-4910BE6109C4@comcast.net> Message-ID: <86B8BCC3-C549-441D-9E69-557CF0F89772@comcast.net> Glenn Travis added the comment: Here is a copy of the Apple Python call as of April 29, 2021. To my way of thinking it seems that Apple is saying that someday they will indeed eliminate all the included ?scripting? software from macOS and they further imply that one should install an. Up-to-date version of one?s particular chosen software. Last login: Thu Apr 29 08:22:47 on console % python WARNING: Python 2.7 is not recommended. This version is included in macOS for compatibility with legacy software. Future versions of macOS will not include Python 2.7. Instead, it is recommended that you transition to using 'python3' from within Terminal. Python 2.7.16 (default, Feb 28 2021, 12:34:25) [GCC Apple LLVM 12.0.5 (clang-1205.0.19.59.6) [+internal-os, ptrauth-isa=deploy on darwin Type "help", "copyright", "credits" or "license" for more information. >>> exit() % exit Saving session... ...copying shared history... ...saving history...truncating history files... ...completed. [Process completed] > On Apr 28, 2021, at 4:25 PM, Glenn Travis wrote: > > > Glenn Travis added the comment: > > I see that this remains alive. I do have a newer question. Apple continues to say that they are going to drop all their included versions of python and I believe ruby in some future version of macOS. I thought that this would happen in Big Sur, but python versions 2.7.16 still remains with us, why, I don?t know. > >> On Apr 28, 2021, at 3:21 PM, Irit Katriel wrote: >> >> >> Change by Irit Katriel : >> >> >> ---------- >> versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.6, Python 3.7, Python 3.8 >> >> _______________________________________ >> Python tracker >> >> _______________________________________ > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 09:47:06 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 29 Apr 2021 13:47:06 +0000 Subject: [issue28254] Add C API for gc.enable, gc.disable, and gc.isenabled In-Reply-To: <1474611707.66.0.467568151114.issue28254@psf.upfronthosting.co.za> Message-ID: <1619704026.95.0.688225777944.issue28254@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 14fc2bdfab857718429029e53ceffca456178827 by Petr Viktorin in branch 'master': bpo-28254: Add PyGC_ functions to the stable ABI manifest (GH-25720) https://github.com/python/cpython/commit/14fc2bdfab857718429029e53ceffca456178827 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 09:53:50 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 29 Apr 2021 13:53:50 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1619704430.69.0.926614673722.issue40222@roundup.psfhosted.org> Mark Shannon added the comment: I've played around with a few formats, and what I've ended up with is this: 1. Use the >> marker for for exception targets, as well as normal branch targets. 2. Add a text version of the exception handler table at the end of the disassembly. This has all the information, without too much visual clutter. The function `f` above looks like this: >>> dis.dis(f) 2 0 NOP 3 2 LOAD_CONST 1 (1) 4 LOAD_CONST 2 (0) 6 BINARY_TRUE_DIVIDE 8 POP_TOP 10 NOP 12 LOAD_CONST 0 (None) 14 RETURN_VALUE >> 16 NOP 18 PUSH_EXC_INFO 4 20 POP_TOP 22 POP_TOP 24 POP_TOP 5 26 NOP 28 POP_EXCEPT 30 LOAD_CONST 3 ('fail') 32 RETURN_VALUE >> 34 POP_EXCEPT_AND_RERAISE ExceptionTable: 2 to 8 -> 16 (depth 0) 18 to 24 -> 34 (depth 3) lasti The 'lasti' field indicates that the offset of the last instruction is pushed to the stack, which is needed for cleanup-then-reraise code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 09:54:09 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 29 Apr 2021 13:54:09 +0000 Subject: [issue37387] test_compileall fails randomly on Windows when tests are run in parallel In-Reply-To: <1561383626.08.0.320504464802.issue37387@roundup.psfhosted.org> Message-ID: <1619704449.15.0.546716553998.issue37387@roundup.psfhosted.org> Shreyan Avigyan added the comment: I've experienced that when a module is imported in the interpreter that module file (.py, .pyc, .pyd) cannot be deleted, renamed, rewritten, etc. When that session is closed only then the file can be deleted, renamed, rewritten, all that stuff. Running tests in parallel means running 2 or more tests at the same time right? Therefore may be when test_compileall tries to rewrite the .pyc it results in a error because the file may be open as a module in another test that is also being ran at the same time. This should also clarify why test_compileall fails randomly and not all the time. ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 10:05:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 14:05:27 +0000 Subject: [issue43908] array.array should remain immutable In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619705127.85.0.909927347501.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: check_set_special_type_attr() must also be updated to check for Py_TPFLAGS_IMMUTABLETYPE flag. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 10:14:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 14:14:53 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619705693.56.0.872677166297.issue43908@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: array.array should remain immutable -> array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 10:15:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 14:15:43 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619705743.21.0.957597769253.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: > Erlend: Do you want to write such change? Erlend created bpo-43973 and PR 25714. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 10:17:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 14:17:50 +0000 Subject: [issue43973] Use Py_TPFLAGS_IMMUTABLETYPE in __class__ assignments check In-Reply-To: <1619684825.72.0.216977603094.issue43973@roundup.psfhosted.org> Message-ID: <1619705870.82.0.236859207436.issue43973@roundup.psfhosted.org> STINNER Victor added the comment: > IMO, we can drop most (all?) of the huge comment before the check in object_set_class(). I don't think so. I don't understand why it's allowed to override the __class__ attribute of ModuleType instances whereas it's a static type. IMO the long comment remains useful and something should be done later to make the condition more generic, rather than checking PyType_IsSubtype(newto, &PyModule_Type) specifically. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 10:21:36 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 29 Apr 2021 14:21:36 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619706096.3.0.213230653512.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > check_set_special_type_attr() must also be updated to check for Py_TPFLAGS_IMMUTABLETYPE flag. Ok, lets just use this issue for the PR. I can fix it in an hour or so. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 10:23:59 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 29 Apr 2021 14:23:59 +0000 Subject: [issue37387] test_compileall fails randomly on Windows when tests are run in parallel In-Reply-To: <1561383626.08.0.320504464802.issue37387@roundup.psfhosted.org> Message-ID: <1619706239.49.0.0700563800871.issue37387@roundup.psfhosted.org> Shreyan Avigyan added the comment: I don't think it's a bug at all. It's a feature of Python that's causing this. And since it's not a bug I don't think copying the files in temporary directory would help at all because Windows is not giving the error. Python is giving the error to Python itself! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 10:27:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 14:27:39 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619706459.75.0.498618370957.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: > https://discuss.python.org/t/list-of-built-in-types-converted-to-heap-types/8403 In the past, I used _random.Random for manual tests to compare static type and heap types, check which one is mutable. C type _random.Random is inherited by Python type random.Random which is mutable. Since _random.Random is not directly seen by developers, I don't think that it's worth it to make it immutable. For the other types, I would not say that they are "built-in types" or that it would be really bad to modify them. I would say that for the other types, the "We are consenting adults" rule stands. You can hack a type for a very specific need, but in this case you are on your own. For example, people love to hack AST. Maybe the fact that ast.AST became mutable in Python 3.9 will unlock some crazy hack? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 10:27:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 14:27:57 +0000 Subject: [issue43908] array.array and re types must be immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619706477.1.0.773987480738.issue43908@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag -> array.array and re types must be immutable: add Py_TPFLAGS_IMMUTABLETYPE flag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 10:30:32 2021 From: report at bugs.python.org (Larry Hastings) Date: Thu, 29 Apr 2021 14:30:32 +0000 Subject: [issue42904] get_type_hints does not provide localns for classes In-Reply-To: <1610427615.24.0.000795612365541.issue42904@roundup.psfhosted.org> Message-ID: <1619706632.49.0.933836704015.issue42904@roundup.psfhosted.org> Larry Hastings added the comment: kj: I just added support for default locals to inspect.get_annotation(), and I basically copied-and-pasted your dict(vars(base)) approach. Is this "surprising, but required" behavior due specifically to this being a backwards-incompatible change? inspect.get_annotations() will be a new function in Python 3.10, which means I have no existing users to worry about. Does that mean I don't have the problem you're solving by reversing the order of namespace lookup, and I can just pass globals and locals in like normal? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 10:59:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 14:59:29 +0000 Subject: [issue43908] array.array and re types must be immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619708369.98.0.0331315724797.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: check_set_special_type_attr() is used to prevent setting the following attributes: * __name__ * __qualname__ * __module__ * __bases__ * __doc__ Right now, I cannot set the attribues on array.array type: $ ./python Python 3.10.0a7+ (heads/debug_doc2-dirty:0623fdb60d, Apr 29 2021, 12:06:18) >>> import array >>> array.array.__name__ = 'newname' TypeError: can't set attributes of built-in/extension type 'array.array' >>> array.array.__qualname__ = 'newname' TypeError: can't set attributes of built-in/extension type 'array.array' >>> array.array.__module__ = 'new module' TypeError: can't set attributes of built-in/extension type 'array.array' >>> array.array.__bases__ = (int,) TypeError: can't set attributes of built-in/extension type 'array.array' >>> array.array.__doc__ = 'doc' TypeError: can't set attributes of built-in/extension type 'array.array' I guess that type_setattro() is used and it checks for Py_TPFLAGS_IMMUTABLETYPE flag early. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 11:24:44 2021 From: report at bugs.python.org (Julien Castiaux) Date: Thu, 29 Apr 2021 15:24:44 +0000 Subject: [issue43922] Double dots in quopri transported emails In-Reply-To: <1619188610.43.0.088106557205.issue43922@roundup.psfhosted.org> Message-ID: <1619709884.6.0.0731443125364.issue43922@roundup.psfhosted.org> Julien Castiaux added the comment: Hello David, The third party smtp software that causes troubles have been identified ! We are still investigating how to fix the problem at its root, ultimately this "fix" would not even be necessary. I'll keep you informed, just don't review or close the PR yet. Regards, ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 11:31:13 2021 From: report at bugs.python.org (Ammar Askar) Date: Thu, 29 Apr 2021 15:31:13 +0000 Subject: [issue43899] separate builtin function In-Reply-To: <1618955225.8.0.321357369426.issue43899@roundup.psfhosted.org> Message-ID: <1619710273.97.0.310960848477.issue43899@roundup.psfhosted.org> Ammar Askar added the comment: Note that the `more_itertools` package on pypi also has a partition method. Shall we close this off given that a recipe is already present and this is available as part of a popular 3rd-party library? ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 11:36:15 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 29 Apr 2021 15:36:15 +0000 Subject: [issue42904] get_type_hints does not provide localns for classes In-Reply-To: <1610427615.24.0.000795612365541.issue42904@roundup.psfhosted.org> Message-ID: <1619710575.65.0.0663118558617.issue42904@roundup.psfhosted.org> Ken Jin added the comment: @larry > Is this "surprising, but required" behavior due specifically to this being a backwards-incompatible change? Yes. That's the main factor. I've since learnt that there's sadly more to it though :( (see below). > Does that mean I don't have the problem you're solving by reversing the order of namespace lookup, and I can just pass globals and locals in like normal? I think it depends on the ergonomics of the function you're trying to achieve. I admit I haven't been fully keeping up with the inspect.get_annotations issue (sorry!), but here's what I learnt from get_type_hints: (Partly copied over from PR 25632) Example: from typing import TypeVar, Generic T = TypeVar('T') class A(Generic[T]): __annotations__ = dict( some_b='B' ) class B(Generic[T]): class A(Generic[T]): pass __annotations__ = dict( my_inner_a1='B.A', my_inner_a2=A, my_outer_a='A' # unless somebody calls get_type_hints with localns=B.__dict__ ) >>> get_type_hints(B) Currently (globalns then localns): {'my_inner_a1': , 'my_inner_a2': , 'my_outer_a': } Swapped (localns then globalns): {'my_inner_a1': , 'my_inner_a2': , 'my_outer_a': } I realized that looking into globalns then localns is a necessary evil: doing the converse (looking into localns first then globalns) would mean there is no way to point to the shadowed global `A`: it would always point to the local `B.A`. Unless of course you pass in localns=module.__dict__ or localns=globals(). Ultimately I think it's a sacrifice of ergonomics either way; looking into localns then globalns will require passing in the module's __dict__ to refer to a global being shadowed, while the converse (globalns then localns) introduces surprising eval behavior. Both are kind of tacky, but globalns then localns is slightly less so IMO. If the user wants to specify the inner class, they can just annotate 'B.A', if they want the outer, it's 'A'. But the localns then globalns approach will always point to `B.A`, the only way to access the shadowed global `A` is to pass in the strange looking argument localns=module.__dict__. Phew, my head's spinning with localns and globalns now. Thanks for reading! I think it's your call. I'm inexperienced with elegant function design :P. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 11:37:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 15:37:04 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619710624.3.0.384556998174.issue43916@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24412 pull_request: https://github.com/python/cpython/pull/25721 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 11:46:46 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 29 Apr 2021 15:46:46 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1619711206.16.0.979866252951.issue41282@roundup.psfhosted.org> ?ric Araujo added the comment: PR 25718 was opened and linked to this ticket. It changes sysconfig to load install schemes from a separate module, so it?s not strictly about removing distutils but adding a new system customization feature. I think it needs its own bug and mailing-list discussion with interested parties to make sure the interface works for them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 11:47:33 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 29 Apr 2021 15:47:33 +0000 Subject: [issue37387] test_compileall fails randomly on Windows when tests are run in parallel In-Reply-To: <1561383626.08.0.320504464802.issue37387@roundup.psfhosted.org> Message-ID: <1619711253.33.0.17320879099.issue37387@roundup.psfhosted.org> Shreyan Avigyan added the comment: @vstinner What do you think? I'm not sure if there's a solution to this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 11:58:41 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 29 Apr 2021 15:58:41 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619711921.62.0.00661635677672.issue43916@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +24413 pull_request: https://github.com/python/cpython/pull/25722 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 12:11:00 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 29 Apr 2021 16:11:00 +0000 Subject: [issue43908] array.array and re types must be immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619708369.98.0.0331315724797.issue43908@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: That is as intended, right? On Thu, Apr 29, 2021 at 07:59 STINNER Victor wrote: > > STINNER Victor added the comment: > > check_set_special_type_attr() is used to prevent setting the following > attributes: > > * __name__ > * __qualname__ > * __module__ > * __bases__ > * __doc__ > > Right now, I cannot set the attribues on array.array type: > > $ ./python > Python 3.10.0a7+ (heads/debug_doc2-dirty:0623fdb60d, Apr 29 2021, 12:06:18) > >>> import array > > >>> array.array.__name__ = 'newname' > TypeError: can't set attributes of built-in/extension type 'array.array' > > >>> array.array.__qualname__ = 'newname' > TypeError: can't set attributes of built-in/extension type 'array.array' > > >>> array.array.__module__ = 'new module' > TypeError: can't set attributes of built-in/extension type 'array.array' > > >>> array.array.__bases__ = (int,) > TypeError: can't set attributes of built-in/extension type 'array.array' > > >>> array.array.__doc__ = 'doc' > TypeError: can't set attributes of built-in/extension type 'array.array' > > I guess that type_setattro() is used and it checks for > Py_TPFLAGS_IMMUTABLETYPE flag early. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > -- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 12:12:40 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 29 Apr 2021 16:12:40 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619706459.75.0.498618370957.issue43908@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: I don?t think we?re waiting for more crazy hacks. On Thu, Apr 29, 2021 at 07:27 STINNER Victor wrote: > > STINNER Victor added the comment: > > > > https://discuss.python.org/t/list-of-built-in-types-converted-to-heap-types/8403 > > In the past, I used _random.Random for manual tests to compare static type > and heap types, check which one is mutable. > > C type _random.Random is inherited by Python type random.Random which is > mutable. Since _random.Random is not directly seen by developers, I don't > think that it's worth it to make it immutable. > > For the other types, I would not say that they are "built-in types" or > that it would be really bad to modify them. I would say that for the other > types, the "We are consenting adults" rule stands. You can hack a type for > a very specific need, but in this case you are on your own. > > For example, people love to hack AST. Maybe the fact that ast.AST became > mutable in Python 3.9 will unlock some crazy hack? > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > -- --Guido (mobile) ---------- title: array.array and re types must be immutable: add Py_TPFLAGS_IMMUTABLETYPE flag -> array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 12:19:02 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 29 Apr 2021 16:19:02 +0000 Subject: [issue43976] Introduce mechanism to allow Python distributors to add custom site install schemes Message-ID: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> New submission from Filipe La?ns : As part of the distutils migration we plan to add a mechanism to let Python distributors to add site install schemes. Currently, Python distributors are patching distutils to add custom install schemes for their packages. I think most of the reasoning boils down to them wanting to stop Python installers, such as pip, to modify/interfere with their packages. With the distutils deprecation, and it becoming a 3rd party module, Python distributors can no longer patch it. Because of this, we made distutils use the sysconfig module instead, which fixes the issue at the moment -- Python distributors can now patch sysconfig itself -- but is not a long term solution. To prevent Python distributors from having to patch implementation details, and have things break unexpectedly, we aim to introduce a system that distributors can use for this purpose. The idea is that they have a config file, which they can pass to configure, and in that config file they can specify some extra install schemes. These install schemes will get added in sysconfig, and will be loaded in the site module initialization. In practice, it will look something like this: config.py ``` EXTRA_SITE_INSTALL_SCHEMES = { 'posix_prefix': { 'stdlib': '{installed_base}/{platlibdir}/python{py_version_short}', 'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}', 'purelib': '{base}/lib/python{py_version_short}/vendor-packages', 'platlib': '{platbase}/{platlibdir}/python{py_version_short}/vendor-packages', 'include': '{installed_base}/include/python{py_version_short}{abiflags}', 'platinclude': '{installed_platbase}/include/python{py_version_short}{abiflags}', 'scripts': '{base}/bin', 'data': '{base}', }, } ``` ./configure --with-vendor-config=config.py ---------- components: Library (Lib) messages: 392326 nosy: FFY00, jaraco priority: normal pull_requests: 24414 severity: normal status: open title: Introduce mechanism to allow Python distributors to add custom site install schemes type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 12:20:54 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 29 Apr 2021 16:20:54 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1619713254.77.0.868538682512.issue41282@roundup.psfhosted.org> Filipe La?ns added the comment: That is reasonable. I have created bpo-43976. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 12:24:39 2021 From: report at bugs.python.org (Ammar Askar) Date: Thu, 29 Apr 2021 16:24:39 +0000 Subject: [issue43614] Search is not beginner friendly In-Reply-To: <1616584368.72.0.108883750732.issue43614@roundup.psfhosted.org> Message-ID: <1619713479.31.0.528134621724.issue43614@roundup.psfhosted.org> Ammar Askar added the comment: Just a little update to this, now that issue34398 is fixed it is possible to make this more beginner friendly by making sure the right terms have glossary entries. As an example, here is a search for "argument" on the latest docs: https://docs.python.org/3.10/search.html?q=argument It would be nice if kwargs/args could also point to that. ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 12:30:49 2021 From: report at bugs.python.org (Paul Moore) Date: Thu, 29 Apr 2021 16:30:49 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1619713849.3.0.0340801977615.issue41282@roundup.psfhosted.org> Paul Moore added the comment: I'd suggest also posting it on the Packaging discourse, to get feedback from other distro maintainers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 12:33:41 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 29 Apr 2021 16:33:41 +0000 Subject: [issue43977] Implement the latest semantics for PEP 634 for matching collections Message-ID: <1619714021.85.0.37223153861.issue43977@roundup.psfhosted.org> New submission from Mark Shannon : PEP 634 has been updated to allow a faster and more robust implementation of matching sequences and mappings: https://github.com/python/peps/pull/1937 It needs to be implemented. ---------- assignee: Mark.Shannon messages: 392330 nosy: Mark.Shannon priority: high severity: normal status: open title: Implement the latest semantics for PEP 634 for matching collections _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 12:45:49 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 29 Apr 2021 16:45:49 +0000 Subject: [issue43977] Implement the latest semantics for PEP 634 for matching collections In-Reply-To: <1619714021.85.0.37223153861.issue43977@roundup.psfhosted.org> Message-ID: <1619714749.69.0.967109679663.issue43977@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +24415 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25723 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 12:48:27 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 29 Apr 2021 16:48:27 +0000 Subject: [issue41282] Deprecate and remove distutils In-Reply-To: <1594542625.3.0.789939298104.issue41282@roundup.psfhosted.org> Message-ID: <1619714907.27.0.216015172309.issue41282@roundup.psfhosted.org> Filipe La?ns added the comment: We have discussed this approach a little in a few bug trackers, but I opened https://discuss.python.org/t/mechanism-for-distributors-to-add-site-install-schemes-to-python-installations/8467. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 12:54:51 2021 From: report at bugs.python.org (Ammar Askar) Date: Thu, 29 Apr 2021 16:54:51 +0000 Subject: [issue43565] PyUnicode_KIND macro does not has specified return type In-Reply-To: <1616202653.73.0.639291876959.issue43565@roundup.psfhosted.org> Message-ID: <1619715291.93.0.828794329585.issue43565@roundup.psfhosted.org> Change by Ammar Askar : ---------- keywords: +patch nosy: +ammar2 nosy_count: 4.0 -> 5.0 pull_requests: +24416 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25724 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 12:55:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 16:55:05 +0000 Subject: [issue43974] setup.py should set Py_BUILD_CORE_MODULE as defined macro In-Reply-To: <1619686946.42.0.670507836309.issue43974@roundup.psfhosted.org> Message-ID: <1619715305.37.0.985941677229.issue43974@roundup.psfhosted.org> STINNER Victor added the comment: I would prefer to limit the usage of the internal C API in extension modules built as dynamic libraries. See bpo-41111: "[C API] Convert a few stdlib extensions to the limited C API (PEP 384)". Also, this issue is motived by PR 25653 which requires to use the internal C API in many C extensions. But I proposed a different approach, PR 25710, which prevents that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 12:55:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 16:55:37 +0000 Subject: [issue43974] setup.py should set Py_BUILD_CORE_MODULE as defined macro In-Reply-To: <1619686946.42.0.670507836309.issue43974@roundup.psfhosted.org> Message-ID: <1619715337.26.0.956367640774.issue43974@roundup.psfhosted.org> STINNER Victor added the comment: > It looks like we can also cleanup Modules/Setup and remove -DPy_BUILD_CORE_BUILTIN and -DPy_BUILD_CORE_MODULE. Modules/makesetup adds $PY_BUILTIN_MODULE_CFLAGS in the compile step. Oh, I didn't notice. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 13:16:55 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 29 Apr 2021 17:16:55 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1619716615.5.0.908616585573.issue43882@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset 76cd81d60310d65d01f9d7b48a8985d8ab89c8b4 by Senthil Kumaran in branch 'master': bpo-43882 - urllib.parse should sanitize urls containing ASCII newline and tabs. (GH-25595) https://github.com/python/cpython/commit/76cd81d60310d65d01f9d7b48a8985d8ab89c8b4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 13:17:18 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Apr 2021 17:17:18 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1619716638.98.0.0755840364101.issue43882@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24418 pull_request: https://github.com/python/cpython/pull/25726 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 13:17:24 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Apr 2021 17:17:24 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1619716644.93.0.180837804949.issue43882@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24419 pull_request: https://github.com/python/cpython/pull/25727 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 13:17:30 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Apr 2021 17:17:30 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1619716650.75.0.34641752843.issue43882@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24420 pull_request: https://github.com/python/cpython/pull/25728 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 13:17:12 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Apr 2021 17:17:12 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1619716632.76.0.452686814263.issue43882@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24417 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25725 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 13:21:16 2021 From: report at bugs.python.org (Tim Peters) Date: Thu, 29 Apr 2021 17:21:16 +0000 Subject: [issue37387] test_compileall fails randomly on Windows when tests are run in parallel In-Reply-To: <1561383626.08.0.320504464802.issue37387@roundup.psfhosted.org> Message-ID: <1619716876.72.0.566888543014.issue37387@roundup.psfhosted.org> Tim Peters added the comment: @Sheyvan, whether it's possible to delete (rename, etc) an open file is a property not of Python, but of the operating system. Windows doesn't allow it; Linux (for example) does. It's generally considered to be "a bug" in CPython's implementation whenever it contains code that _assumes_ such things are safe (which is, alas, very easy for a Linux programmer to do by accident). So that test_compileall fails in this way is inarguably "a bug". Guido's larger point is harder to address, though. In theory, we control everything our test suite does, but little of what arbitrary users do. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 13:27:04 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 29 Apr 2021 17:27:04 +0000 Subject: [issue37387] test_compileall fails randomly on Windows when tests are run in parallel In-Reply-To: <1561383626.08.0.320504464802.issue37387@roundup.psfhosted.org> Message-ID: <1619717224.04.0.230243926724.issue37387@roundup.psfhosted.org> Shreyan Avigyan added the comment: What should we do? Should we skip test_compileall if the test suite is run in parallel? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 13:32:02 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 29 Apr 2021 17:32:02 +0000 Subject: [issue43977] Implement the latest semantics for PEP 634 for matching collections In-Reply-To: <1619714021.85.0.37223153861.issue43977@roundup.psfhosted.org> Message-ID: <1619717522.53.0.0743972970976.issue43977@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 13:48:05 2021 From: report at bugs.python.org (Tim Peters) Date: Thu, 29 Apr 2021 17:48:05 +0000 Subject: [issue37387] test_compileall fails randomly on Windows when tests are run in parallel In-Reply-To: <1561383626.08.0.320504464802.issue37387@roundup.psfhosted.org> Message-ID: <1619718485.64.0.448953299966.issue37387@roundup.psfhosted.org> Tim Peters added the comment: A "good" solution would be one that runs the test in such a way that it doesn't fail only on Windows ;-) There are presumably many ways that could be accomplished, including ugly ones. For example, if test_compileall is in the collection of tests to be run, and it's a parallel run, run it first by itself, before starting anything else in parallel. No, I'm not suggesting we do that. Just trying to get across that there are _always_ ways to worm around the bug du jour. I don't know enough about when and why CPython decides to replace .pyc files now to make another suggestion worth anyone else's time to evaluate. Victor already has something else in mind, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 13:57:46 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 29 Apr 2021 17:57:46 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1619719066.01.0.951301159829.issue43882@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset 491fde0161d5e527eeff8586dd3972d7d3a631a7 by Miss Islington (bot) in branch '3.9': [3.9] bpo-43882 - urllib.parse should sanitize urls containing ASCII newline and tabs. (GH-25595) (GH-25725) https://github.com/python/cpython/commit/491fde0161d5e527eeff8586dd3972d7d3a631a7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 14:02:48 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Apr 2021 18:02:48 +0000 Subject: [issue42589] doc: Wrong "from" keyword link in Exceptions doc In-Reply-To: <1607356415.63.0.620558354489.issue42589@roundup.psfhosted.org> Message-ID: <1619719368.28.0.843110593019.issue42589@roundup.psfhosted.org> miss-islington added the comment: New changeset 2fd928c8c1328424130cb9c51fc02ad5f9a66328 by sblondon in branch 'master': bpo-42589: Change URL for 'from' link when used in a raised exception (GH-23872) https://github.com/python/cpython/commit/2fd928c8c1328424130cb9c51fc02ad5f9a66328 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 14:02:51 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Apr 2021 18:02:51 +0000 Subject: [issue42589] doc: Wrong "from" keyword link in Exceptions doc In-Reply-To: <1607356415.63.0.620558354489.issue42589@roundup.psfhosted.org> Message-ID: <1619719371.66.0.417607527983.issue42589@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24421 pull_request: https://github.com/python/cpython/pull/25730 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 14:06:20 2021 From: report at bugs.python.org (Mariatta) Date: Thu, 29 Apr 2021 18:06:20 +0000 Subject: [issue42589] doc: Wrong "from" keyword link in Exceptions doc In-Reply-To: <1607356415.63.0.620558354489.issue42589@roundup.psfhosted.org> Message-ID: <1619719580.23.0.217802485695.issue42589@roundup.psfhosted.org> Mariatta added the comment: Thanks for the PR. There is conflict with applying it to the 3.8 branch. If you can get to it, it would be great. Thanks. ---------- nosy: +Mariatta stage: patch review -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 14:16:07 2021 From: report at bugs.python.org (Mariatta) Date: Thu, 29 Apr 2021 18:16:07 +0000 Subject: [issue43978] Incorrect "versionadded" info in typing.NoReturn documentation Message-ID: <1619720166.99.0.648507362303.issue43978@roundup.psfhosted.org> New submission from Mariatta : We received a documentation bug report in docs mailing list. https://mail.python.org/archives/list/docs at python.org/thread/BLANNZUPUEOJ4LJYSJNNFLK5I7NYE3GH/# It looks like the doc currently says that, typing.NoReturn was added in both 3.5.4 and 3.6.2 It appeared from this change, that it was originally added in 3.6.5 (https://github.com/python/cpython/pull/7107/files) However, during a refactoring effort, in https://github.com/python/cpython/commit/ab72fdeb82c3ab045b480cd4bb4f928c12653ecb, the 3.5.4 and 3.6.2 info were added, perhaps due to copy-pasting. I think it should be changed into .. versionadded:: 3.6.5 However, I'm curious to know whether there are other parts in the doc, where this info is wrong. So perhaps there was other parts of the doc that was added in 3.5.4, but somehow we moved that to the typing.NoReturn section. For now, I think we can just fix it by adding .. versionadded: 3.6.5 And maybe someone else can look into other parts of the doc to see if the version info are correct. ---------- assignee: docs at python components: Documentation keywords: easy, newcomer friendly messages: 392341 nosy: Mariatta, docs at python priority: normal severity: normal stage: needs patch status: open title: Incorrect "versionadded" info in typing.NoReturn documentation versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 14:26:33 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Apr 2021 18:26:33 +0000 Subject: [issue42589] doc: Wrong "from" keyword link in Exceptions doc In-Reply-To: <1607356415.63.0.620558354489.issue42589@roundup.psfhosted.org> Message-ID: <1619720793.36.0.140896017342.issue42589@roundup.psfhosted.org> miss-islington added the comment: New changeset 3eaa6f9d185f2a2c66d98a77d3ea3f407bc96d0e by Miss Islington (bot) in branch '3.9': bpo-42589: Change URL for 'from' link when used in a raised exception (GH-23872) https://github.com/python/cpython/commit/3eaa6f9d185f2a2c66d98a77d3ea3f407bc96d0e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 14:28:57 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 29 Apr 2021 18:28:57 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619720937.3.0.51219275227.issue43933@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 088a15c49d99ecb4c3bef93f8f40dd513c6cae3b by Mark Shannon in branch 'master': bpo-43933: Show frame.f_lineno as None, rather than -1, if there is no line number. (GH-25717) https://github.com/python/cpython/commit/088a15c49d99ecb4c3bef93f8f40dd513c6cae3b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 15:09:21 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 29 Apr 2021 19:09:21 +0000 Subject: [issue37387] test_compileall fails randomly on Windows when tests are run in parallel In-Reply-To: <1561383626.08.0.320504464802.issue37387@roundup.psfhosted.org> Message-ID: <1619723361.63.0.0692332071954.issue37387@roundup.psfhosted.org> Eryk Sun added the comment: > I don't know enough about when and why CPython decides to > replace .pyc files It's straight-forward in the case of py_compile.compile(): >>> pyc = py_compile.compile('test.py') >>> f = open(pyc) >>> try: py_compile.compile('test.py') ... except OSError as e: print(e) ... [WinError 5] Access is denied: '__pycache__\\test.cpython-310.pyc.1914201873840' -> '__pycache__\\test.cpython-310.pyc' Rewriting the file uses `importlib._bootstrap_external._write_atomic()`, which writes the PYC to a temporary name and then tries to replace the existing file via os.replace(). Replacing an existing filename will fail with access denied in Windows if the target filename exists and is already open, mapped as image/data, readonly, or a directory. Notably it's not a sharing violation in the case of an open file, which means it doesn't matter whether the open(s) share delete access or not. In Windows 10 the NT API has a new file rename operation that supports a flag to replace an open file, but in this case we're still stuck with the problem that existing opens have to share delete access. Most opens could share delete access without a problem, but most don't. ---------- components: +Windows nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 15:29:25 2021 From: report at bugs.python.org (Christoph Zwerschke) Date: Thu, 29 Apr 2021 19:29:25 +0000 Subject: [issue43979] Simplify urllib.parse_qsl Message-ID: <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org> New submission from Christoph Zwerschke : Just noticed the following code in urrlib.parse_qsl: pairs = [s1 for s1 in qs.split(separator)] for name_value in pairs: ... see https://github.com/python/cpython/blob/088a15c49d99ecb4c3bef93f8f40dd513c6cae3b/Lib/urllib/parse.py#L755 This looks like an unnecessary list comprehension to me, probably a relic of earlier code that used a nested list comprehension for splitting with two different separators. Can't we just do this instead now, which is faster and shorter? for name_value qs.split(separator): I can provide a PR if wanted. ---------- components: Library (Lib) messages: 392345 nosy: cito priority: normal severity: normal status: open title: Simplify urllib.parse_qsl type: performance versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 15:40:18 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 29 Apr 2021 19:40:18 +0000 Subject: [issue37387] test_compileall fails randomly on Windows when tests are run in parallel In-Reply-To: <1561383626.08.0.320504464802.issue37387@roundup.psfhosted.org> Message-ID: <1619725218.12.0.431970345118.issue37387@roundup.psfhosted.org> Shreyan Avigyan added the comment: What is the name of the new function introduced in Windows 10 NT API? Should we use it if the version is detected as Windows 10 (through a callback to a platform function or through GetVersion API)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 15:44:40 2021 From: report at bugs.python.org (Mitchell Hentges) Date: Thu, 29 Apr 2021 19:44:40 +0000 Subject: [issue43969] "bad magic number" when Python 2's pyc file exists without py file In-Reply-To: <1619642212.93.0.461785778702.issue43969@roundup.psfhosted.org> Message-ID: <1619725480.36.0.70356985703.issue43969@roundup.psfhosted.org> Mitchell Hentges added the comment: Looking closer into this, it appears that Python 3 will still try to load non-__pycache__ `.pyc` files. Perhaps I'm missing context, but aren't those only supposed by to written and read by Python 2? Location where `pyc` loader is registered: https://github.com/python/cpython/blob/v3.9.4/Lib/importlib/_bootstrap_external.py#L1571-L1572 Location where `__pycache__` loading happens is part of SourceFileLoader here: https://github.com/python/cpython/blob/v3.9.4/Lib/importlib/_bootstrap_external.py#L870 I'll attach a patch to remove this pyc-loading for convenience, but I don't have enough context to be confident that it's the correct solution. ---------- keywords: +patch message_count: 1.0 -> 2.0 pull_requests: +24422 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25731 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 16:02:55 2021 From: report at bugs.python.org (Jerry Heiselman) Date: Thu, 29 Apr 2021 20:02:55 +0000 Subject: [issue43980] netrc module looks for .netrc even on Windows where the convention is _netrc Message-ID: <1619726575.32.0.12245776965.issue43980@roundup.psfhosted.org> New submission from Jerry Heiselman : The netrc library defaults to looking for the .netrc file in the user's home directory. On Windows, this file is conventionally named _netrc. While one could pass the correct path to the library, the conventionally correct path should be used on all supported platforms. ---------- components: Library (Lib) messages: 392348 nosy: jheiselman priority: normal severity: normal status: open title: netrc module looks for .netrc even on Windows where the convention is _netrc type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 16:10:42 2021 From: report at bugs.python.org (Jerry Heiselman) Date: Thu, 29 Apr 2021 20:10:42 +0000 Subject: [issue43980] netrc module looks for .netrc even on Windows where the convention is _netrc In-Reply-To: <1619726575.32.0.12245776965.issue43980@roundup.psfhosted.org> Message-ID: <1619727042.24.0.18367594147.issue43980@roundup.psfhosted.org> Jerry Heiselman added the comment: Created a simple PR to correct this. ---------- keywords: +patch message_count: 1.0 -> 2.0 pull_requests: +24423 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25732 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 16:23:03 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 29 Apr 2021 20:23:03 +0000 Subject: [issue43976] Introduce mechanism to allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1619727783.71.0.842075323211.issue43976@roundup.psfhosted.org> Steve Dower added the comment: Any reason this couldn't be in sitecustomize.py? Either by poking values into sysconfig directly (for back-compat) or we train sysconfig to look inside sitecustomize for a well-known name. ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 16:48:07 2021 From: report at bugs.python.org (Larry Hastings) Date: Thu, 29 Apr 2021 20:48:07 +0000 Subject: [issue42904] get_type_hints does not provide localns for classes In-Reply-To: <1610427615.24.0.000795612365541.issue42904@roundup.psfhosted.org> Message-ID: <1619729287.93.0.13597528869.issue42904@roundup.psfhosted.org> Larry Hastings added the comment: Thank you for your in-depth and thoughtful reply! I think that APIs should behave in a predictable way. So, for my use case, I tell the user that I'm passing "globals" and "locals" into eval()--and I think I'd have to have a *very* compelling reason to swap them. Since I don't have the backwards-compatibility problem you do, I think I should keep it simple and predictable and not swap them. In reference to your example, I think it's natural enough that the A defined inside B eclipses the module-level A. That's what the user would *expect* to happen. If the user really wants to reference the module-level A, they have lots of options: * rename one or the other A to something else * establish an alias at module scope, and use that * explicitly say globals()['A'] So I'm not worried about it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 16:49:09 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 29 Apr 2021 20:49:09 +0000 Subject: [issue37387] test_compileall fails randomly on Windows when tests are run in parallel In-Reply-To: <1561383626.08.0.320504464802.issue37387@roundup.psfhosted.org> Message-ID: <1619729349.85.0.494542292945.issue37387@roundup.psfhosted.org> Eryk Sun added the comment: > What is the name of the new function introduced in Windows 10 NT API? > Should we use it if the version is detected as Windows 10 (through a > callback to a platform function or through GetVersion API)? No, _bootstrap_external._write_atomic() or py_compile.compile() could implement the typical retry with exponential backoff to address a race condition. Otherwise I don't see what could be done currently in the main code. It would have to be addressed in the test code. Regarding the new support for POSIX semantics, the base NT API isn't organized as a separate function for every operation or query, so it's not a new function name per se. Each kernel object type (e.g. File) has many information classes and a few query/set functions such as NtQueryInformationFile() and NtSetInformationFile(). Windows 10 added file information classes that support the ability to replace/unlink an open file, including FileLinkInformationEx (link), FileRenameInformationEx (relink), and FileDispositionInformationEx (unlink). WinAPI DeleteFileW() and RemoveDirectoryW() were updated to use the latter. I expect that CreateHardlinkW() and MoveFileExW() will be updated as well. It's only POSIX-'ish' semantics because the shared read-write-delete model is deeply ingrained in the NT file API. Opens have to opt in by sharing delete access, and most don't. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 17:29:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 29 Apr 2021 21:29:20 +0000 Subject: [issue43981] test_idle is leaking references Message-ID: <1619731760.39.0.648399014878.issue43981@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : See for example: https://buildbot.python.org/all/#/builders/511/builds/10/steps/4/logs/stdio test_idle leaked [684, 684, 684] references, sum=2052 test_idle leaked [282, 282, 282] memory blocks, sum=846 ---------- assignee: terry.reedy components: IDLE messages: 392353 nosy: pablogsal, terry.reedy priority: release blocker severity: normal status: open title: test_idle is leaking references _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 17:29:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 29 Apr 2021 21:29:30 +0000 Subject: [issue43981] test_idle is leaking references In-Reply-To: <1619731760.39.0.648399014878.issue43981@roundup.psfhosted.org> Message-ID: <1619731770.59.0.538310940272.issue43981@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Marking this as a release blocker ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 17:32:11 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 29 Apr 2021 21:32:11 +0000 Subject: [issue43980] netrc module looks for .netrc even on Windows where the convention is _netrc In-Reply-To: <1619726575.32.0.12245776965.issue43980@roundup.psfhosted.org> Message-ID: <1619731931.11.0.32145025427.issue43980@roundup.psfhosted.org> Steven D'Aprano added the comment: This is a behaviour change not a simple bug fix. 3.6 through 3.9 are all in feature-freeze, and we're days away from the same for 3.10. Not that I don't believe you about the _netrc convention on Windows, but do you have a link to a reliable source documenting that? ---------- nosy: +steven.daprano type: behavior -> enhancement versions: -Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 17:42:22 2021 From: report at bugs.python.org (Jerry Heiselman) Date: Thu, 29 Apr 2021 21:42:22 +0000 Subject: [issue43980] netrc module looks for .netrc even on Windows where the convention is _netrc In-Reply-To: <1619726575.32.0.12245776965.issue43980@roundup.psfhosted.org> Message-ID: <1619732542.74.0.00677323010076.issue43980@roundup.psfhosted.org> Jerry Heiselman added the comment: The netrc file has no formal standard, but the following supports the claim of its conventional naming. Excerpt from https://curl.se/docs/manpage.html#-n: "Makes curl scan the .netrc (_netrc on Windows) file in the user's home directory for login name and password." Excerpt from https://www.labkey.org/Documentation/wiki-page.view?name=netrc: "On a Mac, UNIX, or Linux system the netrc file should be named .netrc (dot netrc) and on Windows it should be named _netrc (underscore netrc)." And a 9+ year old stack overflow post indicating that the use of _netrc on Windows is quite well established and has been for some time. I know it's not authoritative, but it does establish the length of history for this. https://stackoverflow.com/questions/6031214/git-how-to-use-netrc-file-on-windows-to-save-user-and-password ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 17:53:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 21:53:30 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619733210.25.0.838559359412.issue43916@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24424 pull_request: https://github.com/python/cpython/pull/25733 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 18:07:56 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 29 Apr 2021 22:07:56 +0000 Subject: [issue43977] Implement the latest semantics for PEP 634 for matching collections In-Reply-To: <1619714021.85.0.37223153861.issue43977@roundup.psfhosted.org> Message-ID: <1619734076.05.0.416312686541.issue43977@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +24425 pull_request: https://github.com/python/cpython/pull/25734 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 18:50:18 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 29 Apr 2021 22:50:18 +0000 Subject: [issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths In-Reply-To: <1619627176.09.0.686852454721.issue43968@roundup.psfhosted.org> Message-ID: <1619736618.76.0.58056610723.issue43968@roundup.psfhosted.org> Steve Dower added the comment: I think Eryk's point is that the behaviour is correct, and it's unfortunate that certain tools use realpath() when they don't actually mean it (I've been bitten by this too with pytest). Presumably you want to replace realpath with abspath? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 19:02:22 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 29 Apr 2021 23:02:22 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619737342.21.0.132594060363.issue43892@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +24426 pull_request: https://github.com/python/cpython/pull/25735 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 19:10:59 2021 From: report at bugs.python.org (Andrew Duncan) Date: Thu, 29 Apr 2021 23:10:59 +0000 Subject: [issue40379] multiprocessing's default start method of fork()-without-exec() is broken In-Reply-To: <1587752543.41.0.119768714545.issue40379@roundup.psfhosted.org> Message-ID: <1619737859.33.0.585785710007.issue40379@roundup.psfhosted.org> Andrew Duncan added the comment: I just ran into and fixed (thanks to itamarst's blog post) a problem likely related to this. Multiprocessing workers performing work and sending a logging message back with success/fail info. I had a few intermittent deadlocks that became a recurring problem when I sped up the process that skipped tasks which had previously completed (I think this shortened the time between forking and attempting to send messages causing the third process to deadlock). After changing that it deadlocked *every time*. Switching to "spawn" at the top of the main function has fixed it. ---------- nosy: +aduncan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 19:16:04 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 29 Apr 2021 23:16:04 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1619738164.1.0.410881764762.issue42800@roundup.psfhosted.org> Steve Dower added the comment: New changeset 9a2c2a9ec3140b6c54c9ef9d994311f114128ee3 by Ryan Hileman in branch 'master': bpo-42800: add audit hooks for f_code and tb_frame (GH-24182) https://github.com/python/cpython/commit/9a2c2a9ec3140b6c54c9ef9d994311f114128ee3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 19:26:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 23:26:58 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1619738818.25.0.286091634358.issue42800@roundup.psfhosted.org> STINNER Victor added the comment: Can you please rename AUDIT_READ to PY_AUDIT_READ? We should avoid adding symbols without Py/PY prefix to the Python C API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 19:34:34 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 29 Apr 2021 23:34:34 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1619739274.87.0.130473429126.issue42800@roundup.psfhosted.org> Steve Dower added the comment: Sure, I can do that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 19:36:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 29 Apr 2021 23:36:48 +0000 Subject: [issue43982] Code coverage on the CI: validate codecov shell script checksum Message-ID: <1619739408.19.0.291224882585.issue43982@roundup.psfhosted.org> New submission from STINNER Victor : Currently, GitHub Action and Travis CI run a codecov bash downloaded from https://codecov.io/bash without validating it. The script was recently compromised: https://about.codecov.io/security-update/ We should validate the shell script integrity by checking its checksum. Example from the documentation: ------------- curl -s https://codecov.io/bash > codecov; VERSION=$(grep -o 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2); for i in 1 256 512 do shasum -a $i -c --ignore-missing <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM") || shasum -a $i -c <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM") done ------------- See: https://docs.codecov.io/docs/about-the-codecov-bash-uploader ---------- components: Tests messages: 392362 nosy: vstinner priority: normal severity: normal status: open title: Code coverage on the CI: validate codecov shell script checksum versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 19:42:57 2021 From: report at bugs.python.org (Ammar Askar) Date: Thu, 29 Apr 2021 23:42:57 +0000 Subject: [issue43982] Code coverage on the CI: validate codecov shell script checksum In-Reply-To: <1619739408.19.0.291224882585.issue43982@roundup.psfhosted.org> Message-ID: <1619739777.53.0.0469903365945.issue43982@roundup.psfhosted.org> Ammar Askar added the comment: See also https://github.com/python/cpython/pull/25679 where we're proposing just removing the coverage build altogether. ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 19:43:49 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 29 Apr 2021 23:43:49 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1619739829.89.0.707050544524.issue42800@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +24427 pull_request: https://github.com/python/cpython/pull/25736 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 19:48:45 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 29 Apr 2021 23:48:45 +0000 Subject: [issue42904] get_type_hints does not provide localns for classes In-Reply-To: <1619729287.93.0.13597528869.issue42904@roundup.psfhosted.org> Message-ID: Ken Jin added the comment: Hmm I think you're right - the normal behavior in Python is for local variables to shadow global variables, and as a user I expect the same for eval in inspect.get_annotation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 20:09:03 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 30 Apr 2021 00:09:03 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1619741343.5.0.298698836788.issue42800@roundup.psfhosted.org> Steve Dower added the comment: New changeset 87655e2cf58c543914ea05ebe5a0377441da1ef2 by Steve Dower in branch 'master': bpo-42800: Rename AUDIT_READ to PY_AUDIT_READ (GH-25736) https://github.com/python/cpython/commit/87655e2cf58c543914ea05ebe5a0377441da1ef2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 20:10:44 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 30 Apr 2021 00:10:44 +0000 Subject: [issue43982] Code coverage on the CI: validate codecov shell script checksum In-Reply-To: <1619739408.19.0.291224882585.issue43982@roundup.psfhosted.org> Message-ID: <1619741444.13.0.30751183691.issue43982@roundup.psfhosted.org> Ned Deily added the comment: I agree that we should just remove the code coverage runs rather than trying to improve their security. It seems to me to be rude of us to use so much of the open source build resources for an activity that appears to have little benefit. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 20:12:35 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 30 Apr 2021 00:12:35 +0000 Subject: [issue43976] Introduce mechanism to allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1619741555.67.0.787748218607.issue43976@roundup.psfhosted.org> Filipe La?ns added the comment: Making sysconfig look at sitecustomize seems like the wrong approach. It is behavior I would never expect, and there are use-cases where I still want the schemes to be present when the site module initialization is disabled. I would also argue that having this mechanism available will be useful for other things. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 20:19:37 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 30 Apr 2021 00:19:37 +0000 Subject: [issue43892] Make match patterns explicit in the AST In-Reply-To: <1618919994.66.0.123509458794.issue43892@roundup.psfhosted.org> Message-ID: <1619741977.16.0.472622461152.issue43892@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset dbe60ee09dc5a624cfb78dff61ecf050a5b3f105 by Brandt Bucher in branch 'master': bpo-43892: Validate the first term of complex literal value patterns (GH-25735) https://github.com/python/cpython/commit/dbe60ee09dc5a624cfb78dff61ecf050a5b3f105 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 20:23:55 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 30 Apr 2021 00:23:55 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1619742235.25.0.010486249978.issue42800@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +24428 pull_request: https://github.com/python/cpython/pull/25737 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 20:25:46 2021 From: report at bugs.python.org (robertohueso) Date: Fri, 30 Apr 2021 00:25:46 +0000 Subject: [issue43979] Simplify urllib.parse_qsl In-Reply-To: <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org> Message-ID: <1619742346.48.0.521671716768.issue43979@roundup.psfhosted.org> robertohueso added the comment: Seems like a nice simplification to me. Can I open PR? :) ---------- nosy: +robertohueso _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 20:27:57 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 30 Apr 2021 00:27:57 +0000 Subject: [issue42800] Traceback objects allow accessing frame objects without triggering audit hooks In-Reply-To: <1609460218.67.0.01717828776.issue42800@roundup.psfhosted.org> Message-ID: <1619742477.29.0.88644895031.issue42800@roundup.psfhosted.org> Steve Dower added the comment: The 3.9 backport is a bit different from what's in master, so would appreciate someone double-check it. It should go back to 3.8 just fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 20:46:33 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 30 Apr 2021 00:46:33 +0000 Subject: [issue36077] Inheritance dataclasses fields and default init statement In-Reply-To: <1550838433.8.0.658564691536.issue36077@roundup.psfhosted.org> Message-ID: <1619743593.48.0.780207141575.issue36077@roundup.psfhosted.org> Eric V. Smith added the comment: I'm going to close this in favor of the kw_only work done in issue 43532. I realize they're not quite the same thing, but we'll see how it works out in Python 3.10, and possibly make adjustments when we have some real world experience. ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 22:53:13 2021 From: report at bugs.python.org (Ma Lin) Date: Fri, 30 Apr 2021 02:53:13 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1619751193.7.0.875181849583.issue41486@roundup.psfhosted.org> Change by Ma Lin : ---------- pull_requests: +24429 pull_request: https://github.com/python/cpython/pull/25738 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 22:55:42 2021 From: report at bugs.python.org (Ma Lin) Date: Fri, 30 Apr 2021 02:55:42 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1619751342.81.0.963259131164.issue41486@roundup.psfhosted.org> Ma Lin added the comment: Found a backward incompatible behavior. Before the patch, in 64-bit build, zlib module allows the initial size > UINT32_MAX. It creates a bytes object, and uses a sliding window to deal with the UINT32_MAX limit: https://github.com/python/cpython/blob/v3.9.4/Modules/zlibmodule.c#L183 After the patch, when init_size > UINT32_MAX, it raises a ValueError. PR 25738 fixes this backward incompatibility. If the initial size > UINT32_MAX, it clamps to UINT32_MAX, rather than raising an exception. Moreover, if you don't mind, I would like to take this opportunity to rename the wrapper functions from Buffer_* to OutputBuffer_*, so that the readers can easily distinguish between input buffer and output buffer. If you don't think it's necessary, you may merge PR 25738 as is. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 23:09:14 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 30 Apr 2021 03:09:14 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619752154.68.0.755473259395.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: New changeset 2f2b69855d6524e15d12c15ddc0adce629e7de84 by larryhastings in branch 'master': bpo-43901: Lazy-create an empty annotations dict in all unannotated user classes and modules (#25623) https://github.com/python/cpython/commit/2f2b69855d6524e15d12c15ddc0adce629e7de84 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 23:10:40 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 30 Apr 2021 03:10:40 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619752240.92.0.536011132922.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: Thanks for your feedback and reviews, everybody! Python just got an eensy teensy tiny bit better. ---------- assignee: -> larry resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 23:14:44 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 30 Apr 2021 03:14:44 +0000 Subject: [issue43951] Two minor fixes for C module object In-Reply-To: <1619521579.23.0.324189494651.issue43951@roundup.psfhosted.org> Message-ID: <1619752484.58.0.458354360018.issue43951@roundup.psfhosted.org> Larry Hastings added the comment: Thanks for the review, Victor! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 23:24:44 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 03:24:44 +0000 Subject: [issue43981] test_idle is leaking references In-Reply-To: <1619731760.39.0.648399014878.issue43981@roundup.psfhosted.org> Message-ID: <1619753084.46.0.663802392468.issue43981@roundup.psfhosted.org> Terry J. Reedy added the comment: The only recently added tests are the 11 in test_sidebar.ShellSidebarTest. Leak testing just these with python -m test -R3:3 -ugui -m *Sidebar* test_idle does not fail. Leak test all of test_idle with >python -m test -R3:3 -v -ugui test_idle ends after the second round with two error failures. FAIL: test_menudefs (idlelib.idle_test.test_mainmenu.MainMenuTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "f:\dev\3x\lib\idlelib\idle_test\test_mainmenu.py", line 15, in test_menudefs self.assertEqual(actual, expect) AssertionError: Lists differ: ['application', 'file', 'edit', 'format', '[47 chars]elp'] != ['file', 'edit', 'format', 'run', 'shell', [32 chars]elp'] The 'application' menu was by added by a call to macosx.setupApp, which calls overrideRootMenu, in ShellSidebarTest.setUpClass. This call is not needed for this testcase, so the first PR replaces it with a comment referring to this issue. Note: when test_macosc calls setupApp, overrideRootMenu is replaced with a mock. The second execution of ShellSidebarTest.setUpClass failed with ERROR: setUpClass (idlelib.idle_test.test_sidebar.ShellSidebarTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "f:\dev\3x\lib\idlelib\idle_test\test_sidebar.py", line 414, in setUpClass cls.init_shell() File "f:\dev\3x\lib\idlelib\idle_test\test_sidebar.py", line 429, in init_shell cls.shell = cls.flist.open_shell() File "f:\dev\3x\lib\idlelib\pyshell.py", line 334, in open_shell self.pyshell = PyShell(self) File "f:\dev\3x\lib\idlelib\pyshell.py", line 890, in __init__ OutputWindow.__init__(self, flist, None, None) File "f:\dev\3x\lib\idlelib\outwin.py", line 79, in __init__ EditorWindow.__init__(self, *args) File "f:\dev\3x\lib\idlelib\editor.py", line 342, in __init__ self.update_menu_state('options', '*ode*ontext', 'disabled') File "f:\dev\3x\lib\idlelib\editor.py", line 488, in update_menu_state menuitem.entryconfig(index, state=state) File "f:\dev\3x\lib\tkinter\__init__.py", line 3383, in entryconfigure return self._configure(('entryconfigure', index), cnf, kw) File "f:\dev\3x\lib\tkinter\__init__.py", line 1660, in _configure self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) _tkinter.TclError: bad menu entry index "*ode*ontext" One of the things that overrideRootMenu does is to move the option setting item, above the code context item, to the application submenu. I don't understand why this caused the failure above. However, removing the setupApp call fixed this failure also. The first PR does this. With this fix, test_idle runs 6 times with leak report test_idle leaked [684, 684, 684] references, sum=2052 test_idle leaked [282, 282, 282] memory blocks, sum=846 With ShellSidebarTest skipped, the result is only slightly better. test_idle leaked [684, 684, 665] references, sum=2033 test_idle leaked [282, 282, 283] memory blocks, sum=847 ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 23:28:04 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 03:28:04 +0000 Subject: [issue43981] test_idle is leaking references In-Reply-To: <1619731760.39.0.648399014878.issue43981@roundup.psfhosted.org> Message-ID: <1619753284.41.0.445650047612.issue43981@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +24430 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25739 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 23:52:55 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 03:52:55 +0000 Subject: [issue43981] test_idle is leaking references In-Reply-To: <1619731760.39.0.648399014878.issue43981@roundup.psfhosted.org> Message-ID: <1619754775.68.0.815395841909.issue43981@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset a62e424de0c394cda178a8d934d06f0559b5e28d by Terry Jan Reedy in branch 'master': bpo-43981: Fix error in idle-test leak test (GH-25739) https://github.com/python/cpython/commit/a62e424de0c394cda178a8d934d06f0559b5e28d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 23:56:37 2021 From: report at bugs.python.org (Marwan Essam) Date: Fri, 30 Apr 2021 03:56:37 +0000 Subject: [issue43983] Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit Message-ID: <1619754997.92.0.813433762257.issue43983@roundup.psfhosted.org> New submission from Marwan Essam : Hello, While I was trying to install Python version 3.9.4 on Windows 10 64bit, Error 0x80070643 - Fatal error during installation is showing, with a message saying " install the process cannot access the file because another process has locked a portion of the file", Note: There was an older version of Python installed on my laptop in 2018, but a while ago i did a system format, but some of the .XMl and .py files still there ( i don't know if that's the case) Core_AllUsers (https://pastebin.com/iAZGTrkx) ---------- components: Installation files: Python 3.9.4 (64-bit)_20210430053233.log messages: 392378 nosy: Marwan, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit type: crash versions: Python 3.9 Added file: https://bugs.python.org/file50000/Python 3.9.4 (64-bit)_20210430053233.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 29 23:57:11 2021 From: report at bugs.python.org (Marwan Essam) Date: Fri, 30 Apr 2021 03:57:11 +0000 Subject: [issue43983] Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit In-Reply-To: <1619754997.92.0.813433762257.issue43983@roundup.psfhosted.org> Message-ID: <1619755031.96.0.185365671087.issue43983@roundup.psfhosted.org> Change by Marwan Essam : ---------- nosy: -Marwan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 00:15:47 2021 From: report at bugs.python.org (Rahul Kumaresan) Date: Fri, 30 Apr 2021 04:15:47 +0000 Subject: [issue43978] Incorrect "versionadded" info in typing.NoReturn documentation In-Reply-To: <1619720166.99.0.648507362303.issue43978@roundup.psfhosted.org> Message-ID: <1619756147.75.0.657964579841.issue43978@roundup.psfhosted.org> Change by Rahul Kumaresan : ---------- nosy: +rahul-kumi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 00:16:35 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 30 Apr 2021 04:16:35 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619756195.93.0.33203752915.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: New changeset 74613a46fc79cacc88d3eae4105b12691cd4ba20 by larryhastings in branch 'master': bpo-43817: Add inspect.get_annotations(). (#25522) https://github.com/python/cpython/commit/74613a46fc79cacc88d3eae4105b12691cd4ba20 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 00:17:28 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 30 Apr 2021 04:17:28 +0000 Subject: [issue43817] Add inspect.get_annotations() In-Reply-To: <1618249184.39.0.525270769302.issue43817@roundup.psfhosted.org> Message-ID: <1619756248.36.0.950943937689.issue43817@roundup.psfhosted.org> Larry Hastings added the comment: Thanks for your feedback, everybody! It's now checked in. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 00:28:19 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 04:28:19 +0000 Subject: [issue43981] test_idle is leaking references In-Reply-To: <1619731760.39.0.648399014878.issue43981@roundup.psfhosted.org> Message-ID: <1619756899.74.0.103498919851.issue43981@roundup.psfhosted.org> Terry J. Reedy added the comment: test_squeezer.ExpandingButtonTest accounts for most of the leak. python -m test -R3:3 -v -ugui -m *zer.Expand* test_idle test_idle leaked [576, 576, 576] references, sum=1728 test_idle leaked [282, 282, 282] memory blocks, sum=846 All 6 methods failed. I believe the difference [108, 108, 108] [0, 0, 0] would not be a failure. Yesterday's patch, https://github.com/python/cpython/pull/22682/files, only made what seems like a trivial change in 2 of the 6 methods. Only a name was changed in squeeze.py. Tal, any idea why these are leaking? ---------- nosy: +taleinat stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 01:27:57 2021 From: report at bugs.python.org (mdcb) Date: Fri, 30 Apr 2021 05:27:57 +0000 Subject: [issue15443] datetime module has no support for nanoseconds In-Reply-To: <1343158610.62.0.806232279741.issue15443@psf.upfronthosting.co.za> Message-ID: <1619760477.11.0.772998096028.issue15443@roundup.psfhosted.org> mdcb added the comment: In the confines of PTP / IEEE1588, it's actually quite common and can be useful. It's not so much the ns, but the <1us that is missing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 01:59:05 2021 From: report at bugs.python.org (=?utf-8?q?Lum=C3=ADr_Balhar?=) Date: Fri, 30 Apr 2021 05:59:05 +0000 Subject: [issue43976] Introduce mechanism to allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1619762345.15.0.603058717488.issue43976@roundup.psfhosted.org> Change by Lum?r Balhar : ---------- nosy: +frenzy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 01:59:27 2021 From: report at bugs.python.org (Rahul Kumaresan) Date: Fri, 30 Apr 2021 05:59:27 +0000 Subject: [issue43978] Incorrect "versionadded" info in typing.NoReturn documentation In-Reply-To: <1619720166.99.0.648507362303.issue43978@roundup.psfhosted.org> Message-ID: <1619762367.05.0.118141161421.issue43978@roundup.psfhosted.org> Rahul Kumaresan added the comment: Although the documentation for 'typing.NoReturn' is made in: https://github.com/python/cpython/pull/7107/files The actual inclusion of the 'typing.NoReturn' was made through the following this PR: https://github.com/python/typing/pull/397 Also the change is registered in the changelog under Python 3.6.2 rc1 release as: ''' bpo-28556: Various updates to typing module: add typing.NoReturn type, use WrapperDescriptorType, minor bug-fixes. Original PRs by Jim Fasarakis-Hilliard and Ivan Levkivskyi. ''' So shouldn't the correct version here should be 3.6.2? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 02:07:07 2021 From: report at bugs.python.org (Rahul Kumaresan) Date: Fri, 30 Apr 2021 06:07:07 +0000 Subject: [issue24247] Docs: "unittest discover" modifies sys.path In-Reply-To: <1432145504.49.0.0792649435806.issue24247@psf.upfronthosting.co.za> Message-ID: <1619762827.02.0.910923464187.issue24247@roundup.psfhosted.org> Change by Rahul Kumaresan : ---------- nosy: +rahul-kumi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 02:16:52 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 30 Apr 2021 06:16:52 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1619751342.81.0.963259131164.issue41486@roundup.psfhosted.org> Message-ID: Gregory P. Smith added the comment: Renaming to OutputBuffer sounds like a good idea. On Thu, Apr 29, 2021, 7:55 PM Ma Lin wrote: > > Ma Lin added the comment: > > Found a backward incompatible behavior. > > Before the patch, in 64-bit build, zlib module allows the initial size > > UINT32_MAX. > It creates a bytes object, and uses a sliding window to deal with the > UINT32_MAX limit: > https://github.com/python/cpython/blob/v3.9.4/Modules/zlibmodule.c#L183 > > After the patch, when init_size > UINT32_MAX, it raises a ValueError. > > PR 25738 fixes this backward incompatibility. > If the initial size > UINT32_MAX, it clamps to UINT32_MAX, rather than > raising an exception. > > Moreover, if you don't mind, I would like to take this opportunity to > rename the wrapper functions from Buffer_* to OutputBuffer_*, so that the > readers can easily distinguish between input buffer and output buffer. > If you don't think it's necessary, you may merge PR 25738 as is. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 02:19:59 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 30 Apr 2021 06:19:59 +0000 Subject: [issue37387] test_compileall fails randomly on Windows when tests are run in parallel In-Reply-To: <1561383626.08.0.320504464802.issue37387@roundup.psfhosted.org> Message-ID: <1619763599.13.0.435477833499.issue37387@roundup.psfhosted.org> Shreyan Avigyan added the comment: Though I've never been able to reproduce this test failure. Maybe it's fixed (maybe it was a side effect of another test)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 03:32:43 2021 From: report at bugs.python.org (Julien Palard) Date: Fri, 30 Apr 2021 07:32:43 +0000 Subject: [issue43954] Possible missing word on unittest doc In-Reply-To: <1619526068.5.0.0964164100817.issue43954@roundup.psfhosted.org> Message-ID: <1619767963.9.0.646565771536.issue43954@roundup.psfhosted.org> Julien Palard added the comment: New changeset 2abbd8f2add5e80b86a965625b9a77ae94a101cd by Zackery Spytz in branch 'master': bpo-43954: Fix a missing word in the unittest docs (GH-25672) https://github.com/python/cpython/commit/2abbd8f2add5e80b86a965625b9a77ae94a101cd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 03:35:08 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Apr 2021 07:35:08 +0000 Subject: [issue43954] Possible missing word on unittest doc In-Reply-To: <1619526068.5.0.0964164100817.issue43954@roundup.psfhosted.org> Message-ID: <1619768108.35.0.896406463834.issue43954@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +24431 pull_request: https://github.com/python/cpython/pull/25741 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 03:36:15 2021 From: report at bugs.python.org (Julien Palard) Date: Fri, 30 Apr 2021 07:36:15 +0000 Subject: [issue43954] Possible missing word on unittest doc In-Reply-To: <1619526068.5.0.0964164100817.issue43954@roundup.psfhosted.org> Message-ID: <1619768175.93.0.39916021629.issue43954@roundup.psfhosted.org> Julien Palard added the comment: As far as this issue is concerned, it's fixed. The discussion about this feature not working can continue in the appropriate issue (23882) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 03:57:04 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Apr 2021 07:57:04 +0000 Subject: [issue43954] Possible missing word on unittest doc In-Reply-To: <1619526068.5.0.0964164100817.issue43954@roundup.psfhosted.org> Message-ID: <1619769423.99.0.909612494362.issue43954@roundup.psfhosted.org> miss-islington added the comment: New changeset a92d7387632de1fc64de51f22f6191acd0c6f5c0 by Miss Islington (bot) in branch '3.9': bpo-43954: Fix a missing word in the unittest docs (GH-25672) https://github.com/python/cpython/commit/a92d7387632de1fc64de51f22f6191acd0c6f5c0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 03:59:25 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 30 Apr 2021 07:59:25 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619769565.36.0.311510425841.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: Py_TPFLAGS_IMMUTABLETYPE has been applied to array.array by Erlend in https://github.com/python/cpython/pull/25696. Should Py_TPFLAGS_IMMUTABLETYPE be applied to other heap types also (the ones that were converted from static types)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 04:08:30 2021 From: report at bugs.python.org (Roundup Robot) Date: Fri, 30 Apr 2021 08:08:30 +0000 Subject: [issue41277] documentation: os.setxattr() errno EEXIST and ENODATA In-Reply-To: <1594446359.56.0.57719330174.issue41277@roundup.psfhosted.org> Message-ID: <1619770110.24.0.319766599533.issue41277@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 3.0 -> 4.0 pull_requests: +24432 pull_request: https://github.com/python/cpython/pull/25742 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 04:20:04 2021 From: report at bugs.python.org (sfmc) Date: Fri, 30 Apr 2021 08:20:04 +0000 Subject: [issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths In-Reply-To: <1619627176.09.0.686852454721.issue43968@roundup.psfhosted.org> Message-ID: <1619770804.45.0.914163296524.issue43968@roundup.psfhosted.org> sfmc added the comment: I see the point: the real path may not be accessible from the substitute drive: - if symlink (or junction) is used, pointing to path not visible from the substitute drive. - if different security context is used (e.g. different user or UAC). But that is the discussion about the _correct_ behavior (which may have differing opinions if the exact behavior is not documented). ----- Let's discuss how we can fix the issue caused by the behavior change. I propose a simple fix: keep old behavior if a special environment variable is specified. E.g. if you specify env. var. PYTHON_NTREALPATH_OLD_BEHAVIOR=1, it doesn't resolve symlinks and junctions. Is this acceptable for Python 3.8.10? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 04:24:26 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 30 Apr 2021 08:24:26 +0000 Subject: [issue43976] Introduce mechanism to allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1619771066.95.0.346155880146.issue43976@roundup.psfhosted.org> Miro Hron?ok added the comment: Cross referencing the discussion: https://discuss.python.org/t/mechanism-for-distributors-to-add-site-install-schemes-to-python-installations/8467 ---------- nosy: +hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 04:42:01 2021 From: report at bugs.python.org (r3pwnx) Date: Fri, 30 Apr 2021 08:42:01 +0000 Subject: [issue43984] [security]winreg.SetValueEx shoule check the returned value Message-ID: <1619772121.59.0.631498595724.issue43984@roundup.psfhosted.org> New submission from r3pwnx : The library winreg[1] can be used to access registry on windows. >reg.SetValueEx(key, 'X', 0, reg.REG_DWORD, -1337) `SetValueEx` could store data in the value field of an open registry key, In the source file of "PC/winreg.c", `Py2Reg`is called first ``` static PyObject * winreg_SetValueEx_impl(PyObject *module, HKEY key, const Py_UNICODE *value_name, PyObject *reserved, DWORD type, PyObject *value) /*[clinic end generated code: output=811b769a66ae11b7 input=900a9e3990bfb196]*/ { BYTE *data; DWORD len; LONG rc; if (!Py2Reg(value, type, &data, &len)) ... ``` `Py2Reg` is implemented in the same file: ``` Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize) { Py_ssize_t i,j; switch (typ) { case REG_DWORD: if (value != Py_None && !PyLong_Check(value)) return FALSE; *retDataBuf = (BYTE *)PyMem_NEW(DWORD, 1); if (*retDataBuf == NULL){ PyErr_NoMemory(); return FALSE; } *retDataSize = sizeof(DWORD); if (value == Py_None) { DWORD zero = 0; memcpy(*retDataBuf, &zero, sizeof(DWORD)); } else { DWORD d = PyLong_AsUnsignedLong(value); memcpy(*retDataBuf, &d, sizeof(DWORD)); } break; ``` When the type is set with reg.REG_DWORD, `PyLong_AsUnsignedLong(value)` will change the value's type, and then memcpy the returned value directly, without any check. In the Objects/longobject.c, as the comment said: /* Get a C unsigned long int from an int object. Returns -1 and sets an error condition if overflow occurs. */ If PyLong_AsUnsignedLong return -1, the -1 will be stored in the registry though the error occured PoC: import winreg as reg key = reg.CreateKey(reg.HKEY_CURRENT_USER, 'SOFTWARE\\Classes\\r3pwn') try: print("Set Subkey X: -1337") reg.SetValueEx(key, 'X', 0, reg.REG_DWORD, -1337) except Exception as e: print("Get Subkey: ", reg.QueryValueEx(key, "X")[0]) try: print("Set Subkey Y: 2**33") reg.SetValueEx(key, 'Y', 0, reg.REG_DWORD, 2**33) except Exception as e: print("Get Subkey: ", reg.QueryValueEx(key, "Y")[0]) The Test Environment OS: Windows Python Version: 3.9.0 python winreg_bug.py Set Subkey X: -1337 Get Subkey: 4294967295 Set Subkey Y: 2**33 Get Subkey: 4294967295 the return value should be checked: DWORD d = PyLong_AsUnsignedLong(value); + if (d == (unsigned long)-1 && PyErr_Occurred()) + return False; memcpy(*retDataBuf, &d, sizeof(DWORD)); [1] https://docs.python.org/3.9/library/winreg.html#winreg.SetValueEx ---------- components: Library (Lib) files: winreg_bug.py messages: 392392 nosy: r3pwnx priority: normal severity: normal status: open title: [security]winreg.SetValueEx shoule check the returned value type: security versions: Python 3.9 Added file: https://bugs.python.org/file50001/winreg_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 04:47:28 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 08:47:28 +0000 Subject: [issue43434] sqlite3.Connection(...) bypasses 'sqlite3.connect' audit hooks In-Reply-To: <1615208039.92.0.863639207352.issue43434@roundup.psfhosted.org> Message-ID: <1619772448.18.0.613410182326.issue43434@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Steve, is it worth it to improve this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 04:50:36 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 30 Apr 2021 08:50:36 +0000 Subject: [issue43977] Implement the latest semantics for PEP 634 for matching collections In-Reply-To: <1619714021.85.0.37223153861.issue43977@roundup.psfhosted.org> Message-ID: <1619772636.57.0.572186877913.issue43977@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 069e81ab3da46c441335ca762c4333b7bd91861d by Mark Shannon in branch 'master': bpo-43977: Use tp_flags for collection matching (GH-25723) https://github.com/python/cpython/commit/069e81ab3da46c441335ca762c4333b7bd91861d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 04:55:17 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 08:55:17 +0000 Subject: [issue43851] Optimise SQLite builds on macOS and Windows In-Reply-To: <1618442168.97.0.98960637018.issue43851@roundup.psfhosted.org> Message-ID: <1619772917.1.0.662801078251.issue43851@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: If Berker does not disapprove, I'd like to apply GH-25413 and GH-25414 to the installers, Steve & Ned. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 05:13:19 2021 From: report at bugs.python.org (MisterY) Date: Fri, 30 Apr 2021 09:13:19 +0000 Subject: [issue43985] lib2to3 fails on a slash('/') after positional_only paramter in a function signature Message-ID: <1619773999.71.0.976302612152.issue43985@roundup.psfhosted.org> New submission from MisterY : When I try to format a code snippet with yapf, there comes a error. It seems lib2to3 can't reconised SLASH. echo "def foo(posonly1, posonly2, /, positional_or_keyword): pass" | yapf Traceback (most recent call last): File "d:\program files\python38\lib\site-packages\yapf\yapflib\pytree_utils.py", line 115, in ParseCodeToTree tree = parser_driver.parse_string(code, debug=False) File "d:\program files\python38\lib\lib2to3\pgen2\driver.py", line 103, in parse_string return self.parse_tokens(tokens, debug) File "d:\program files\python38\lib\lib2to3\pgen2\driver.py", line 71, in parse_tokens if p.addtoken(type, value, (prefix, start)): File "d:\program files\python38\lib\lib2to3\pgen2\parse.py", line 162, in addtoken raise ParseError("bad input", type, value, context) lib2to3.pgen2.parse.ParseError: bad input: type=17, value='/', context=(' ', (1, 28)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "d:\program files\python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "d:\program files\python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "D:\Program Files\Python38\Scripts\yapf.exe\__main__.py", line 7, in File "d:\program files\python38\lib\site-packages\yapf\__init__.py", line 362, in run_main sys.exit(main(sys.argv)) File "d:\program files\python38\lib\site-packages\yapf\__init__.py", line 104, in main reformatted_source, _ = yapf_api.FormatCode( File "d:\program files\python38\lib\site-packages\yapf\yapflib\yapf_api.py", line 147, in FormatCode tree = pytree_utils.ParseCodeToTree(unformatted_source) File "d:\program files\python38\lib\site-packages\yapf\yapflib\pytree_utils.py", line 121, in ParseCodeToTree tree = parser_driver.parse_string(code, debug=False) File "d:\program files\python38\lib\lib2to3\pgen2\driver.py", line 103, in parse_string return self.parse_tokens(tokens, debug) File "d:\program files\python38\lib\lib2to3\pgen2\driver.py", line 71, in parse_tokens if p.addtoken(type, value, (prefix, start)): File "d:\program files\python38\lib\lib2to3\pgen2\parse.py", line 162, in addtoken raise ParseError("bad input", type, value, context) lib2to3.pgen2.parse.ParseError: bad input: type=17, value='/', context=(' ', (1, 28)) ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 392396 nosy: cloud-yu priority: normal severity: normal status: open title: lib2to3 fails on a slash('/') after positional_only paramter in a function signature type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 05:18:55 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 30 Apr 2021 09:18:55 +0000 Subject: [issue43985] lib2to3 fails on a slash('/') after positional_only paramter in a function signature In-Reply-To: <1619773999.71.0.976302612152.issue43985@roundup.psfhosted.org> Message-ID: <1619774335.3.0.0558740739352.issue43985@roundup.psfhosted.org> Christian Heimes added the comment: The slash syntax was introduced in 3.8. I guess the grammar of lib2to3 was not updated to support new syntax elements. ?ukasz, could you please take a look? ---------- nosy: +christian.heimes, lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 05:33:41 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 30 Apr 2021 09:33:41 +0000 Subject: [issue43985] lib2to3 fails on a slash('/') after positional_only paramter in a function signature In-Reply-To: <1619773999.71.0.976302612152.issue43985@roundup.psfhosted.org> Message-ID: <1619775221.65.0.747893911852.issue43985@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: https://bugs.python.org/issue36541 add support for walrus operator and positional arguments. Relevant commit : https://github.com/python/cpython/commit/06bfd033e847bedb6e123d131dcf46393a4555df Relevant yapf issue on python 3.8 support : https://github.com/google/yapf/issues/772 Can you please add the exact python version you are using? ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 05:36:14 2021 From: report at bugs.python.org (MisterY) Date: Fri, 30 Apr 2021 09:36:14 +0000 Subject: [issue43985] lib2to3 fails on a slash('/') after positional_only paramter in a function signature In-Reply-To: <1619773999.71.0.976302612152.issue43985@roundup.psfhosted.org> Message-ID: <1619775374.0.0.941746309315.issue43985@roundup.psfhosted.org> MisterY added the comment: python 3.8.3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 05:40:12 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 30 Apr 2021 09:40:12 +0000 Subject: [issue43985] lib2to3 fails on a slash('/') after positional_only paramter in a function signature In-Reply-To: <1619773999.71.0.976302612152.issue43985@roundup.psfhosted.org> Message-ID: <1619775612.33.0.798895881396.issue43985@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Thanks, the change was merged in December 14, 2020 just missing 3.8.7 . Can you please upgrade to 3.8.8 or 3.8.9 and try? If the issue still persists I guess it's then an issue with yapf since Python 3.8.8 has the code merged with tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 05:53:44 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 09:53:44 +0000 Subject: [issue43951] Two minor fixes for C module object In-Reply-To: <1619521579.23.0.324189494651.issue43951@roundup.psfhosted.org> Message-ID: <1619776424.31.0.884969900647.issue43951@roundup.psfhosted.org> STINNER Victor added the comment: commit 175a54b2d8f967605f1d46b5cadccdcf2b54842f Author: larryhastings Date: Thu Apr 29 20:13:25 2021 -0700 Two minor fixes for accessing a module's name. (#25658) While working on another issue, I noticed two minor nits in the C implementation of the module object. Both are related to getting a module's name. First, the C function module_dir() (module.__dir__) starts by ensuring the module dict is valid. If the module dict is invalid, it wants to format an exception using the name of the module, which it gets from PyModule_GetName(). However, PyModule_GetName() gets the name of the module from the dict. So getting the name in this circumstance will never succeed. When module_dir() wants to format the error but can't get the name, it knows that PyModule_GetName() must have already raised an exception. So it leaves that exception alone and returns an error. The end result is that the exception raised here is kind of useless and misleading: dir(module) on a module with no __dict__ raises SystemError("nameless module"). I changed the code to actually raise the exception it wanted to raise, just without a real module name: TypeError(".__dict__ is not a dictionary"). This seems more useful, and would do a better job putting the programmer who encountered this on the right track of figuring out what was going on. Second, the C API function PyModule_GetNameObject() checks to see if the module has a dict. If m->md_dict is not NULL, it calls _PyDict_GetItemIdWithError(). However, it's possible for m->md_dict to be None. And if you call _PyDict_GetItemIdWithError(Py_None, ...) it will *crash*. Unfortunately, this crash was due to my own bug in the other branch. Fixing my code made the crash go away. I assert that this is still possible at the API level. The fix is easy: add a PyDict_Check() to PyModule_GetNameObject(). Unfortunately, I don't know how to add a unit test for this. Having changed module_dir() above, I can't find any other interfaces callable from Python that eventually call PyModule_GetNameObject(). So I don't know how to trick the runtime into reproducing this error. Since both these changes are minor--each entails only a small edit to only one line--I didn't bother with a news item. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:01:21 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 10:01:21 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619776881.88.0.696219107591.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Victor: > check_set_special_type_attr() is used to prevent setting the following attributes: > [...] > Right now, I cannot set the attribues on array.array type: > [...] > I guess that type_setattro() is used and it checks for Py_TPFLAGS_IMMUTABLETYPE flag early. Is this always the case? If so, can we turn the check in check_set_special_type_attr() into an assert? In any case, Py_TPFLAGS_IMMUTABLETYPE should be used, not !Py_TPFLAGS_HEAPTYPE. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:04:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 10:04:57 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619777097.34.0.872271375505.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: > Is this always the case? If so, can we turn the check in check_set_special_type_attr() into an assert? In any case, Py_TPFLAGS_IMMUTABLETYPE should be used, not !Py_TPFLAGS_HEAPTYPE. I don't know. In case of doubt, I suggest to only replace !Py_TPFLAGS_HEAPTYPE with Py_TPFLAGS_IMMUTABLETYPE. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:07:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 10:07:09 +0000 Subject: [issue43973] Use Py_TPFLAGS_IMMUTABLETYPE in __class__ assignments check In-Reply-To: <1619684825.72.0.216977603094.issue43973@roundup.psfhosted.org> Message-ID: <1619777229.81.0.778257948878.issue43973@roundup.psfhosted.org> STINNER Victor added the comment: New changeset b73b5fb9ea08156991a065c1696e8d8cf7622482 by Erlend Egeberg Aasland in branch 'master': bpo-43973: object_set_class() checks Py_TPFLAGS_IMMUTABLETYPE (GH-25714) https://github.com/python/cpython/commit/b73b5fb9ea08156991a065c1696e8d8cf7622482 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:09:20 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 10:09:20 +0000 Subject: [issue43973] Use Py_TPFLAGS_IMMUTABLETYPE in __class__ assignments check In-Reply-To: <1619684825.72.0.216977603094.issue43973@roundup.psfhosted.org> Message-ID: <1619777360.99.0.223052392136.issue43973@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Ok! Did you see bpo-24912 regarding the ModuleType check? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:09:43 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 10:09:43 +0000 Subject: [issue43973] Use Py_TPFLAGS_IMMUTABLETYPE in __class__ assignments check In-Reply-To: <1619684825.72.0.216977603094.issue43973@roundup.psfhosted.org> Message-ID: <1619777383.49.0.0260031810226.issue43973@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:10:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 30 Apr 2021 10:10:21 +0000 Subject: [issue12883] xml.sax.xmlreader.AttributesImpl allows empty string as attribute names In-Reply-To: <1314957842.78.0.391568748992.issue12883@psf.upfronthosting.co.za> Message-ID: <1619777421.49.0.88813638575.issue12883@roundup.psfhosted.org> Irit Katriel added the comment: I don't think the proposed patch is an acceptable solution. It silently skips invalid attributes. It would be ok to either raise an exception or to leave it as it is (junk-in-junk-out). I'm not sure which is better. ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 2.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:12:03 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 10:12:03 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619777523.68.0.477463479849.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Yep, I agree. From my coverage output, it seems that this branch is never executed. BUT, that may of course be because there's no test that exercises this branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:13:04 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 10:13:04 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619777584.47.0.832777796675.issue43908@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24433 pull_request: https://github.com/python/cpython/pull/25743 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:34:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 10:34:53 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619778893.39.0.535438869318.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: Hum, another function should be updated. Do you want to propose a fix Erlend? static int type_set_annotations(PyTypeObject *type, PyObject *value, void *context) { if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE)) { PyErr_Format(PyExc_TypeError, "can't set attributes of built-in/extension type '%s'", type->tp_name); return -1; } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:36:33 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 10:36:33 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619778993.13.0.815358538484.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: I just found it myself :) pushing out the PR now! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:39:27 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 10:39:27 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619779167.2.0.403914391118.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Included in GH-25743 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:43:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 10:43:57 +0000 Subject: [issue24912] The type of cached objects is mutable In-Reply-To: <1440194570.97.0.676736000835.issue24912@psf.upfronthosting.co.za> Message-ID: <1619779437.85.0.55873032179.issue24912@roundup.psfhosted.org> STINNER Victor added the comment: Update: a new Py_TPFLAGS_IMMUTABLETYPE flag was added in bpo-43908, and it's now checked rather than relying on Py_TPFLAGS_HEAPTYPE to decide if a type is "mutable" or not. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:44:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 10:44:41 +0000 Subject: [issue43973] Use Py_TPFLAGS_IMMUTABLETYPE in __class__ assignments check In-Reply-To: <1619684825.72.0.216977603094.issue43973@roundup.psfhosted.org> Message-ID: <1619779481.61.0.570087205314.issue43973@roundup.psfhosted.org> STINNER Victor added the comment: > Ok! Did you see bpo-24912 regarding the ModuleType check? No, I didn't. Sorry, there are too many things to look at, and too little bit. Do you think that something should be changed? If yes, please open a new separated issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:45:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 10:45:04 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619779504.63.0.717912751732.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-24912 "The type of cached objects is mutable". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:46:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 10:46:19 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619779579.73.0.696905754656.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 3bb09947ec4837de75532e21dd4bd25db0a1f1b7 by Victor Stinner in branch 'master': bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag (GH-25721) https://github.com/python/cpython/commit/3bb09947ec4837de75532e21dd4bd25db0a1f1b7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:52:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 10:52:14 +0000 Subject: [issue43916] Check that new heap types cannot be created uninitialised: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619779934.3.0.62164146968.issue43916@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Check that new heap types cannot be created uninitialised -> Check that new heap types cannot be created uninitialised: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:52:47 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 10:52:47 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619779967.26.0.573765471037.issue43916@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Check that new heap types cannot be created uninitialised: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag -> Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:52:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 10:52:57 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619779977.84.0.399208399812.issue43916@roundup.psfhosted.org> Change by STINNER Victor : ---------- components: +C API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 06:58:54 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 10:58:54 +0000 Subject: [issue43973] Use Py_TPFLAGS_IMMUTABLETYPE in __class__ assignments check In-Reply-To: <1619684825.72.0.216977603094.issue43973@roundup.psfhosted.org> Message-ID: <1619780334.51.0.4440701153.issue43973@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > Do you think that something should be changed? If yes, please open a new separated issue. No, my comment was just for information :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 07:02:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 11:02:24 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619780544.26.0.501073069013.issue43916@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24434 pull_request: https://github.com/python/cpython/pull/25745 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 07:05:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 11:05:25 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619780725.49.0.922567755042.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: PyStdPrinter_Type implements tp_new, but tp_init always fail: static int stdprinter_init(PyObject *self, PyObject *args, PyObject *kwds) { PyErr_SetString(PyExc_TypeError, "cannot create 'stderrprinter' instances"); return -1; } Maybe it should use the Py_TPFLAGS_IMMUTABLETYPE flag instead? Instances must be created with PyFile_NewStdPrinter() which doesn't use tp_new nor tp_init. Erlend: do you want to propose a PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 07:15:38 2021 From: report at bugs.python.org (Kat Hoessel) Date: Fri, 30 Apr 2021 11:15:38 +0000 Subject: [issue43986] ipaddress: increment/decrement on IPv*Interface disregards bitmask prefix Message-ID: <1619781338.67.0.912889230894.issue43986@roundup.psfhosted.org> New submission from Kat Hoessel : IPv4 and IPv6 interface objects of the `ipaddress` library show unexpected behaviour when arithmetic operators like + (increment) and - (decrement) are run on them. `ipaddress` interfaces can be incremented/decremented, similar to IP addresses. Currently, there are two problems with how these operations are implemented for interfaces within this library. This applies to both IPv4 and IPv6, and may yield incorrect and inconsistent results. 1. Increment/decrement on an interface overrides subnet prefix length The resulting interface will always have a prefix length of /32 for IPv4, /128 for IPv6, regardless of the original interface prefix. (See iPython code examples below.) This behaviour is incomprehensible and unexpected. 2. Increment/decrement on an interface does not respect subnet arithmetic For example, ipaddress.ip_interface('10.0.0.1/24') + 255 has no valid result under subnet arithmetic. `ipaddress` however, incorrectly returns IPv4Interface('10.0.1.0/32') It is likely that the behaviour seen in 2) logically follows after 1). Both are assumedly related to the fact that IPv*Interface is a subclass of IPv*Address with inherited properties. To achieve consistent behaviour for interfaces under +/-, I would suggest to either a) make sure that +/- operators on interfaces preserve the prefix and respect subnet arithmetic, or b) forbid +/- operators on interfaces. My preferred solution would be a). I would be interested in providing a patch, given that the observed behaviour is confirmed as a bug. ---------------------------------------------------------------- ### IPv4 In [1]: import ipaddress In [2]: iff = ipaddress.ip_interface('10.0.0.1/24') In [3]: iff Out[3]: IPv4Interface('10.0.0.1/24') In [4]: iff1 = iff + 1 In [5]: iff1 Out[5]: IPv4Interface('10.0.0.2/32') In [6]: iff.network.prefixlen Out[6]: 24 In [7]: iff1.network.prefixlen Out[7]: 32 ### overflow In [8]: iff + 255 # this should not work Out[8]: IPv4Interface('10.0.1.0/32') ### IPv6 In [9]: iff = ipaddress.ip_interface('1:1:1:2::1/64') In [10]: iff Out[10]: IPv6Interface('1:1:1:2::1/64') In [11]: iff + 1 Out[11]: IPv6Interface('1:1:1:2::2/128') ### version information In [12]: import sys In [13]: sys.version Out[13]: '3.8.3 (default, Aug 31 2020, 16:03:14) \n[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]' ---------- components: Library (Lib) messages: 392417 nosy: katsel priority: normal severity: normal status: open title: ipaddress: increment/decrement on IPv*Interface disregards bitmask prefix versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 07:20:36 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 30 Apr 2021 11:20:36 +0000 Subject: [issue15443] datetime module has no support for nanoseconds In-Reply-To: <1343158610.62.0.806232279741.issue15443@psf.upfronthosting.co.za> Message-ID: <1619781636.36.0.120237134572.issue15443@roundup.psfhosted.org> Mark Dickinson added the comment: [Alexander] > Is there high enough demand for nanoseconds in datetime and time instances? One need that we've encountered in real code is simply for compatibility. We have Python code that interacts with a logging web service whose timestamps include nanosecond information. Whether or not nanosecond resolution makes sense for those timestamps is a moot point: that's out of our control. When representing information retrieved from that web service in Python-land, we have a problem. If datetime.datetime had nanosecond precision, then using datetime.datetime to represent the retrieved values would be a no-brainer. As it is, we face a choice between: - truncating or rounding to microsecond precision, and losing information as a result (which is particularly problematic if we want to write records back at any point) - representing in some indirect form (as a str, an integer number of nanoseconds, a (datetime, nanoseconds) tuple, ...) and requiring the user to convert values for plotting or other analysis - writing our own non-standard ns-supporting datetime class, or looking for a 3rd party library with that support None of those choices are terrible, but none of them are particularly palatable compared with using a standard library solution. (FWIW, we went with option 2, returning nanoseconds since the Unix epoch as an int.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 07:26:13 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 30 Apr 2021 11:26:13 +0000 Subject: [issue43987] Add "Annotations Best Practices" to HOWTO Message-ID: <1619781973.9.0.643111119253.issue43987@roundup.psfhosted.org> New submission from Larry Hastings : Dealing with annotations is complicated. I think there should be a section of the Python documentation describing best practices for working with annotations. So, here goes. The best spot I found for it was as a new HOWTO. I added links to that HOWTO to a couple relevant glossary definitions, and one in the documentation for inspect.get_annotations(). I'm not sure if it makes sense to add any other links; I considered adding links to the HOWTO to where the __annotations__ attribute is defined on functions, modules, and classes, in reference/datamodel.rst, but it just didn't seem like a good idea. ---------- assignee: larry components: Documentation messages: 392419 nosy: larry priority: normal severity: normal stage: needs patch status: open title: Add "Annotations Best Practices" to HOWTO type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 07:27:56 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 11:27:56 +0000 Subject: [issue24912] The type of cached objects is mutable In-Reply-To: <1440194570.97.0.676736000835.issue24912@psf.upfronthosting.co.za> Message-ID: <1619782076.66.0.749127248976.issue24912@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- nosy: +erlendaasland nosy_count: 17.0 -> 18.0 pull_requests: +24435 pull_request: https://github.com/python/cpython/pull/25714 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 07:28:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 11:28:38 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619782118.43.0.699262595456.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: https://docs.python.org/dev/c-api/typeobj.html#Py_TPFLAGS_IMMUTABLETYPE says: "This bit is set for type objects that are immutable: type attributes cannot be set nor deleted." Is it possible that a metatype (type subtype) overrides tp_setattro and ignores the Py_TPFLAGS_IMMUTABLETYPE flag? Should we suggest that metatypes implemented in C and overridding tp_setattro should take the Py_TPFLAGS_IMMUTABLETYPE flag in account? When a type overrides tp_setattro, I understand that it's fine since it's only used to set attributes of its instances, not on the type itself. -- See also bpo-43770 "Rework C types initialization": some types explicitly sets explicitly tp_setattro to PyObject_GenericSetAttr. But it's unrelated since it's used to set attributes of type instances. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 07:30:15 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 30 Apr 2021 11:30:15 +0000 Subject: [issue43987] Add "Annotations Best Practices" to HOWTO In-Reply-To: <1619781973.9.0.643111119253.issue43987@roundup.psfhosted.org> Message-ID: <1619782215.43.0.336560445928.issue43987@roundup.psfhosted.org> Change by Larry Hastings : ---------- keywords: +patch pull_requests: +24436 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25746 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 07:31:08 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 30 Apr 2021 11:31:08 +0000 Subject: [issue43987] Add "Annotations Best Practices" to HOWTO In-Reply-To: <1619781973.9.0.643111119253.issue43987@roundup.psfhosted.org> Message-ID: <1619782268.42.0.955778072001.issue43987@roundup.psfhosted.org> Change by Larry Hastings : ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 07:35:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 11:35:11 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619782511.08.0.0598607728416.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: Erlend: would you mind to document the new Py_TPFLAGS_IMMUTABLETYPE flag in the C API section of What's New in Python 3.10? https://docs.python.org/dev/whatsnew/3.10.html#c-api-changes In "New Features", something like: * Add a new :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag to (...). (Contributed by xxx in :issue:`43908`.) And in the "Porting to Python 3.10", I don't know if we should suggest reviewing metatypes implemented in C which overrides tp_setattro, to take the new flag in account. Maybe explain that Py_TPFLAGS_IMMUTABLETYPE should now be checked to decide if a type is mutable or not, rather than relying on Py_TPFLAGS_HEAPTYPE. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 07:46:11 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 11:46:11 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619783171.88.0.483675155881.issue43908@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Yes, I?ll have a look at it this afternoon. (On mobile now.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 07:53:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 11:53:11 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1619783591.65.0.34803962578.issue36384@roundup.psfhosted.org> STINNER Victor added the comment: The CVE-2021-29921 was assigned to this vulnerability. ---------- title: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal -> [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 08:01:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 12:01:43 +0000 Subject: [issue43981] test_idle is leaking references In-Reply-To: <1619731760.39.0.648399014878.issue43981@roundup.psfhosted.org> Message-ID: <1619784103.0.0.125135049754.issue43981@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I will try to investigate today or tomorrow but notice that is very possible that the leak is somewhere else in the interpreter and is just showing in the IDLE tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 08:03:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 12:03:50 +0000 Subject: [issue37387] test_compileall fails randomly on Windows when tests are run in parallel In-Reply-To: <1561383626.08.0.320504464802.issue37387@roundup.psfhosted.org> Message-ID: <1619784230.45.0.495083800472.issue37387@roundup.psfhosted.org> STINNER Victor added the comment: I proposed a way to fix the issue: "Maybe the test should copy all .py files of the stdlib into a temporary directory and work there, to not impact other tests run in parallel." Shreyan Avigyan: > Though I've never been able to reproduce this test failure. Maybe it's fixed (maybe it was a side effect of another test)? It's a race condition. It's hard to reproduce in a reliable way, but I'm sure that it has not been fixed. The bug happens when one process tries to recreate the .pyc, whereas another process has the old .pyc file open. You can maybe make the issue more likely by adding a sleep in the code reading pyc content. For example, in the FileLoader.get_data() method of importlib._bootstrap_external. Hacking importlib is non trivial, since the Python code is compiled as a frozen module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 08:07:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 12:07:06 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619784426.04.0.719171500937.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0cad068ec174bbe33fb80460da56eb413f3b9359 by Victor Stinner in branch 'master': bpo-43916: Remove _disabled_new() function (GH-25745) https://github.com/python/cpython/commit/0cad068ec174bbe33fb80460da56eb413f3b9359 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 08:15:21 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 12:15:21 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619784921.81.0.207947459304.issue43916@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24437 pull_request: https://github.com/python/cpython/pull/25748 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 08:31:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 12:31:04 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619785864.13.0.294306312426.issue43916@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24438 pull_request: https://github.com/python/cpython/pull/25749 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 08:56:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 12:56:30 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619787390.89.0.278971459017.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 4908fae3d57f68694cf006e89fd7761f45003447 by Victor Stinner in branch 'master': bpo-43916: PyStdPrinter_Type uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25749) https://github.com/python/cpython/commit/4908fae3d57f68694cf006e89fd7761f45003447 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 09:18:23 2021 From: report at bugs.python.org (Julien Castiaux) Date: Fri, 30 Apr 2021 13:18:23 +0000 Subject: [issue43922] Double dots in quopri transported emails In-Reply-To: <1619188610.43.0.088106557205.issue43922@roundup.psfhosted.org> Message-ID: <1619788703.52.0.829054942756.issue43922@roundup.psfhosted.org> Julien Castiaux added the comment: Fix deployed in the third party ---------- resolution: -> third party stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 09:21:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 13:21:48 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1619788908.82.0.901062773584.issue43667@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9032cf5cb1e33c0349089cfb0f6bf11ed3c30e86 by Jakub Kul?k in branch 'master': bpo-43667: Fix broken Unicode encoding in non-UTF locales on Solaris (GH-25096) https://github.com/python/cpython/commit/9032cf5cb1e33c0349089cfb0f6bf11ed3c30e86 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 09:25:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 13:25:50 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619789150.94.0.846583585144.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 64141382ecbad665d5738ff26d15505f3427c724 by Erlend Egeberg Aasland in branch 'master': bpo-43908: check_set_special_type_attr() checks Py_TPFLAGS_IMMUTABLETYPE (GH-25743) https://github.com/python/cpython/commit/64141382ecbad665d5738ff26d15505f3427c724 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 09:27:37 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 30 Apr 2021 13:27:37 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1619789257.62.0.0952147727389.issue40222@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +24440 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25729 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 09:26:53 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 13:26:53 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619789213.66.0.300498264708.issue43916@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +24439 pull_request: https://github.com/python/cpython/pull/25750 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 09:32:54 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 30 Apr 2021 13:32:54 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619789574.27.0.0480488995565.issue43933@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 5979e81a212949c62c2490167c9137d233d7de64 by Mark Shannon in branch 'master': bpo-43933: Set frame.f_lineno during call to __exit__ (GH-25719) https://github.com/python/cpython/commit/5979e81a212949c62c2490167c9137d233d7de64 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 09:34:44 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 30 Apr 2021 13:34:44 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619789684.26.0.624498378095.issue43933@roundup.psfhosted.org> Mark Shannon added the comment: I'm claiming that this is fixed. Feel free to reopen if the additional line in tracing causes a problem. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 09:49:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 13:49:24 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619790564.59.0.382854696888.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 387397f8a4244c983f4568c16a28842e3268fe5d by Erlend Egeberg Aasland in branch 'master': bpo-43916: select.poll uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25750) https://github.com/python/cpython/commit/387397f8a4244c983f4568c16a28842e3268fe5d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 10:05:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 14:05:04 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619791504.89.0.225924725644.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9746cda705decebc0ba572d95612796afd06dcd4 by Erlend Egeberg Aasland in branch 'master': bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748) https://github.com/python/cpython/commit/9746cda705decebc0ba572d95612796afd06dcd4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 10:10:23 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 14:10:23 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619791823.85.0.346302552479.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Pablo & Serhiy, can we close this issue now? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 10:10:47 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 30 Apr 2021 14:10:47 +0000 Subject: [issue4130] Intel icc 9.1 does not support __int128_t used by ctypes In-Reply-To: <1224103336.6.0.753228794094.issue4130@psf.upfronthosting.co.za> Message-ID: <1619791847.97.0.558919544108.issue4130@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 10:12:30 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 14:12:30 +0000 Subject: [issue43988] Add test.support.assert_dissallow_instantiation Message-ID: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> New submission from Erlend Egeberg Aasland : See https://github.com/python/cpython/pull/25748#discussion_r623849521: "What do you think of adding support.assert_disallow_instanciation(type, *args) function which would check for TypeError but also check the error message? TypeError is quite generic and it might hide a bug." Ref. bpo-43916. ---------- components: Tests messages: 392436 nosy: erlendaasland, vstinner priority: normal severity: normal status: open title: Add test.support.assert_dissallow_instantiation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 10:12:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 14:12:51 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619791971.85.0.1788605094.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: Currently, 33 types explicitly set the Py_TPFLAGS_DISALLOW_INSTANTIATION flag: * PyStdPrinter_Type * _curses.ncurses_version type * _curses_panel.panel * _dbm.dbm * _gdbm.gdbm * _hashlib.HASH * _hashlib.HASHXOF * _hashlib.HMAC * _multibytecodec.MultibyteCodec * _sre..SRE_Scanner * _thread._localdummy * _thread.lock * _tkinter.Tcl_Obj * _tkinter.tkapp * _tkinter.tktimertoken * _winapi.Overlapped * _xxsubinterpretersmodule.ChannelID * array.arrayiterator * functools.KeyWrapper * functools._lru_list_elem * os.DirEntry * os.ScandirIterator * pyexpat.xmlparser * re.Match * re.Pattern * select.poll * sys.flags type * sys.getwindowsversion() type * sys.version_info type * unicodedata.UCD * zlib.Compress * zlib.Decompress * _xxsubinterpreters.ChannelID --- Static types with tp_base=NULL (or tp_base=&PyBaseObject_Type) and tp_new=NULL get Py_TPFLAGS_DISALLOW_INSTANTIATION flag automatically. Example of 70 static types which gets this flag automatically: * CArgObject * EncodingMap * Generic * GenericAlias * PyCapsule * TaskStepMethWrapper * Token.MISSING * _RunningLoopHolder * _asyncio.FutureIter * _ctypes.CThunkObject * _ctypes.StructParam_Type * _ctypes._CData * _elementtree._element_iterator * _io._BytesIOBuffer * _pickle.Pdata * _pickle.PicklerMemoProxy * _pickle.UnpicklerMemoProxy * _xxsubinterpreters.ChannelID * anext_awaitable * async_generator * async_generator_asend * async_generator_athrow * async_generator_wrapped_value * builtin_function_or_method * bytearray_iterator * bytes_iterator * callable_iterator * classmethod_descriptor * coroutine * coroutine_wrapper * decimal.ContextManager * dict_itemiterator * dict_items * dict_keyiterator * dict_keys * dict_reverseitemiterator * dict_reversekeyiterator * dict_reversevalueiterator * dict_valueiterator * dict_values * fieldnameiterator * formatteriterator * frame * generator * getset_descriptor * hamt_array_node * hamt_bitmap_node * hamt_collision_node * items * iterator * keys * list_iterator * list_reverseiterator * longrange_iterator * managedbuffer * member_descriptor * method-wrapper * method_descriptor * moduledef * odict_iterator * range_iterator * set_iterator * str_iterator * symtable entry * tuple_iterator * types.Union * values * weakcallableproxy * weakproxy * wrapper_descriptor ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 10:12:36 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 14:12:36 +0000 Subject: [issue43988] Add test.support.assert_dissallow_instantiation In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1619791956.15.0.106526569821.issue43988@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 10:13:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 14:13:31 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619792011.38.0.414337078412.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: I remove the release blocker priority of this issue, since the main issue has been fixed. ---------- priority: release blocker -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 10:19:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 14:19:18 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619792358.02.0.899307667353.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: Currently, 4 types are declared with Py_TPFLAGS_IMMUTABLETYPE explicitly: * array.array * re.Pattern * re.Match * _sre.SRE_Scanner ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 10:19:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 14:19:37 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619792377.11.0.423777468445.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: Moreover, all static types get the Py_TPFLAGS_IMMUTABLETYPE flag automatically. For example, "./python -c pass" initializes 196 immutable static types: * ArithmeticError * AssertionError * AttributeError * BaseException * BlockingIOError * BrokenPipeError * BufferError * BytesWarning * ChildProcessError * ConnectionAbortedError * ConnectionError * ConnectionRefusedError * ConnectionResetError * DeprecationWarning * EOFError * EncodingMap * EncodingWarning * Exception * FileExistsError * FileNotFoundError * FloatingPointError * FutureWarning * GeneratorExit * ImportError * ImportWarning * IndentationError * IndexError * InterpreterID * InterruptedError * IsADirectoryError * KeyError * KeyboardInterrupt * LookupError * MemoryError * ModuleNotFoundError * NameError * NoneType * NotADirectoryError * NotImplementedError * NotImplementedType * OSError * OverflowError * PendingDeprecationWarning * PermissionError * ProcessLookupError * PyCapsule * RecursionError * ReferenceError * ResourceWarning * RuntimeError * RuntimeWarning * StopAsyncIteration * StopIteration * SyntaxError * SyntaxWarning * SystemError * SystemExit * TabError * TimeoutError * Token.MISSING * TypeError * UnboundLocalError * UnicodeDecodeError * UnicodeEncodeError * UnicodeError * UnicodeTranslateError * UnicodeWarning * UnraisableHookArgs * UserWarning * ValueError * Warning * ZeroDivisionError * _contextvars.Context * _contextvars.ContextVar * _contextvars.Token * _io.BufferedRWPair * _io.BufferedRandom * _io.BufferedReader * _io.BufferedWriter * _io.BytesIO * _io.FileIO * _io.IncrementalNewlineDecoder * _io.StringIO * _io.TextIOWrapper * _io._BufferedIOBase * _io._BytesIOBuffer * _io._IOBase * _io._RawIOBase * _io._TextIOBase * _thread._ExceptHookArgs * anext_awaitable * async_generator * async_generator_asend * async_generator_athrow * async_generator_wrapped_value * asyncgen_hooks * bool * builtin_function_or_method * builtin_method * bytearray * bytearray_iterator * bytes * bytes_iterator * callable_iterator * cell * classmethod * classmethod_descriptor * code * collections.OrderedDict * complex * coroutine * coroutine_wrapper * dict * dict_itemiterator * dict_items * dict_keyiterator * dict_keys * dict_reverseitemiterator * dict_reversekeyiterator * dict_reversevalueiterator * dict_valueiterator * dict_values * ellipsis * enumerate * fieldnameiterator * filter * float * formatteriterator * frame * frozenset * function * generator * getset_descriptor * hamt * hamt_array_node * hamt_bitmap_node * hamt_collision_node * instancemethod * int * items * iterator * keys * list * list_iterator * list_reverseiterator * longrange_iterator * managedbuffer * map * mappingproxy * member_descriptor * memoryview * method * method-wrapper * method_descriptor * module * moduledef * object * odict_items * odict_iterator * odict_keys * odict_values * pickle.PickleBuffer * property * range * range_iterator * reversed * set * set_iterator * signal.struct_siginfo * slice * staticmethod * stderrprinter * str * str_iterator * super * symtable entry * sys.flags * sys.float_info * sys.hash_info * sys.int_info * sys.thread_info * sys.version_info * time.struct_time * traceback * tuple * tuple_iterator * type * types.GenericAlias * types.SimpleNamespace * types.Union * values * weakcallableproxy * weakproxy * weakref * wrapper_descriptor * zip ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 10:26:44 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 30 Apr 2021 14:26:44 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619792804.11.0.2785474041.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: Victor, the types, that Py_TPFLAGS_IMMUTABLETYPE flag is yet to be applied to, are different for 3.9 and 3.10. Should we proceed with that? (If yes I'd be happy to collaborate with Erlend to apply the flag on those types.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 10:28:00 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 30 Apr 2021 14:28:00 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1619792880.87.0.395733660154.issue14243@roundup.psfhosted.org> Zachary Ware added the comment: > if NamedTemporaryFile is used as a context manager, the file is closed *on context manager exit* and *not* when the file is closed. +1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 10:29:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 14:29:26 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619792966.33.0.0864797826624.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: > Victor, the types, that Py_TPFLAGS_IMMUTABLETYPE flag is yet to be applied to, are different for 3.9 and 3.10. Should we proceed with that? (If yes I'd be happy to collaborate with Erlend to apply the flag on those types.) Please don't change the behavior in the 3.9 stable branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 10:30:30 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 30 Apr 2021 14:30:30 +0000 Subject: [issue37387] test_compileall fails randomly on Windows when tests are run in parallel In-Reply-To: <1561383626.08.0.320504464802.issue37387@roundup.psfhosted.org> Message-ID: <1619793030.2.0.944619676608.issue37387@roundup.psfhosted.org> Shreyan Avigyan added the comment: Ok ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 10:43:44 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 30 Apr 2021 14:43:44 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619793824.39.0.252795852747.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: Ok ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 10:43:58 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 30 Apr 2021 14:43:58 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619793838.56.0.191441764968.issue43908@roundup.psfhosted.org> Shreyan Avigyan added the comment: Ok ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:11:20 2021 From: report at bugs.python.org (Anjali Singh) Date: Fri, 30 Apr 2021 15:11:20 +0000 Subject: [issue43710] Access violations in C extension modules on Python 3.9.3 In-Reply-To: <1617419380.7.0.273976800885.issue43710@roundup.psfhosted.org> Message-ID: <1619795480.51.0.888458309997.issue43710@roundup.psfhosted.org> Change by Anjali Singh : Added file: https://bugs.python.org/file50002/Screenshot_20210426-104915_Lucknow Public School.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:12:03 2021 From: report at bugs.python.org (Paul Moore) Date: Fri, 30 Apr 2021 15:12:03 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1619795523.22.0.431210137452.issue14243@roundup.psfhosted.org> Paul Moore added the comment: Looking at the various comments, I think we have 5 votes for deleting on CM exit when used as a CM, and no change in behaviour otherwise (me, Zachary, Ethan, Jason and Steve). Steve also wants O_TEMPORARY to be removed, which doesn't seem controversial among this group of people. Eryk has argued for a delete_on_close flag that would need to be explicitly set to False, retaining the use of O_TEMPORARY in the default case, but there doesn't seem to be a lot of support for that. If I've misrepresented anyone's view, please speak up! I didn't look back at the stuff from 2013 and earlier, I'll admit. I do think this needs care to implement (and document!) correctly. For example, consider the following case: ntf = NamedTemporaryFile() # Do some stuff (1) with ntf: # Do some stuff (2) # Do some followup stuff I assume we'd want a close in (1) to delete the file, but a close in (2) to leave it open until the CM exit. Evgeny, would you be willing to update your PR (including adding the docs change, and tests to catch as many edge cases as you can think up) to match this behaviour? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:18:09 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 30 Apr 2021 15:18:09 +0000 Subject: [issue43710] Access violations in C extension modules on Python 3.9.3 In-Reply-To: <1617419380.7.0.273976800885.issue43710@roundup.psfhosted.org> Message-ID: <1619795889.14.0.413933201296.issue43710@roundup.psfhosted.org> Change by Zachary Ware : Removed file: https://bugs.python.org/file50002/Screenshot_20210426-104915_Lucknow Public School.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:18:32 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 30 Apr 2021 15:18:32 +0000 Subject: [issue43710] Access violations in C extension modules on Python 3.9.3 In-Reply-To: <1617419380.7.0.273976800885.issue43710@roundup.psfhosted.org> Message-ID: <1619795912.13.0.663006599331.issue43710@roundup.psfhosted.org> Change by Zachary Ware : Removed file: https://bugs.python.org/file49966/logs.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:34:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 15:34:16 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619796856.5.0.941461512388.issue43933@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks Mark for the quick fix! Can someone confirm if the pytest issue is fixed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:40:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 15:40:50 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619797250.11.0.773796377708.issue43901@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately commit 2f2b69855d6524e15d12c15ddc0adce629e7de84 has broken the buildbots: ====================================================================== FAIL: test_annotations_are_created_correctly (test.test_module.ModuleTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\3.x.ware-win81-release.refleak\build\lib\test\test_module.py", line 338, in test_annotations_are_created_correctly self.assertTrue("__annotations__" in ann_module4.__dict__) AssertionError: False is not true ---------------------------------------------------------------------- Example failure: https://buildbot.python.org/all/#/builders/511/builds/12/steps/4/logs/stdio ---------- nosy: +pablogsal resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:41:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 15:41:13 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619797273.86.0.440675241445.issue43901@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:42:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 15:42:21 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619797341.26.0.649487200019.issue43901@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I think that test_annotations_are_created_correctly should use the import_helper.import_fresh_module helper ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:46:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 15:46:32 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619797592.37.0.50810313345.issue43916@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24441 pull_request: https://github.com/python/cpython/pull/25751 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:47:31 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 30 Apr 2021 15:47:31 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619797651.73.0.0433306851325.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: Gee whiz! Sorry about that. I swear, it works fine on my machine. I'll incorporate import_helper.import_fresh_module helper into the test as you suggest, and once I get it to work I'll send you a PR. I don't know how to test fixing this failure, though, because again it already works fine on my machine. Why would it fail on Windows? Are there dramatic differences under the covers with respect to the import machinery and caching and such between POSIX and Windows? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:47:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 15:47:23 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619797643.02.0.711615431882.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: According to msg391924, more types should use Py_TPFLAGS_DISALLOW_INSTANTIATION: * _md5.md5 * _sha1.sha1 * _sha256.sha224 * _sha256.sha256 * _sha512.sha384 * _sha512.sha512 * select.devpoll: I created PR 25751 * select.kevent: it implements a working tp_new method: "{Py_tp_new, select_kqueue}," * sqlite3.Cache * sqlite3.Connection * sqlite3.Cursor * sqlite3.Node * sqlite3.Row * sqlite3.Statement ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:49:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 15:49:09 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619797749.23.0.538726593705.issue43901@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Oh, actually is workse because commenting out the test shows refleaks: ? ./python.exe -m test test_module -R : 0:00:00 load avg: 5.03 Run tests sequentially 0:00:00 load avg: 5.03 [1/1] test_module beginning 9 repetitions 123456789 ......... test_module leaked [47, 47, 47, 47] references, sum=188 test_module leaked [6, 6, 6, 6] memory blocks, sum=24 test_module failed == Tests result: FAILURE == 1 test failed: test_module Total duration: 2.0 sec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:50:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 15:50:09 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619797809.29.0.948207276445.issue43901@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: >> Why would it fail on Windows? It fails on all refleak buildbots. To reproduce: % ./configure --with-pydebug -C && make -j -s % ./python.exe -m test test_module -R : ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:58:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 15:58:07 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619798287.74.0.498650803126.issue43916@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +24443 pull_request: https://github.com/python/cpython/pull/25753 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:57:58 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 30 Apr 2021 15:57:58 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619798278.31.0.611077661995.issue43901@roundup.psfhosted.org> Change by Larry Hastings : ---------- pull_requests: +24442 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/25752 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:59:26 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 30 Apr 2021 15:59:26 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619798366.57.0.309282227463.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: Eek! I swear I did a refleak check and got a clean bill of health. Again, sorry about this! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 11:59:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 15:59:21 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619798361.11.0.219294677659.issue43901@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24444 pull_request: https://github.com/python/cpython/pull/25754 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:00:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 16:00:10 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619798410.24.0.959627170702.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: * _md5.md5 * _sha1.sha1 * _sha256.sha224 * _sha256.sha256 * _sha512.sha384 * _sha512.sha512 I created PR 25753. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:01:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 16:01:30 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619798490.0.0.7677128336.issue43901@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Eek! I swear I did a refleak check and got a clean bill of health. Again, sorry about this! No problem at all! I'm sure we can fix this on time :) Opened https://github.com/python/cpython/pull/25754 for the refleaks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:02:25 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 30 Apr 2021 16:02:25 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619798545.57.0.358323078566.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: You want a separate PR for the refleak fix, or should I roll them both up into one? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:03:57 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 30 Apr 2021 16:03:57 +0000 Subject: [issue43984] [security]winreg.SetValueEx shoule check the returned value In-Reply-To: <1619772121.59.0.631498595724.issue43984@roundup.psfhosted.org> Message-ID: <1619798637.91.0.829006948369.issue43984@roundup.psfhosted.org> Shreyan Avigyan added the comment: +1 on my side. ---------- nosy: +paul.moore, shreyanavigyan, steve.dower, stutzbach, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:04:31 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 30 Apr 2021 16:04:31 +0000 Subject: [issue29753] [Linux] ctypes packs bitfields Incorrectly In-Reply-To: <1488933400.56.0.160685455632.issue29753@psf.upfronthosting.co.za> Message-ID: <1619798671.79.0.776567710713.issue29753@roundup.psfhosted.org> Filipe La?ns added the comment: I forgot to ping here, the patch went in and should be available in 3.10, so this can be closed now. ---------- nosy: +jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:05:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 16:05:08 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619798708.69.0.061113015526.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: It seems like _sqlite3 heap types support regular instantiation and so that no change is needed. * sqlite3.Cache {Py_tp_new, PyType_GenericNew}, * sqlite3.Connection {Py_tp_new, PyType_GenericNew}, {Py_tp_init, pysqlite_connection_init}, * sqlite3.Cursor {Py_tp_new, PyType_GenericNew}, {Py_tp_init, pysqlite_cursor_init}, * sqlite3.Node {Py_tp_new, PyType_GenericNew}, * sqlite3.Row {Py_tp_new, pysqlite_row_new}, * sqlite3.Statement {Py_tp_new, PyType_GenericNew}, $ ./python Python 3.10.0a7+ >>> import _sqlite3 >>> conn=_sqlite3.Connection(":memory:") >>> type(conn)() TypeError: function missing required argument 'database' (pos 1) >>> conn2 = type(conn)(":memory:") >>> list(conn.execute("SELECT 1;")) [(1,)] >>> list(conn2.execute("SELECT 1;")) [(1,)] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:05:05 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 16:05:05 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619798705.65.0.462170150692.issue43901@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I made a fix for everything in https://github.com/python/cpython/pull/25754. Could you review it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:05:13 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 30 Apr 2021 16:05:13 +0000 Subject: [issue43984] [security] winreg.SetValueEx should check the returned value In-Reply-To: <1619772121.59.0.631498595724.issue43984@roundup.psfhosted.org> Message-ID: <1619798713.68.0.673605404943.issue43984@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- title: [security]winreg.SetValueEx shoule check the returned value -> [security] winreg.SetValueEx should check the returned value _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:05:14 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 30 Apr 2021 16:05:14 +0000 Subject: [issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s In-Reply-To: <1619658397.03.0.0874955697236.issue43972@roundup.psfhosted.org> Message-ID: <1619798714.79.0.428053482126.issue43972@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- assignee: -> orsenthil nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:08:34 2021 From: report at bugs.python.org (Anthony Sottile) Date: Fri, 30 Apr 2021 16:08:34 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1619798914.02.0.227196202417.issue43933@roundup.psfhosted.org> Anthony Sottile added the comment: can confirm that pytest no longer crashes ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:17:16 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Blondon?=) Date: Fri, 30 Apr 2021 16:17:16 +0000 Subject: [issue42589] doc: Wrong "from" keyword link in Exceptions doc In-Reply-To: <1607356415.63.0.620558354489.issue42589@roundup.psfhosted.org> Message-ID: <1619799436.76.0.654487138949.issue42589@roundup.psfhosted.org> Change by St?phane Blondon : ---------- pull_requests: +24445 stage: backport needed -> patch review pull_request: https://github.com/python/cpython/pull/25755 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:20:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 16:20:01 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619799601.23.0.914435401663.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 7dcf0f6db38b7ab6918608542d3a0c6da0a286af by Victor Stinner in branch 'master': bpo-43916: select.devpoll uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25751) https://github.com/python/cpython/commit/7dcf0f6db38b7ab6918608542d3a0c6da0a286af ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:20:59 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 16:20:59 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619799659.13.0.649771883645.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: Yes, the sqlite3 types are fine. I don't know why I included them in my earlier post. I cleared the tp_new markings for the sqlite3 types on the Discourse post, since I can edit my posts over there, contrary to here on bpo :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:21:10 2021 From: report at bugs.python.org (Mariatta) Date: Fri, 30 Apr 2021 16:21:10 +0000 Subject: [issue42589] doc: Wrong "from" keyword link in Exceptions doc In-Reply-To: <1607356415.63.0.620558354489.issue42589@roundup.psfhosted.org> Message-ID: <1619799670.77.0.00226681643592.issue42589@roundup.psfhosted.org> Mariatta added the comment: Thanks for the work! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:24:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 16:24:12 +0000 Subject: [issue43981] test_idle is leaking references In-Reply-To: <1619731760.39.0.648399014878.issue43981@roundup.psfhosted.org> Message-ID: <1619799852.71.0.861461856203.issue43981@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Taking into account the last time the builder built successully it must have happened in some of these commits: b38b2fa021 Document importlib.metadata.PackagePath.locate method (GH-25669) 4a85718212 bpo-43970: Optimize Path.cwd() in pathlib by not instantiating a class unnecessarily (GH-25699) 15d3861856 bpo-37903: IDLE: Shell sidebar with prompts (GH-22682) 103d5e420d bpo-28254: _posixsubprocess uses PyGC_Enable/PyGC_Disable (GH-25693) 3b52c8d66b bpo-43908: Add Py_TPFLAGS_IMMUTABLETYPE flag (GH-25520) 3cc481b9de bpo-28254: Add a C-API for controlling the GC state (GH-25687) baecfbd849 bpo-43757: Make pathlib use os.path.realpath() to resolve symlinks in a path (GH-25264) 859577c249 bpo-41559: Change PEP 612 implementation to pure Python (#25449) c1a9535989 bpo-43955: Handle the case where the distutils warning has already been triggered (GH-25675) 4c49be7668 bpo-43959: clarify the documentation of the PyContextVar C-API (GH-25671) fe52eb6219 bpo-43961: Fix test_logging.test_namer_rotator_inheritance() (GH-25684) 32c5a17444 bpo-43962: Fix _PyInterpreterState_IDIncref() (GH-25683) 21b02b5f40 bpo-43960: test_pdb resets breakpoints (GH-25673) db0c5b786d bpo-43776: Remove list call from args in Popen repr (GH-25338) f9bedb630e bpo-41486: Faster bz2/lzma/zlib via new output buffering (GH-21740) a5e64444e6 bpo-43963: Add _signal module state (GH-25676) 5c84bb506a bpo-37751: Update `codecs.register()` doc. (GH-25643) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:25:59 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Apr 2021 16:25:59 +0000 Subject: [issue42589] doc: Wrong "from" keyword link in Exceptions doc In-Reply-To: <1607356415.63.0.620558354489.issue42589@roundup.psfhosted.org> Message-ID: <1619799959.45.0.603418102498.issue42589@roundup.psfhosted.org> miss-islington added the comment: New changeset ea6ec96c379a77ae827e844d840a9fd773781124 by sblondon in branch '3.8': [3.8] bpo-42589: Change URL for 'from' link when used in a raised exc? (GH-25755) https://github.com/python/cpython/commit/ea6ec96c379a77ae827e844d840a9fd773781124 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:26:48 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 16:26:48 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619800008.85.0.48009907625.issue43901@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset e374a40afa09be728b01653a06c9febfad9c9c50 by Pablo Galindo in branch 'master': bpo-43901: Fix refleaks in test_module (GH-25754) https://github.com/python/cpython/commit/e374a40afa09be728b01653a06c9febfad9c9c50 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:27:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 16:27:36 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619800056.98.0.841205244008.issue43901@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:28:35 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 30 Apr 2021 16:28:35 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1619800115.21.0.214501287454.issue14243@roundup.psfhosted.org> Eryk Sun added the comment: > deleting on CM exit when used as a CM, and no change in behaviour > otherwise (me, Zachary, Ethan, Jason and Steve). Steve also wants > O_TEMPORARY to be removed, which doesn't seem controversial among > this group of people. Removing O_TEMPORARY is not an afterthought here. It is the core of this issue. The O_TEMPORARY flag MUST NOT be used if the goal is to make NamedTemporaryFile() "particularly useful on Windows". A file that's opened with DELETE access cannot be reopened in most cases, because most opens do not share delete access, but it also can't be closed to allow it to be reopened because the OS will delete it. I replied twice that I thought using the CM exit instead of O_TEMPORARY is okay for NamedTemporaryFile() -- but only if a separate implementation of TemporaryFile() that uses O_TEMPORARY is added at the same time. I want guaranteed cleanup for TemporaryFile() since it's not intended to be reopened. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:37:24 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 30 Apr 2021 16:37:24 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619800644.33.0.192736323811.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: Obviously the original assertion failure ("AssertionError: False is not true") wasn't caused by the refleaks. So I'm still puzzled about why that test worked on POSIX and failed on Windows. I admit I was pulling some wacky import shenanigans in the test, and the import_fresh_module change is an improvement. But still... what was going on?! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:38:08 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 30 Apr 2021 16:38:08 +0000 Subject: [issue43979] Simplify urllib.parse_qsl In-Reply-To: <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org> Message-ID: <1619800688.76.0.754652179531.issue43979@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch nosy: +corona10 nosy_count: 2.0 -> 3.0 pull_requests: +24446 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25756 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:40:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 16:40:38 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619800838.01.0.948873946626.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 665c7746fca180266b121183c2d5136c547006e0 by Victor Stinner in branch 'master': bpo-43916: _md5.md5 uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25753) https://github.com/python/cpython/commit/665c7746fca180266b121183c2d5136c547006e0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:41:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 16:41:21 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619800881.02.0.940553615363.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: > bpo-43916: _md5.md5 uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25753) With this change, all tests listed in this issue should be fixed. But I didn't check the whole list of https://discuss.python.org/t/list-of-built-in-types-converted-to-heap-types/8403 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:42:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 16:42:58 +0000 Subject: [issue43981] test_idle is leaking references In-Reply-To: <1619731760.39.0.648399014878.issue43981@roundup.psfhosted.org> Message-ID: <1619800978.26.0.113258557402.issue43981@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I checked and reverting commit 15d3861856 fixes the leaks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:44:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 16:44:40 +0000 Subject: [issue43981] test_idle is leaking references In-Reply-To: <1619731760.39.0.648399014878.issue43981@roundup.psfhosted.org> Message-ID: <1619801080.78.0.148756586557.issue43981@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately given how close are we to the beta release and per our buildbot policy (https://discuss.python.org/t/policy-to-revert-commits-on-buildbot-failure/404) I may need to revert commit 15d3861856 to avoid masking other issues. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:46:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 16:46:37 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619801197.18.0.448716258401.issue43901@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > So I'm still puzzled about why that test worked on POSIX and failed on Windows I was able to reproduce it in my MacOS machine (maybe also it reproduced on Linux). The problem is that when you run with -R, the test runs several times and the import statement is a noop the second time because is cached. We needed to modify the test to import the module always ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:49:00 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 16:49:00 +0000 Subject: [issue43988] Add test.support.assert_dissallow_instantiation In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1619801340.91.0.973114662818.issue43988@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch pull_requests: +24447 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25757 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 12:54:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 30 Apr 2021 16:54:55 +0000 Subject: [issue7405] compiling python 3.1.1 using cygwin 1.7.0 and gcc 4.3.4 In-Reply-To: <1259386873.79.0.422049105742.issue7405@psf.upfronthosting.co.za> Message-ID: <1619801695.32.0.359193866554.issue7405@roundup.psfhosted.org> Irit Katriel added the comment: main.c is very different now compared to the patch. Closing as this is a 12 year old build issue and probably no longer relevant. Please create a new issue if you see this problem in 3.8+. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 13:16:16 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 30 Apr 2021 17:16:16 +0000 Subject: [issue43989] Enum deprecation breaks SSL tests Message-ID: <1619802976.1.0.850329373801.issue43989@roundup.psfhosted.org> New submission from Christian Heimes : Ethan, a recent change to enum module breaks ssltests. I'm running ssltests with python -Werror to detect deprecation issues. Could you please look into the matter and address the deprecation warning in asyncio? https://github.com/python/cpython/runs/2477299020 ====================================================================== ERROR: test_add_signal_handler_install_error3 (test.test_asyncio.test_unix_events.SelectorEventLoopSignalTests) ---------------------------------------------------------------------- test test_asyncio failed Traceback (most recent call last): File "/home/runner/work/cpython/cpython/Lib/asyncio/unix_events.py", line 116, in add_signal_handler signal.signal(sig, _sighandler_noop) File "/home/runner/work/cpython/cpython/Lib/unittest/mock.py", line 1105, in __call__ return self._mock_call(*args, **kwargs) File "/home/runner/work/cpython/cpython/Lib/unittest/mock.py", line 1109, in _mock_call return self._execute_mock_call(*args, **kwargs) File "/home/runner/work/cpython/cpython/Lib/unittest/mock.py", line 1164, in _execute_mock_call raise effect test.test_asyncio.test_unix_events.SelectorEventLoopSignalTests.test_add_signal_handler_install_error3..Err During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/runner/work/cpython/cpython/Lib/unittest/mock.py", line 1370, in patched return func(*newargs, **newkeywargs) File "/home/runner/work/cpython/cpython/Lib/test/test_asyncio/test_unix_events.py", line 165, in test_add_signal_handler_install_error3 self.assertRaises( File "/home/runner/work/cpython/cpython/Lib/unittest/case.py", line 732, in assertRaises return context.handle('assertRaises', args, kwargs) File "/home/runner/work/cpython/cpython/Lib/unittest/case.py", line 201, in handle callable_obj(*args, **kwargs) File "/home/runner/work/cpython/cpython/Lib/asyncio/unix_events.py", line 129, in add_signal_handler raise RuntimeError(f'sig {sig} cannot be caught') File "/home/runner/work/cpython/cpython/Lib/enum.py", line 1019, in __format__ warnings.warn( DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an IntEnum member, to maintainthe current display ---------- assignee: ethan.furman components: Library (Lib), Tests, asyncio keywords: 3.10regression, 3.9regression messages: 392478 nosy: asvetlov, barry, christian.heimes, eli.bendersky, ethan.furman, yselivanov priority: deferred blocker severity: normal stage: needs patch status: open title: Enum deprecation breaks SSL tests type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 13:21:44 2021 From: report at bugs.python.org (Evgeny) Date: Fri, 30 Apr 2021 17:21:44 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1619803304.14.0.324985690176.issue14243@roundup.psfhosted.org> Evgeny added the comment: >Eryk Sun added the comment: >I replied twice that I thought using the CM exit instead of O_TEMPORARY is okay for NamedTemporaryFile() -- but only if a separate implementation of TemporaryFile() that uses O_TEMPORARY is added at the same time. I want guaranteed cleanup for TemporaryFile() since it's not intended to be reopened. At the moment, the TemporaryFile directly reuses NamedTemporaryFile for none-posix or cygwin systems. https://github.com/python/cpython/blob/a92d7387632de1fc64de51f22f6191acd0c6f5c0/Lib/tempfile.py#L552 Does it mean, that your suggestion to leave the O_TEMPORARY for TemporaryFile means, that NamedTemporaryFile needs to have a mechanism to know whether it was called as a TemporaryFile and then to have a different functionality in this case relative to the situation it would be called directly? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 13:27:50 2021 From: report at bugs.python.org (John Florian) Date: Fri, 30 Apr 2021 17:27:50 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1619803670.04.0.435193914862.issue14243@roundup.psfhosted.org> Change by John Florian : ---------- nosy: -John Florian _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 13:32:34 2021 From: report at bugs.python.org (Evgeny) Date: Fri, 30 Apr 2021 17:32:34 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1619803954.98.0.0854436638618.issue14243@roundup.psfhosted.org> Evgeny added the comment: >Paul Moore added the comment: >Evgeny, would you be willing to update your PR (including adding the docs change, and tests to catch as many edge cases as you can think up) to match this behaviour? Paul, thank you for moving this forward. I will give it a try. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 13:33:30 2021 From: report at bugs.python.org (Webb Scales) Date: Fri, 30 Apr 2021 17:33:30 +0000 Subject: [issue43990] In documentation Section 6.17, Operator precedence, footnotes 5 & 6 are reversed Message-ID: <1619804010.67.0.84044375696.issue43990@roundup.psfhosted.org> New submission from Webb Scales : In Section 6.17 ("Operator precedence"; https://docs.python.org/3/reference/expressions.html#operator-precedence) of the documentation, footnote 5 (https://docs.python.org/3/reference/expressions.html#id15) refers to text (https://docs.python.org/3/reference/expressions.html#id21) which applies to reference 6, while footnote 6 refers to text which applies to reference 5. ---------- assignee: docs at python components: Documentation messages: 392481 nosy: docs at python, webbnh priority: normal severity: normal status: open title: In documentation Section 6.17, Operator precedence, footnotes 5 & 6 are reversed versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 13:34:05 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 30 Apr 2021 17:34:05 +0000 Subject: [issue43984] winreg.SetValueEx should check the returned value In-Reply-To: <1619772121.59.0.631498595724.issue43984@roundup.psfhosted.org> Message-ID: <1619804045.56.0.724367625801.issue43984@roundup.psfhosted.org> Eryk Sun added the comment: I'm changing this issue to a behavior bug. Many issues have the potential to be exploited as a security vulnerability in some contrived scenario, but the security issue type is for cases that have provably significant security implications, such as privilege escalation, which should be reported using the documented procedure [1]. Registry keys are secured, and modifying system keys requires privileged access, so a bug that sets an incorrect value is not particularly exploitable. Anyone that can set a system value already has full control of the system. The suggested fix is correct, except the C macro is `FALSE`, not `False`. I would simply cast to DWORD instead of `unsigned long`. Also, the REG_QWORD conversion has the same problem with not checking for an overflow after calling PyLong_AsUnsignedLongLong(). --- [1] https://www.python.org/dev/security ---------- components: +Windows -Library (Lib) nosy: +eryksun stage: -> needs patch title: [security] winreg.SetValueEx should check the returned value -> winreg.SetValueEx should check the returned value type: security -> behavior versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 13:39:01 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 30 Apr 2021 17:39:01 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1619804341.09.0.369998602562.issue14243@roundup.psfhosted.org> Eryk Sun added the comment: > Does it mean, that your suggestion to leave the O_TEMPORARY for > TemporaryFile means, that NamedTemporaryFile needs to have a > mechanism to know whether it was called as a TemporaryFile Just implement a separate function for TemporaryFile() instead of aliasing it to NamedTemporaryFile(). See msg390814. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 13:53:09 2021 From: report at bugs.python.org (Paul Moore) Date: Fri, 30 Apr 2021 17:53:09 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1619805189.76.0.105053359697.issue14243@roundup.psfhosted.org> Paul Moore added the comment: Eryk, thank you for clarifying. I apologise - I got bogged down somewhere in the middle of the discussion on reimplementing bits of the CRT (your posts are so information-dense that my usual habit of skimming breaks down - that's not a complaint, though!) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 13:56:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 17:56:37 +0000 Subject: [issue43981] test_idle is leaking references In-Reply-To: <1619731760.39.0.648399014878.issue43981@roundup.psfhosted.org> Message-ID: <1619805397.39.0.111605525899.issue43981@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24448 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25758 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 13:58:55 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 30 Apr 2021 17:58:55 +0000 Subject: [issue43984] winreg.SetValueEx should check the returned value In-Reply-To: <1619772121.59.0.631498595724.issue43984@roundup.psfhosted.org> Message-ID: <1619805535.34.0.943726798645.issue43984@roundup.psfhosted.org> Shreyan Avigyan added the comment: I have a patch ready for this issue. Should I convert it to a PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 13:59:39 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 30 Apr 2021 17:59:39 +0000 Subject: [issue43979] Simplify urllib.parse_qsl In-Reply-To: <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org> Message-ID: <1619805579.8.0.0482570208391.issue43979@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: -24446 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 13:59:58 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 30 Apr 2021 17:59:58 +0000 Subject: [issue43979] Simplify urllib.parse_qsl In-Reply-To: <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org> Message-ID: <1619805598.42.0.443705608421.issue43979@roundup.psfhosted.org> Dong-hee Na added the comment: > I can provide a PR if wanted. Please submit the PR if you want ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:00:21 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 30 Apr 2021 18:00:21 +0000 Subject: [issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths In-Reply-To: <1619627176.09.0.686852454721.issue43968@roundup.psfhosted.org> Message-ID: <1619805621.86.0.163556618372.issue43968@roundup.psfhosted.org> Eryk Sun added the comment: > E.g. if you specify env. var. PYTHON_NTREALPATH_OLD_BEHAVIOR=1, > it doesn't resolve symlinks and junctions. I assumed you wanted to resolve symlinks but hadn't considered that substitute drives are implemented as object symlinks that target arbitrary paths, which can include other substitute/mapped drives and filesystem symlinks. They aren't handled as mount points, at least not during system path parsing. If you don't need to resolve symlinks, just use os.path.abspath() in Windows and os.path.realpath() in POSIX. Don't worry about symlinks in the opened path in Windows. Unlike POSIX, the Windows API resolves a path like r"C:\example\symlink\..\dir" simply as r"C:\example\dir", before the kernel and filesystem ever see the path. There are reasons to need a real path in Windows, but this isn't one of them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:01:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 18:01:15 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1619805675.16.0.17968449254.issue43908@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I am decreasing the priority of this to deferred blocker since https://bugs.python.org/issue43916 is mostly fixed ---------- priority: release blocker -> deferred blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:08:05 2021 From: report at bugs.python.org (Christoph Zwerschke) Date: Fri, 30 Apr 2021 18:08:05 +0000 Subject: [issue43979] Simplify urllib.parse_qsl In-Reply-To: <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org> Message-ID: <1619806085.28.0.482672330122.issue43979@roundup.psfhosted.org> Christoph Zwerschke added the comment: I saw you submitted a PR already which looks good to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:12:27 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 30 Apr 2021 18:12:27 +0000 Subject: [issue43979] Simplify urllib.parse_qsl In-Reply-To: <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org> Message-ID: <1619806347.42.0.991035278408.issue43979@roundup.psfhosted.org> Dong-hee Na added the comment: > I saw you submitted a PR already which looks good to me. I should care that you can have a chance to submit the patch :) Is it okay to proceed with this issue with the PR which I closed or do you want to open a PR with your hand? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:14:16 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 30 Apr 2021 18:14:16 +0000 Subject: [issue43979] Simplify urllib.parse_qsl In-Reply-To: <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org> Message-ID: <1619806456.72.0.30859527433.issue43979@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:16:53 2021 From: report at bugs.python.org (Christoph Zwerschke) Date: Fri, 30 Apr 2021 18:16:53 +0000 Subject: [issue43979] Simplify urllib.parse_qsl In-Reply-To: <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org> Message-ID: <1619806613.31.0.703272073407.issue43979@roundup.psfhosted.org> Christoph Zwerschke added the comment: I don't mind if you reopen your PR. But thanks for asking. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:18:12 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 30 Apr 2021 18:18:12 +0000 Subject: [issue43979] Simplify urllib.parse_qsl In-Reply-To: <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org> Message-ID: <1619806692.73.0.926157379351.issue43979@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +24449 pull_request: https://github.com/python/cpython/pull/25756 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:20:28 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 30 Apr 2021 18:20:28 +0000 Subject: [issue43979] Simplify urllib.parse_qsl In-Reply-To: <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org> Message-ID: <1619806828.19.0.0870579658907.issue43979@roundup.psfhosted.org> Dong-hee Na added the comment: > I don't mind if you reopen your PR. But thanks for asking. I add your name as the co-author on PR 25756 :) Thanks for the report and suggestion ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:29:16 2021 From: report at bugs.python.org (Miguel Brito) Date: Fri, 30 Apr 2021 18:29:16 +0000 Subject: [issue43978] Incorrect "versionadded" info in typing.NoReturn documentation In-Reply-To: <1619720166.99.0.648507362303.issue43978@roundup.psfhosted.org> Message-ID: <1619807356.52.0.553478900996.issue43978@roundup.psfhosted.org> Change by Miguel Brito : ---------- keywords: +patch nosy: +miguendes nosy_count: 3.0 -> 4.0 pull_requests: +24450 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25760 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:31:40 2021 From: report at bugs.python.org (Miguel Brito) Date: Fri, 30 Apr 2021 18:31:40 +0000 Subject: [issue43978] Incorrect "versionadded" info in typing.NoReturn documentation In-Reply-To: <1619720166.99.0.648507362303.issue43978@roundup.psfhosted.org> Message-ID: <1619807500.53.0.053327786878.issue43978@roundup.psfhosted.org> Miguel Brito added the comment: This looks like a leftover from a merge conflict. Or a bad copy and paste indeed. I've checked the file prior to the PR and the was no version 3.5.4 tag. I've opened a PR to fix this: https://github.com/python/cpython/pull/25760 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:34:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 18:34:36 +0000 Subject: [issue43981] test_idle is leaking references In-Reply-To: <1619731760.39.0.648399014878.issue43981@roundup.psfhosted.org> Message-ID: <1619807676.13.0.0441574133828.issue43981@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 6689e45dfee75d756c540ff0946ebf0ae8847f43 by Pablo Galindo in branch 'master': bpo-43981: Fix reference leaks in test_squeezer (GH-25758) https://github.com/python/cpython/commit/6689e45dfee75d756c540ff0946ebf0ae8847f43 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:34:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 18:34:35 +0000 Subject: [issue43981] test_idle is leaking references In-Reply-To: <1619731760.39.0.648399014878.issue43981@roundup.psfhosted.org> Message-ID: <1619807675.79.0.650108374687.issue43981@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:34:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 18:34:51 +0000 Subject: [issue43981] test_idle is leaking references In-Reply-To: <1619731760.39.0.648399014878.issue43981@roundup.psfhosted.org> Message-ID: <1619807691.93.0.205513121699.issue43981@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Refleaks fixed by 6689e45dfee75d756c540ff0946ebf0ae8847f43 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:37:11 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 30 Apr 2021 18:37:11 +0000 Subject: [issue43989] Enum deprecation breaks SSL tests In-Reply-To: <1619802976.1.0.850329373801.issue43989@roundup.psfhosted.org> Message-ID: <1619807831.62.0.628190279172.issue43989@roundup.psfhosted.org> Change by Brandt Bucher : ---------- keywords: +patch nosy: +brandtbucher nosy_count: 6.0 -> 7.0 pull_requests: +24451 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25759 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:38:49 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 30 Apr 2021 18:38:49 +0000 Subject: [issue43979] Simplify urllib.parse_qsl In-Reply-To: <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org> Message-ID: <1619807929.91.0.0953218636172.issue43979@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:38:47 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 30 Apr 2021 18:38:47 +0000 Subject: [issue43989] Enum deprecation breaks SSL tests In-Reply-To: <1619802976.1.0.850329373801.issue43989@roundup.psfhosted.org> Message-ID: <1619807927.27.0.352800178189.issue43989@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: -24451 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:38:57 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 30 Apr 2021 18:38:57 +0000 Subject: [issue43989] Enum deprecation breaks SSL tests In-Reply-To: <1619802976.1.0.850329373801.issue43989@roundup.psfhosted.org> Message-ID: <1619807937.72.0.904781232244.issue43989@roundup.psfhosted.org> Brandt Bucher added the comment: Whoops. I just meant to reference this issue, but I guess if the GitHub bots see an issue number in a PR comment they link that PR as a patch. ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:39:13 2021 From: report at bugs.python.org (sfmc) Date: Fri, 30 Apr 2021 18:39:13 +0000 Subject: [issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths In-Reply-To: <1619627176.09.0.686852454721.issue43968@roundup.psfhosted.org> Message-ID: <1619807953.55.0.795496547247.issue43968@roundup.psfhosted.org> sfmc added the comment: > If you don't need to resolve symlinks, just use os.path.abspath() in Windows and os.path.realpath() in POSIX. As I said, we already fixed it in our scripts. The problem is with Python debugger and third-party tools - we can't make changes there. The environment variable would be easy fix to this issue. No impact on those who do not set the variable. ----- In our organization we use substituted drives for development, and no other tools (including other programming languages and their IDEs), except for Python 3.8+, had any problems with this. For example, in last versions of Perl and Ruby the realpath keeps the substitute drive. (In Ruby the realpath is also smart enough to resolve symlinks while keeping the drive.) ----- I consider this a serious issue with Python, I hope it gets the deserved attention and at least the workaround with env. var. gets implemented. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:48:41 2021 From: report at bugs.python.org (Tim Peters) Date: Fri, 30 Apr 2021 18:48:41 +0000 Subject: [issue37387] test_compileall fails randomly on Windows when tests are run in parallel In-Reply-To: <1561383626.08.0.320504464802.issue37387@roundup.psfhosted.org> Message-ID: <1619808521.96.0.564269230384.issue37387@roundup.psfhosted.org> Tim Peters added the comment: Yes, test_compileall can still fail for this reason on Windows. From a run just now with -j0 (same as -j10 on this box, which has 8 logical cores: a -j value <= 0 is treated the same as "2 + number of logical cores"): """ Compiling 'C:\\Code\\Python\\lib\\types.py'... *** PermissionError: [WinError 5] Access is denied: 'C:\\Code\\Python\\lib\\__pycache__\\types.cpython-310.pyc.2205988433776' -> 'C:\\Code\\Python\\lib\\__pycache__\\types.cpython-310.pyc' """ I did nothing in particular to try to provoke it. "It's random." So is the specific .py fail it fails on. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:49:44 2021 From: report at bugs.python.org (=?utf-8?q?Alexander_Niederb=C3=BChl?=) Date: Fri, 30 Apr 2021 18:49:44 +0000 Subject: [issue43991] asyncio lock does not get released after task is canceled Message-ID: <1619808584.15.0.419311675075.issue43991@roundup.psfhosted.org> New submission from Alexander Niederb?hl : If a task gets canceled while holding a lock, the lock is not automatically released. Is that expected, it seems like it could cause a deadlock? Failing test adapted from Lib/test/test_asyncio/test_locks.py (commit 6bd9288b80): def test_acquire_cancel(self): lock = asyncio.Lock() self.assertTrue(self.loop.run_until_complete(lock.acquire())) task = self.loop.create_task(lock.acquire()) self.loop.call_soon(task.cancel) self.assertRaises( asyncio.CancelledError, self.loop.run_until_complete, task) self.assertFalse(lock._waiters) # Should the lock get released after cancellation? self.assertFalse(lock.locked()) I stumbled upon this while playing around with TLA+. ---------- components: asyncio messages: 392499 nosy: a.niederbuehl, asvetlov, yselivanov priority: normal severity: normal status: open title: asyncio lock does not get released after task is canceled type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:53:40 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 30 Apr 2021 18:53:40 +0000 Subject: [issue43992] Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1 Message-ID: <1619808820.38.0.0813817869206.issue43992@roundup.psfhosted.org> New submission from Shreyan Avigyan : I'm trying to build CPython on Ubuntu but I can't get the external dependencies. Running this command :- $ sudo apt-get build-dep python3 gives the output :- Reading package lists... Done E: You must put some 'deb-src' URIs in your sources.list What is the exact string to add to /etc/apt/sources.list? System Info: Ubuntu 20.04.1 (Focal Fossa) Architecture: x64 GCC version: 9.3.0 (I've posted the problem in this issue tracker because Google and Stack Overflow doesn't seem to have an answer. I'm sorry for posting this here but no one seem to have the answer to this apart from core or experienced developers.) ---------- messages: 392500 nosy: shreyanavigyan priority: normal severity: normal status: open title: Unable to get external dependencies for CPython on Ubuntu Linux 20.04.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:54:13 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 30 Apr 2021 18:54:13 +0000 Subject: [issue40379] multiprocessing's default start method of fork()-without-exec() is broken In-Reply-To: <1587752543.41.0.119768714545.issue40379@roundup.psfhosted.org> Message-ID: <1619808853.49.0.0531882696032.issue40379@roundup.psfhosted.org> Antoine Pitrou added the comment: The problem with changing the default is that this will break any application that depends on passing non-picklable data to the child process (in addition to the potentially unexpected performance impact). The docs already contain a significant elaboration on the matter, but feel free to submit a PR that would make the various caveats more explicit: https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:55:04 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Fri, 30 Apr 2021 18:55:04 +0000 Subject: [issue43930] Update bundled pip to 21.1 and setuptools to 56.0.0 In-Reply-To: <1619273635.66.0.622596591495.issue43930@roundup.psfhosted.org> Message-ID: <1619808904.57.0.394839339828.issue43930@roundup.psfhosted.org> Change by St?phane Bidoul : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:55:41 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Fri, 30 Apr 2021 18:55:41 +0000 Subject: [issue43993] Upda Message-ID: <1619808941.36.0.183974538223.issue43993@roundup.psfhosted.org> Change by St?phane Bidoul : ---------- nosy: sbidoul priority: normal severity: normal status: open title: Upda _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:57:10 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 30 Apr 2021 18:57:10 +0000 Subject: [issue29753] [Linux] ctypes packs bitfields Incorrectly In-Reply-To: <1488933400.56.0.160685455632.issue29753@psf.upfronthosting.co.za> Message-ID: <1619809030.89.0.609991117221.issue29753@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:58:48 2021 From: report at bugs.python.org (Crowbar Z) Date: Fri, 30 Apr 2021 18:58:48 +0000 Subject: [issue42130] AsyncIO's wait_for can hide cancellation in a rare race condition In-Reply-To: <1603469429.01.0.760360212477.issue42130@roundup.psfhosted.org> Message-ID: <1619809128.51.0.232414122265.issue42130@roundup.psfhosted.org> Change by Crowbar Z : ---------- nosy: +crowbarz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:59:48 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Fri, 30 Apr 2021 18:59:48 +0000 Subject: [issue43993] Update bundled pip to 21.1.1 Message-ID: <1619809188.59.0.0758758715434.issue43993@roundup.psfhosted.org> New submission from St?phane Bidoul : This is to update the bundled pip to 21.1.1. Compared to 21.1, it includes a fix that suppresses a noisy message when distutils and sysconfig schemes do not match. I link this issue to 3.9 and 3.8 as well, as it could be nice to include it in the release for a better user experience, if we are not too close to the release deadline. ---------- title: Upda -> Update bundled pip to 21.1.1 versions: +Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 14:59:59 2021 From: report at bugs.python.org (Itamar Turner-Trauring) Date: Fri, 30 Apr 2021 18:59:59 +0000 Subject: [issue40379] multiprocessing's default start method of fork()-without-exec() is broken In-Reply-To: <1587752543.41.0.119768714545.issue40379@roundup.psfhosted.org> Message-ID: <1619809199.81.0.0549566003508.issue40379@roundup.psfhosted.org> Itamar Turner-Trauring added the comment: This change was made on macOS at some point, so why not Linux? "spawn" is already the default on macOS and Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 15:02:05 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Apr 2021 19:02:05 +0000 Subject: [issue43979] Simplify urllib.parse_qsl In-Reply-To: <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org> Message-ID: <1619809325.65.0.881487476908.issue43979@roundup.psfhosted.org> miss-islington added the comment: New changeset 6143fcdf8bfe54c24e3081bcee423f4d51f35c4e by Dong-hee Na in branch 'master': bpo-43979: Remove unnecessary operation from urllib.parse.parse_qsl (GH-25756) https://github.com/python/cpython/commit/6143fcdf8bfe54c24e3081bcee423f4d51f35c4e ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 15:04:02 2021 From: report at bugs.python.org (Evgeny) Date: Fri, 30 Apr 2021 19:04:02 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1619809442.66.0.0608445737984.issue14243@roundup.psfhosted.org> Evgeny added the comment: > Eryk Sun added the comment: > Just implement a separate function for TemporaryFile() instead of aliasing it to NamedTemporaryFile(). See msg390814. Eryk, forgive my ignorance, but aren't in your msg390814 you are proposing yet another enhancement (separate from the issue14243, discussed here), in this case for TemporaryFile in Windows systems? I may be mistaken, but I see that you are proposing some trick with first unlinking the file and then employing it as a temporary file using previously known fd. This "trick" is not present in the current code and does not seem to address issue14243. Or am I talking total nonsense? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 15:15:18 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 30 Apr 2021 19:15:18 +0000 Subject: [issue40379] multiprocessing's default start method of fork()-without-exec() is broken In-Reply-To: <1587752543.41.0.119768714545.issue40379@roundup.psfhosted.org> Message-ID: <1619810118.41.0.691678969913.issue40379@roundup.psfhosted.org> Antoine Pitrou added the comment: The macOS change was required before "fork" simply ceased to work. Windows has always used "spawn", because no other method can be implemented on Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 15:22:21 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Fri, 30 Apr 2021 19:22:21 +0000 Subject: [issue43993] Update bundled pip to 21.1.1 In-Reply-To: <1619809188.59.0.0758758715434.issue43993@roundup.psfhosted.org> Message-ID: <1619810541.24.0.0301172756401.issue43993@roundup.psfhosted.org> Change by St?phane Bidoul : ---------- keywords: +patch pull_requests: +24452 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25761 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 15:27:07 2021 From: report at bugs.python.org (Itamar Turner-Trauring) Date: Fri, 30 Apr 2021 19:27:07 +0000 Subject: [issue40379] multiprocessing's default start method of fork()-without-exec() is broken In-Reply-To: <1587752543.41.0.119768714545.issue40379@roundup.psfhosted.org> Message-ID: <1619810827.37.0.298038308658.issue40379@roundup.psfhosted.org> Itamar Turner-Trauring added the comment: Given people's general experience, I would not say that "fork" works on Linux either. More like "99% of the time it works, 1% it randomly breaks in mysterious way". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 15:31:24 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 30 Apr 2021 19:31:24 +0000 Subject: [issue40379] multiprocessing's default start method of fork()-without-exec() is broken In-Reply-To: <1587752543.41.0.119768714545.issue40379@roundup.psfhosted.org> Message-ID: <1619811084.69.0.658168400346.issue40379@roundup.psfhosted.org> Antoine Pitrou added the comment: Agreed, but again, changing will break some applications. We could switch to forkserver, but we should have a transition period where a FutureWarning will be displayed if people didn't explicitly set a start method. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 15:51:52 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 30 Apr 2021 19:51:52 +0000 Subject: [issue43989] Enum deprecation breaks SSL tests In-Reply-To: <1619802976.1.0.850329373801.issue43989@roundup.psfhosted.org> Message-ID: <1619812312.09.0.948937774091.issue43989@roundup.psfhosted.org> Ethan Furman added the comment: Traveling at the moment, I'll check it out in a few hours. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 16:13:30 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 30 Apr 2021 20:13:30 +0000 Subject: [issue43968] os.path.realpath() unexpected breaking change: resolves subst'd paths to real paths In-Reply-To: <1619627176.09.0.686852454721.issue43968@roundup.psfhosted.org> Message-ID: <1619813610.47.0.531690305539.issue43968@roundup.psfhosted.org> Eryk Sun added the comment: > In our organization we use substituted drives for development, and > no other tools (including other programming languages and their IDEs), > except for Python 3.8+, had any problems with this. How about keeping a substitute or mapped drive from the input path if resolving the root path on the drive prefixes the overall real path? That would be pretty easy to implement. Still, descendant relative symlinks will traverse through the supposed root to the actual real path. Given "Z:" is a substitute drive for r"C:\example\dir", if r"Z:\symlink" targets r"\spam", it will resolve to r"C:\spam", and if it targets r"..\spam", it will resolve to r"C:\example\spam". That violates the assumption that a relative symlink can be resolved against a real path via readlink(), join(), and normpath(). The nearest equivalent to Linux bind mounts are mount-point reparse points (junctions). But the final-path design of realpath() doesn't work how I'd want in that regard. Given the limitations with junctions, if I had to do something like what you're doing, presuming UNC paths are allowed, I'd use a local-only share created via `net share sharename=path /grant:local,full`, accessed as "//localhost/sharename". A share is a bind mount in the namespace of the "UNC" DOS device. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 16:31:34 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 30 Apr 2021 20:31:34 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1619814694.72.0.95989205796.issue14243@roundup.psfhosted.org> Eryk Sun added the comment: > you are proposing some trick with first unlinking the file and > then employing it as a temporary file using previously known fd. It doesn't need to unlink the file to make it anonymous. I included that to highlight that it's possible. The details can be discussed and hashed out in the PR. I don't think implementing TemporaryFile() in Windows is separate from this issue. It goes hand in hand with the decision to stop using O_TEMPORARY in NamedTemporaryFile(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 16:49:07 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 20:49:07 +0000 Subject: [issue43981] test_idle is leaking references In-Reply-To: <1619731760.39.0.648399014878.issue43981@roundup.psfhosted.org> Message-ID: <1619815747.84.0.0195144814931.issue43981@roundup.psfhosted.org> Terry J. Reedy added the comment: I was just about to try adding that exact cleanup close after finishing reading emails ;-). Sorry I didn't think of it last night. Glad it worked. The alternative would have been to skip the test case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 16:51:08 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 30 Apr 2021 20:51:08 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1619815868.6.0.928194946461.issue38530@roundup.psfhosted.org> Dennis Sweeney added the comment: Some research of other projects: LLVM [1][2] ----------- - Compute Levenshtein - Using O(n) memory rather than O(n^2) - Uses UpperBound = (len(typo) + 2) // 3 GCC [3] ------- - Uses Damerau-Levenshtein distance - Counts transpositions like "abcd" <-> "bacd" as one move - Swapping Case as in "a" <-> "A" counts as half a move - cutoff = (longer + 2) // 3 if longer - shorter >= 2 else max(longer // 3, 1) Rust [4] -------- - "maximum allowable edit distance defaults to one-third of the given word." - First checks for exact case-insensitive match, then check for Levenshtein distance small enough, then check if sorted(a.split("_")) == sorted(b.split("_")) Ruby [5] -------- - Quickly filter out words with bad Jaro?Winkler distance - threshold = input.length > 3 ? 0.834 : 0.77 - Only compute Levenshtein for words that remain - threshold = (input.length * 0.25).ceil - Output all good enough words - If no word was good enough then output the closest match. I think there are some good ideas here. [1] https://github.com/llvm/llvm-project/blob/d480f968ad8b56d3ee4a6b6df5532d485b0ad01e/llvm/include/llvm/ADT/edit_distance.h#L42 [2] https://github.com/llvm/llvm-project/blob/e2b3b89bf1ce74bf889897e0353a3e3fa93e4452/clang/lib/Sema/SemaLookup.cpp#L4263 [3] https://github.com/gcc-mirror/gcc/blob/16e2427f50c208dfe07d07f18009969502c25dc8/gcc/spellcheck.c [4] https://github.com/rust-lang/rust/blob/673d0db5e393e9c64897005b470bfeb6d5aec61b/compiler/rustc_span/src/lev_distance.rs#L44 [5] https://github.com/ruby/ruby/blob/48b94b791997881929c739c64f95ac30f3fd0bb9/lib/did_you_mean/spell_checker.rb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 17:04:47 2021 From: report at bugs.python.org (Brett Cannon) Date: Fri, 30 Apr 2021 21:04:47 +0000 Subject: [issue43888] GitHub Actions CI/CD `Coverage` job is broken on master In-Reply-To: <1618833046.45.0.972351861197.issue43888@roundup.psfhosted.org> Message-ID: <1619816687.58.0.746943799023.issue43888@roundup.psfhosted.org> Brett Cannon added the comment: New changeset 726c931b3896dc73fd156e2340b5ef0b8f55cfb7 by Ammar Askar in branch 'master': bpo-43888: Remove coverage builds from CI (GH-25679) https://github.com/python/cpython/commit/726c931b3896dc73fd156e2340b5ef0b8f55cfb7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 17:22:34 2021 From: report at bugs.python.org (Evgeny) Date: Fri, 30 Apr 2021 21:22:34 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1619817754.17.0.693924235364.issue14243@roundup.psfhosted.org> Evgeny added the comment: Eryk, I agree, that implementing TemporaryFile() in Windows goes hand in hand with the decision to stop using O_TEMPORARY in NamedTemporaryFile() The only thing I want to point out is that your suggestion also includes this "unlinking trick" (sorry, may be there is a better description for this), which seems to be separate/extra to the usage of O_TEMPORARY. Hence my newbie questions are: 1) What problem are you trying to solve by this "unlinking trick"? 2) Do we need to have a separate issue raised for this problem? 3) Is this "unlinking trick" using some documented features of Windows? (will it not stop working after some Windows patch)? 4) Will we need to create separate unit tests for this issue? 5) Do we also need to reach a consensus on implementing of this "unlinking trick"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:02:03 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 30 Apr 2021 22:02:03 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619820123.98.0.719106052014.issue43901@roundup.psfhosted.org> Larry Hastings added the comment: Ah, I see. So it wasn't a Windows thing, it was a "we run the test multiple times and that particular test assumed it was only run once" thing. And reflink testing is guaranteed to run every test multiple times. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:05:59 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Apr 2021 22:05:59 +0000 Subject: [issue43935] Fix typo in Turtle.back docstring In-Reply-To: <1619297026.13.0.601314823522.issue43935@roundup.psfhosted.org> Message-ID: <1619820359.49.0.210111307649.issue43935@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24453 pull_request: https://github.com/python/cpython/pull/25762 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:06:13 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 22:06:13 +0000 Subject: [issue43935] Fix typo in Turtle.back docstring In-Reply-To: <1619297026.13.0.601314823522.issue43935@roundup.psfhosted.org> Message-ID: <1619820373.96.0.809838046444.issue43935@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 0048c60f01deec4435748e851f9ec21b504d2d2f by Tarjei B?rland in branch 'master': bpo-43935: Fix typo in Turtle.back() docstring (GH-25581) https://github.com/python/cpython/commit/0048c60f01deec4435748e851f9ec21b504d2d2f ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:06:43 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Apr 2021 22:06:43 +0000 Subject: [issue43935] Fix typo in Turtle.back docstring In-Reply-To: <1619297026.13.0.601314823522.issue43935@roundup.psfhosted.org> Message-ID: <1619820403.29.0.578316055384.issue43935@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24454 pull_request: https://github.com/python/cpython/pull/25763 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:12:39 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Apr 2021 22:12:39 +0000 Subject: [issue43937] Turtle uses the default root window In-Reply-To: <1619346699.57.0.755542402356.issue43937@roundup.psfhosted.org> Message-ID: <1619820759.35.0.24425335251.issue43937@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +24455 pull_request: https://github.com/python/cpython/pull/25593 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:13:04 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Apr 2021 22:13:04 +0000 Subject: [issue43937] Turtle uses the default root window In-Reply-To: <1619346699.57.0.755542402356.issue43937@roundup.psfhosted.org> Message-ID: <1619820784.05.0.404215507642.issue43937@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24456 pull_request: https://github.com/python/cpython/pull/25594 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:13:15 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 22:13:15 +0000 Subject: [issue43534] turtle.textinput window is not transient In-Reply-To: <1616029936.62.0.714792032874.issue43534@roundup.psfhosted.org> Message-ID: <1619820795.31.0.525337674865.issue43534@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: -24313 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:13:26 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 22:13:26 +0000 Subject: [issue43534] turtle.textinput window is not transient In-Reply-To: <1616029936.62.0.714792032874.issue43534@roundup.psfhosted.org> Message-ID: <1619820806.61.0.146502160207.issue43534@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: -24314 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:14:15 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 22:14:15 +0000 Subject: [issue43937] Turtle uses the default root window In-Reply-To: <1619346699.57.0.755542402356.issue43937@roundup.psfhosted.org> Message-ID: <1619820855.68.0.836658774124.issue43937@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:15:35 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 22:15:35 +0000 Subject: [issue43944] Processes in Python 3.9 exiting with code 1 when It's created inside a ThreadPoolExecutor In-Reply-To: <1619470785.38.0.461987263008.issue43944@roundup.psfhosted.org> Message-ID: <1619820935.25.0.933492000141.issue43944@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +davin, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:16:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 22:16:15 +0000 Subject: [issue43988] Add test.support.assert_dissallow_instantiation In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1619820975.97.0.0135283614847.issue43988@roundup.psfhosted.org> STINNER Victor added the comment: You can take this issue as an opportunity to fix my typo :-) Lib/test/test_hashlib.py: "test_disallow_instanciation" => "test_disallow_instantiation". https://github.com/python/cpython/commit/665c7746fca180266b121183c2d5136c547006e0#commitcomment-50235589 There are now many tests: Lib/test/test_array.py: def test_disallow_instantiation(self): Lib/test/test_curses.py: def test_disallow_instantiation(self): Lib/test/test_dbm_gnu.py: def test_disallow_instantiation(self): Lib/test/test_embed.py: def test_disallow_instantiation(self): Lib/test/test_functools.py: def test_disallow_instantiation(self): Lib/test/test_hashlib.py: def test_disallow_instanciation(self): Lib/test/test_hashlib.py: def test_hash_disallow_instanciation(self): Lib/test/test_re.py: def test_disallow_instantiation(self): Lib/test/test_select.py: def test_disallow_instantiation(self): Lib/test/test_threading.py: def test_disallow_instantiation(self): Lib/test/test_unicodedata.py: def test_disallow_instantiation(self): Lib/test/test_zlib.py: def test_disallow_instantiation(self): ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:16:45 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 22:16:45 +0000 Subject: [issue43948] sysconfig's osx_framework_user puts headers in different locations from distutils In-Reply-To: <1619510005.78.0.165065669518.issue43948@roundup.psfhosted.org> Message-ID: <1619821005.65.0.648387171118.issue43948@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: sysconfig?s osx_framework_user puts headers in different locations from distutils -> sysconfig's osx_framework_user puts headers in different locations from distutils versions: -Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:27:57 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Apr 2021 22:27:57 +0000 Subject: [issue43935] Fix typo in Turtle.back docstring In-Reply-To: <1619297026.13.0.601314823522.issue43935@roundup.psfhosted.org> Message-ID: <1619821677.57.0.218444539597.issue43935@roundup.psfhosted.org> miss-islington added the comment: New changeset a7f15ba5476051471638957b4d028097d080b290 by Miss Islington (bot) in branch '3.9': bpo-43935: Fix typo in Turtle.back() docstring (GH-25581) https://github.com/python/cpython/commit/a7f15ba5476051471638957b4d028097d080b290 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:28:13 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 22:28:13 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1619821693.32.0.380928219666.issue43950@roundup.psfhosted.org> Terry J. Reedy added the comment: Specific examples of current messages and proposed improvements would help focus discussion. If you are willing to only handle code lines up to 256 chars, only 2 bytes should be needed. (0,0) or (255,255) could mean 'somewhere beyond the 256th char'. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:33:00 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 22:33:00 +0000 Subject: [issue43969] "bad magic number" when Python 2's pyc file exists without py file In-Reply-To: <1619642212.93.0.461785778702.issue43969@roundup.psfhosted.org> Message-ID: <1619821980.67.0.0731930147678.issue43969@roundup.psfhosted.org> Terry J. Reedy added the comment: Unless you find documentation that says otherwise, this an enhancement proposal for 3.11. If no core developer (other than me) jumps on this, you might use git blame to fine out who committed code in the area you proposed changing. ---------- nosy: +terry.reedy type: behavior -> enhancement versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:35:13 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 22:35:13 +0000 Subject: [issue43928] Fix the typo in documentation Message-ID: <1619822113.87.0.33832641215.issue43928@roundup.psfhosted.org> New submission from Terry J. Reedy : New changeset e08c67372d62236409da296353827985a3202e8a by JT in branch 'master': bpo-43928: Fix 'succesfully' typo in document (GH-25569) https://github.com/python/cpython/commit/e08c67372d62236409da296353827985a3202e8a ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:35:52 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 22:35:52 +0000 Subject: [issue43935] Fix typo in Turtle.back docstring In-Reply-To: <1619297026.13.0.601314823522.issue43935@roundup.psfhosted.org> Message-ID: <1619822152.64.0.748922753701.issue43935@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset e377ecf3b496c7719e6dffe3ebf3d0ef512cfb5b by Miss Islington (bot) in branch '3.8': bpo-43935: Fix typo in Turtle.back() docstring (GH-25581) https://github.com/python/cpython/commit/e377ecf3b496c7719e6dffe3ebf3d0ef512cfb5b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:36:24 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 22:36:24 +0000 Subject: [issue43935] Fix typo in Turtle.back docstring In-Reply-To: <1619297026.13.0.601314823522.issue43935@roundup.psfhosted.org> Message-ID: <1619822184.32.0.37922453569.issue43935@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:38:45 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 22:38:45 +0000 Subject: [issue43928] Fix the typo in documentation In-Reply-To: <1619822113.87.0.33832641215.issue43928@roundup.psfhosted.org> Message-ID: <1619822325.2.0.926031660373.issue43928@roundup.psfhosted.org> Terry J. Reedy added the comment: Merge conflict in 3.9. Skipping backports. ---------- resolution: not a bug -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:39:35 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 22:39:35 +0000 Subject: [issue43988] Add test.support.assert_dissallow_instantiation In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1619822375.66.0.74230621261.issue43988@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: I'll fix your typo ;) I'll include the rest of the test in the PR. I just pushed it out quickly to get a review of the solution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:40:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 22:40:43 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619822443.89.0.421303316022.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: Status in Python 3.9. 5 types allow instantiation whereas they must not: BUG!!! * _tkinter.Tcl_Obj * _tkinter.tkapp * _tkinter.tktimertoken * zlib.Compress * zlib.Decompress Example of bug: $ python3.9 Python 3.9.4 >>> import zlib >>> obj=zlib.compressobj() >>> obj2=type(obj)() >>> obj2.copy() Erreur de segmentation (core dumped) --- The remaining types disallow instantiation with different ways. Static type with tp_base=NULL and tp_new=NULL: * _dbm.dbm * _gdbm.gdbm * _multibytecodec.MultibyteCodec * _sre.SRE_Scanner * _thread._localdummy * _thread.lock * _winapi.Overlapped * _xxsubinterpretersmodule.ChannelID * array.arrayiterator * functools.KeyWrapper * functools._lru_list_elem * pyexpat.xmlparser * re.Match * re.Pattern * unicodedata.UCD * _xxsubinterpreters.ChannelID Heap type setting tp_new to NULL after type creation: * _curses_panel.panel Static type setting tp_new to NULL after type creation: * _curses.ncurses_version type * sys.flags type * sys.getwindowsversion() type * sys.version_info type Define a tp_new or tp_init function which always raise an exception: * PyStdPrinter_Type * _hashlib.HASH * _hashlib.HASHXOF * _hashlib.HMAC * os.DirEntry * os.ScandirIterator * select.poll ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:41:40 2021 From: report at bugs.python.org (Ammar Askar) Date: Fri, 30 Apr 2021 22:41:40 +0000 Subject: [issue43888] GitHub Actions CI/CD `Coverage` job is broken on master In-Reply-To: <1618833046.45.0.972351861197.issue43888@roundup.psfhosted.org> Message-ID: <1619822500.42.0.382298321012.issue43888@roundup.psfhosted.org> Ammar Askar added the comment: Coverage builds have been removed from the CI, closing this now. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:42:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 22:42:22 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619822542.88.0.955837198819.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: * _tkinter.Tcl_Obj * _tkinter.tkapp * _tkinter.tktimertoken Oops, sorry: in Python 3.9, tp_new is set to NULL after these heap types are created. There is no bug for these 3 types. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:43:36 2021 From: report at bugs.python.org (Ammar Askar) Date: Fri, 30 Apr 2021 22:43:36 +0000 Subject: [issue43982] Code coverage on the CI: validate codecov shell script checksum In-Reply-To: <1619739408.19.0.291224882585.issue43982@roundup.psfhosted.org> Message-ID: <1619822616.22.0.257206772827.issue43982@roundup.psfhosted.org> Ammar Askar added the comment: With issue43888 being fixed with the removal of the coverage build, this is now obsolete. Thanks for pointing out the codecov breach, we will make sure to follow this if we ever re-add codecov. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:46:32 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 22:46:32 +0000 Subject: [issue43971] documentation: no spacing around default args in annotated function In-Reply-To: <1619656492.65.0.621784631269.issue43971@roundup.psfhosted.org> Message-ID: <1619822792.21.0.794865807843.issue43971@roundup.psfhosted.org> Terry J. Reedy added the comment: >From PEP 8: right: label: str = '' wrong: result: int=0 # No spaces around equality sign current doc: quantity_on_hand: int=0): ---------- assignee: docs at python -> terry.reedy nosy: +terry.reedy versions: -Python 3.11, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:48:36 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 22:48:36 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1619822916.05.0.713137408037.issue43976@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: Introduce mechanism to allow Python distributors to add custom site install schemes -> Allow Python distributors to add custom site install schemes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:49:51 2021 From: report at bugs.python.org (Anthony Sottile) Date: Fri, 30 Apr 2021 22:49:51 +0000 Subject: [issue43994] change representation of match as / capture as `Name(..., ctx=Store())` Message-ID: <1619822991.2.0.658600538684.issue43994@roundup.psfhosted.org> New submission from Anthony Sottile : I'm looking at adding support to `match` for pyflakes, and the first impression I have is that `MatchAs` is unnecessarily different from `Name` with `ctx=Store()` if it were represented as the latter pyflakes would not require special handling of `match`, it would work the same as the current code I suspect other static analysis tools would benefit from a change as well ---------- messages: 392531 nosy: Anthony Sottile priority: normal severity: normal status: open title: change representation of match as / capture as `Name(..., ctx=Store())` versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:56:43 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 22:56:43 +0000 Subject: [issue43995] test_grammar fails if run sequentially Message-ID: <1619823403.82.0.693655826383.issue43995@roundup.psfhosted.org> New submission from Erlend Egeberg Aasland : To reproduce: $ ./python.exe -m test test_typing test_grammar 0:00:00 load avg: 1.95 Run tests sequentially 0:00:00 load avg: 1.95 [1/2] test_typing 0:00:00 load avg: 1.95 [2/2] test_grammar test test_grammar failed -- Traceback (most recent call last): File "/Users/erlendaasland/src/cpython-support/Lib/test/test_grammar.py", line 396, in test_var_annot_in_module with self.assertRaises(NameError): AssertionError: NameError not raised test_grammar failed == Tests result: FAILURE == 1 test OK. 1 test failed: test_grammar Total duration: 969 ms Tests result: FAILURE ---------- components: Tests messages: 392532 nosy: erlendaasland, pablogsal priority: normal severity: normal status: open title: test_grammar fails if run sequentially versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:57:00 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 22:57:00 +0000 Subject: [issue43995] test_grammar fails if run sequentially In-Reply-To: <1619823403.82.0.693655826383.issue43995@roundup.psfhosted.org> Message-ID: <1619823420.83.0.763182522148.issue43995@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- keywords: +patch pull_requests: +24457 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25764 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 18:59:18 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 22:59:18 +0000 Subject: [issue43983] Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit In-Reply-To: <1619754997.92.0.813433762257.issue43983@roundup.psfhosted.org> Message-ID: <1619823558.59.0.971545393163.issue43983@roundup.psfhosted.org> Terry J. Reedy added the comment: The error message suggests somethng else is using something in an existing 3.9 directory, and that you should close everything and reboot your machine and try again without running anything else. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 19:00:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 23:00:50 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619823650.97.0.117512006428.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: I checked " Types converted pre Python 3.9" and "Types converted in Python 3.9" of: https://discuss.python.org/t/list-of-built-in-types-converted-to-heap-types/8403 (I didn't check "Types converted in Python 3.10" yet.) These lists are not complete, for example select.kevent was not listed whereas it has a bug. _struct.unpack_iterator can be modified to use Py_TPFLAGS_DISALLOW_INSTANTIATION: its tp_new method always raises an exception. Bugs! * select.kevent: BUG, use {Py_tp_new, PyType_GenericNew} slot which doesn't properly initialize kqueue_event_Object! Need review: * _ast.AST: use {Py_tp_new, PyType_GenericNew} and {Py_tp_init, ast_type_init} slots. What happens if tp_new is called without calling tp_init? Implement tp_new (ok!): * _abc._abc_data * _json.Scanner * _json.Encoder * select.devpoll * select.epoll * select.kqueue * _random.Random * _struct.Struct Other cases (ok!): * _ssl.SSLError inherits from OSError and reuses OSError structure (PyOSErrorObject): the inherited tp_new works as expected. * select.poll: Py_TPFLAGS_DISALLOW_INSTANTIATION ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 19:04:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 30 Apr 2021 23:04:40 +0000 Subject: [issue43988] Add test.support.assert_dissallow_instantiation In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1619823880.05.0.0108287834271.issue43988@roundup.psfhosted.org> STINNER Victor added the comment: You can keep PR 25757 to add the helper function, and then write a second PR to use it in all tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 19:07:09 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Apr 2021 23:07:09 +0000 Subject: [issue43971] documentation: no spacing around default args in annotated function In-Reply-To: <1619656492.65.0.621784631269.issue43971@roundup.psfhosted.org> Message-ID: <1619824029.88.0.49546371997.issue43971@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +24459 pull_request: https://github.com/python/cpython/pull/25766 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 19:07:04 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Apr 2021 23:07:04 +0000 Subject: [issue43971] documentation: no spacing around default args in annotated function In-Reply-To: <1619656492.65.0.621784631269.issue43971@roundup.psfhosted.org> Message-ID: <1619824024.29.0.199339350882.issue43971@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +24458 pull_request: https://github.com/python/cpython/pull/25765 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 19:07:21 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Apr 2021 23:07:21 +0000 Subject: [issue43971] documentation: no spacing around default args in annotated function In-Reply-To: <1619656492.65.0.621784631269.issue43971@roundup.psfhosted.org> Message-ID: <1619824041.95.0.2114398586.issue43971@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset e726a902b7c73a7056b7421d801e47ffff255873 by Mohamed Moselhy in branch 'master': bpo-43971: Add spaces around annotated arg default '=' (GH-25702) https://github.com/python/cpython/commit/e726a902b7c73a7056b7421d801e47ffff255873 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 19:10:58 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 23:10:58 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619824258.11.0.726524060394.issue43916@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: > These lists are not complete, for example select.kevent was not listed whereas it has a bug. If one of the admins could make that post into a wiki post, it would be open for editing, making it easier to fill the holes in the lists. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 19:23:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 23:23:21 +0000 Subject: [issue43995] test_grammar fails if run sequentially In-Reply-To: <1619823403.82.0.693655826383.issue43995@roundup.psfhosted.org> Message-ID: <1619825001.61.0.695234978789.issue43995@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset e467ec476f624323b8638cf100d1bfbf1d6a21c6 by Erlend Egeberg Aasland in branch 'master': bpo-43995: Fix reference leak in test_grammar (GH-25764) https://github.com/python/cpython/commit/e467ec476f624323b8638cf100d1bfbf1d6a21c6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 19:23:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 23:23:34 +0000 Subject: [issue43995] test_grammar fails if run sequentially In-Reply-To: <1619823403.82.0.693655826383.issue43995@roundup.psfhosted.org> Message-ID: <1619825014.61.0.994616349442.issue43995@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks for the quick fix Erlend! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 19:25:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 23:25:22 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1619825122.39.0.612711628456.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Specific examples of current messages and proposed improvements would help focus discussion. Yeah, I am proposing going from: >>> x['aaaaaa']['bbbbbb']['cccccc']['dddddd'].sddfsdf.sdfsdf Traceback (most recent call last): File "", line 1, in TypeError: 'NoneType' object is not subscriptable to >>> x['aaaaaa']['bbbbbb']['cccccc']['dddddd'].sddfsdf.sdfsdf ^^^^^^^^^^ Traceback (most recent call last): File "", line 1, in TypeError: 'NoneType' object is not subscriptable ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 19:26:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 23:26:53 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1619825213.56.0.145235646741.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Basically, to highlight in all exceptions the range in the displayed line where the error ocurred. For instance: >>> foo(a, b/z+2, c, 132432 /x, d /y) ^^^^^^^^^ Traceback (most recent call last): File "", line 1, in ZeroDivisionError: division by zero ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 19:27:35 2021 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Fri, 30 Apr 2021 23:27:35 +0000 Subject: [issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules In-Reply-To: <1618987441.84.0.207444160908.issue43901@roundup.psfhosted.org> Message-ID: <1619825255.19.0.851966304486.issue43901@roundup.psfhosted.org> Erlend Egeberg Aasland added the comment: test_grammar also needed a fix. It has been updated to use import_helper.import_fresh_module in bpo-43995 (GH-25764). ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 19:28:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 23:28:14 +0000 Subject: [issue38530] Offer suggestions on AttributeError and NameError In-Reply-To: <1571511451.65.0.74942926189.issue38530@roundup.psfhosted.org> Message-ID: <1619825294.51.0.235261310482.issue38530@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Hi Dennis, this is a fantastic investigation! I think I really like GCC approach here. We may want to invest into porting some of their ideas into our solution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 19:33:00 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 30 Apr 2021 23:33:00 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1619825580.56.0.739484400597.issue41486@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 251ffa9d2b16b091046720628deb6a7906c35d29 by Ma Lin in branch 'master': bpo-41486: Fix initial buffer size can't > UINT32_MAX in zlib module (GH-25738) https://github.com/python/cpython/commit/251ffa9d2b16b091046720628deb6a7906c35d29 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 19:39:44 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 23:39:44 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619825984.37.0.365492083376.issue43916@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > If one of the admins could make that post into a wiki post, it would be open for editing, making it easier to fill the holes in the lists. Not sure what do you have in mind for the wiki, but the easiest is to open some GitHub issue somewhere or using https://discuss.python.org/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 19:43:42 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Apr 2021 23:43:42 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619826222.08.0.483485574513.issue43916@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > * _ast.AST: use {Py_tp_new, PyType_GenericNew} and {Py_tp_init, ast_type_init} slots. What happens if tp_new is called without calling tp_init? I think this is fine since ast_type_init doesn't initialize any C fields and only mutates the object by using PyObject_SetAttr ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 19:51:16 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 30 Apr 2021 23:51:16 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1619826676.07.0.799012901447.issue43950@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 20:04:47 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 01 May 2021 00:04:47 +0000 Subject: [issue43994] change representation of match as / capture as `Name(..., ctx=Store())` In-Reply-To: <1619822991.2.0.658600538684.issue43994@roundup.psfhosted.org> Message-ID: <1619827487.01.0.917113527531.issue43994@roundup.psfhosted.org> Brandt Bucher added the comment: Do you mind providing a bit more context? I'm sort of confused what exactly is being proposed here (as far as I can tell, it's not really possible to represent " as " with a single Name node). Also, I'm not sure if you're aware, but we just completed a huge overhaul of the ASTs generated for match statements. This work was specifically done for clients of the AST like mypy. See the discussion at: https://github.com/python/mypy/pull/10191 and in issue 43892. The new nodes are documented here: https://docs.python.org/3.10/library/ast.html?highlight=matchas#pattern-matching ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 20:06:33 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 01 May 2021 00:06:33 +0000 Subject: [issue43979] Simplify urllib.parse_qsl In-Reply-To: <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org> Message-ID: <1619827593.44.0.745825128009.issue43979@roundup.psfhosted.org> Change by Dong-hee Na : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 20:06:27 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 01 May 2021 00:06:27 +0000 Subject: [issue22167] iglob() has misleading documentation (does indeed store names internally) In-Reply-To: <1407460141.27.0.298063472331.issue22167@psf.upfronthosting.co.za> Message-ID: <1619827587.85.0.190489669096.issue22167@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 8.0 -> 9.0 pull_requests: +24460 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25767 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 20:06:39 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 01 May 2021 00:06:39 +0000 Subject: [issue43979] Simplify urllib.parse_qsl In-Reply-To: <1619724565.9.0.228522372223.issue43979@roundup.psfhosted.org> Message-ID: <1619827599.8.0.618114405959.issue43979@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 20:13:38 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 01 May 2021 00:13:38 +0000 Subject: [issue43994] change representation of match as / capture as `Name(..., ctx=Store())` In-Reply-To: <1619822991.2.0.658600538684.issue43994@roundup.psfhosted.org> Message-ID: <1619828018.87.0.245995537872.issue43994@roundup.psfhosted.org> Brandt Bucher added the comment: FWIW, I'm never used pyflakes, but I'm not really sure how it would be able to provide useful linting by just treating patterns as expressions (which is what I assume is desired here). I assume that these are the three lines you're trying to get rid of? https://github.com/asottile/pyflakes/blob/silly_match_statement/pyflakes/checker.py#L2390-L2392 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 20:30:45 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 01 May 2021 00:30:45 +0000 Subject: [issue43971] documentation: no spacing around default args in annotated function In-Reply-To: <1619656492.65.0.621784631269.issue43971@roundup.psfhosted.org> Message-ID: <1619829045.92.0.651562067664.issue43971@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset e48405a9be067d50d6d0d83dc22013fc68f15657 by Miss Islington (bot) in branch '3.9': bpo-43971: Add spaces around annotated arg default '=' (GH-25702) https://github.com/python/cpython/commit/e48405a9be067d50d6d0d83dc22013fc68f15657 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 20:31:08 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 01 May 2021 00:31:08 +0000 Subject: [issue43971] documentation: no spacing around default args in annotated function In-Reply-To: <1619656492.65.0.621784631269.issue43971@roundup.psfhosted.org> Message-ID: <1619829068.19.0.377170804673.issue43971@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 606bb1c77c66eca081d03374ad4b53d9e603dd9d by Miss Islington (bot) in branch '3.8': bpo-43971: Add spaces around annotated arg default '=' (GH-25702) https://github.com/python/cpython/commit/606bb1c77c66eca081d03374ad4b53d9e603dd9d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 20:34:44 2021 From: report at bugs.python.org (Mark Sapiro) Date: Sat, 01 May 2021 00:34:44 +0000 Subject: [issue43996] Doc for mutable sequence pop() method implies argument is a slice or sequence. Message-ID: <1619829284.94.0.13979953876.issue43996@roundup.psfhosted.org> New submission from Mark Sapiro : In several places in the documentation including: ``` grep -rn 'pop.\[i\]' Lib/pydoc_data/topics.py:13184: '| "s.pop([i])" | retrieves the item at *i* ' Lib/pydoc_data/topics.py:13647: '| "s.pop([i])" | retrieves the item at ' Doc/tutorial/datastructures.rst:47:.. method:: list.pop([i]) Doc/library/array.rst:193:.. method:: array.pop([i]) Doc/library/stdtypes.rst:1116:| ``s.pop([i])`` | retrieves the item at *i* and | \(2) | ``` the mutable sequence and array `pop()` method is documented as shown above in a way that implies the argument to `pop()` is a slice or sequence when it is actually just an integer. All those references should be `pop(i)` rather than `pop([i])`. ---------- assignee: docs at python components: Documentation messages: 392551 nosy: docs at python, msapiro priority: normal severity: normal status: open title: Doc for mutable sequence pop() method implies argument is a slice or sequence. type: behavior versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 20:37:31 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 01 May 2021 00:37:31 +0000 Subject: [issue43994] change representation of match as / capture as `Name(..., ctx=Store())` In-Reply-To: <1619822991.2.0.658600538684.issue43994@roundup.psfhosted.org> Message-ID: <1619829451.77.0.5566386956.issue43994@roundup.psfhosted.org> Anthony Sottile added the comment: I'm suggesting instead of: MatchAs(pattern=None, name='foo') to have MatchAs(pattern=None, name=Name('foo', ctx=Store())) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 20:43:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 01 May 2021 00:43:12 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619829792.22.0.86686528077.issue43916@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Something is wrong after commit 3bb09947ec4837de75532e21dd4bd25db0a1f1b7. When building Python I am getting: *** WARNING: renaming "_curses" since importing it failed: /home/pablogsal/github/python/master/build/lib.linux-x86_64-3.10-pydebug/_curses.cpython-310d-x86_64-linux-gnu.so: undefined symbol: _PyStructSequence_InitType *** WARNING: renaming "_curses_panel" since importing it failed: No module named '_curses' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 20:48:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 01 May 2021 00:48:58 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619830138.94.0.873500284336.issue43916@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The problem is that the curses module is using a function that requires to be built in the core: #ifdef Py_BUILD_CORE extern int _PyStructSequence_InitType( PyTypeObject *type, PyStructSequence_Desc *desc, unsigned long tp_flags); #endif ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 20:51:48 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 01 May 2021 00:51:48 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1619830308.1.0.559546689292.issue43950@roundup.psfhosted.org> Terry J. Reedy added the comment: Marking what expression evaluated to None would be extremely helpful. So would marking the 0 denominator when there is more than one candidate: "e = a/b + c/d". It should be easy to revise IDLE Shell's print_exception to tag the span. In some cases, the code that goes from a traceback line to a line in a file and marks it could do the same. What would you do when the expression is not the last line? try: x/y ... except Exception as e: ... raise e The except and raise might even be in a separate module. I look forward to the PEP and discussion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 20:55:04 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 01 May 2021 00:55:04 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619830504.34.0.0602687582117.issue43916@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +24461 pull_request: https://github.com/python/cpython/pull/25768 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 20:55:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 01 May 2021 00:55:26 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619830526.23.0.772033267853.issue43916@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The build errors were in the CI, but because Python doesn't complain if it cannot build a module, then we never catched this. I have opened https://github.com/python/cpython/pull/25768 to fix it to unblock the release, since the curses module is broken currently. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 20:59:23 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 01 May 2021 00:59:23 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1619830763.54.0.923141860282.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > So would marking the 0 denominator when there is more than one candidate: "e = a/b + c/d". No, it will mark the offset of the bytecode that was getting executed when the exception was raised. Is just a way to mark what is raising the particular exception > What would you do when the expression is not the last line? There is some logic needed to re-raise exceptions. But basically it boils down to comparate the line numbers to decide if you want to propagate or not the offsets. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 21:21:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 01 May 2021 01:21:26 +0000 Subject: [issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag In-Reply-To: <1619127118.97.0.615486795072.issue43916@roundup.psfhosted.org> Message-ID: <1619832086.8.0.531136371373.issue43916@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 558df9010915c8fe94f4d7f842e7c5aabbb06b14 by Pablo Galindo in branch 'master': bpo-43916: Export the _PyStructSequence_InitType to fix build errors in the curses module (GH-25768) https://github.com/python/cpython/commit/558df9010915c8fe94f4d7f842e7c5aabbb06b14 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 21:32:51 2021 From: report at bugs.python.org (Inada Naoki) Date: Sat, 01 May 2021 01:32:51 +0000 Subject: [issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows In-Reply-To: <1331345648.86.0.0206250913108.issue14243@psf.upfronthosting.co.za> Message-ID: <1619832771.86.0.446719033795.issue14243@roundup.psfhosted.org> Inada Naoki added the comment: +1 to Eryk. > Hence my newbie questions are: 1) What problem are you trying to solve by this "unlinking trick"? Same to TempoaryFile in Unix. 2) Do we need to have a separate issue raised for this problem? I don't think so. We didn't unlink because wi didn't have separate implementation for TemporaryFile and NamedTemporaryFile. When we have two implementations for them, it is straightforward and natural to use unlink trick. 3) Is this "unlinking trick" using some documented features of Windows? (will it not stop working after some Windows patch)? I am not sure. But it is "POSIX function" in windows. I believe MS won't break compatibility. 4) Will we need to create separate unit tests for this issue? We already have tests for TemporaryFile. 5) Do we also need to reach a consensus on implementing of this "unlinking trick"? If anyone against it. But I think Eryk's proposal is the most reasonable. ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 21:34:32 2021 From: report at bugs.python.org (robertohueso) Date: Sat, 01 May 2021 01:34:32 +0000 Subject: [issue43989] Enum deprecation breaks SSL tests In-Reply-To: <1619802976.1.0.850329373801.issue43989@roundup.psfhosted.org> Message-ID: <1619832872.34.0.489723279881.issue43989@roundup.psfhosted.org> Change by robertohueso : ---------- nosy: +robertohueso nosy_count: 7.0 -> 8.0 pull_requests: +24462 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25769 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 21:45:10 2021 From: report at bugs.python.org (Marwan Essam) Date: Sat, 01 May 2021 01:45:10 +0000 Subject: [issue43983] Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit In-Reply-To: <1619754997.92.0.813433762257.issue43983@roundup.psfhosted.org> Message-ID: <1619833510.28.0.22343656772.issue43983@roundup.psfhosted.org> Marwan Essam added the comment: Hello Terry, thank you for replying. I tried many times to reboot and no luck. Also i noticed that when i tried to install an older version like Python 2 the installation done without errors. ---------- nosy: +Marwan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 21:49:39 2021 From: report at bugs.python.org (Marwan Essam) Date: Sat, 01 May 2021 01:49:39 +0000 Subject: [issue43983] Can't install Python v3.9.4 / 0x80070643 / windows 10 64bit In-Reply-To: <1619754997.92.0.813433762257.issue43983@roundup.psfhosted.org> Message-ID: <1619833779.33.0.69894000662.issue43983@roundup.psfhosted.org> Marwan Essam added the comment: Also if you are talking about the location of installation, i tried to install it in somewhere else and still not working ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 22:07:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 01 May 2021 02:07:43 +0000 Subject: [issue43957] [Enum] update __contains__ to return True for valid values In-Reply-To: <1619550668.75.0.616141985831.issue43957@roundup.psfhosted.org> Message-ID: <1619834863.06.0.175497752195.issue43957@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 1.0 -> 2.0 pull_requests: +24463 pull_request: https://github.com/python/cpython/pull/25770 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 22:08:32 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 01 May 2021 02:08:32 +0000 Subject: [issue43994] change representation of match as / capture as `Name(..., ctx=Store())` In-Reply-To: <1619822991.2.0.658600538684.issue43994@roundup.psfhosted.org> Message-ID: <1619834912.99.0.636015392521.issue43994@roundup.psfhosted.org> Anthony Sottile added the comment: and actually, now that I look close it would be useful for `MatchStar` and `MatchMapping` to also use a `Name(..., ctx=Store())` for their respective parameters as well ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 22:12:42 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 01 May 2021 02:12:42 +0000 Subject: [issue43997] dataclasses documentation needs version added for match_args, kw_only, and slots Message-ID: <1619835162.18.0.39388783507.issue43997@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: eric.smith priority: normal severity: normal stage: needs patch status: open title: dataclasses documentation needs version added for match_args, kw_only, and slots versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 22:13:02 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 01 May 2021 02:13:02 +0000 Subject: [issue43997] dataclasses documentation needs version added for match_args, kw_only, and slots Message-ID: <1619835182.56.0.463913467384.issue43997@roundup.psfhosted.org> Change by Eric V. Smith : ---------- assignee: -> docs at python components: +Documentation keywords: +easy, newcomer friendly nosy: +docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 22:14:36 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 01 May 2021 02:14:36 +0000 Subject: [issue42269] Add ability to set __slots__ in dataclasses In-Reply-To: <1604590694.08.0.0173517280171.issue42269@roundup.psfhosted.org> Message-ID: <1619835276.53.0.21898198304.issue42269@roundup.psfhosted.org> Eric V. Smith added the comment: New changeset c24199184bea0c851c1a7296ae54aaf18ee56752 by Yurii Karabas in branch 'master': bpo-42269: Add slots parameter to dataclass decorator (GH-24171) https://github.com/python/cpython/commit/c24199184bea0c851c1a7296ae54aaf18ee56752 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 22:15:08 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 01 May 2021 02:15:08 +0000 Subject: [issue42269] Add ability to set __slots__ in dataclasses In-Reply-To: <1604590694.08.0.0173517280171.issue42269@roundup.psfhosted.org> Message-ID: <1619835308.36.0.0898092132118.issue42269@roundup.psfhosted.org> Eric V. Smith added the comment: Thanks for all of your work, Yurii. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 22:25:56 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 01 May 2021 02:25:56 +0000 Subject: [issue43994] change representation of match as / capture as `Name(..., ctx=Store())` In-Reply-To: <1619822991.2.0.658600538684.issue43994@roundup.psfhosted.org> Message-ID: <1619835956.01.0.916272419709.issue43994@roundup.psfhosted.org> Brandt Bucher added the comment: + Nick and Guido The only benefit I see on our side is that it leaves the door open for complex assignment targets in the future, like (a, b), a[b], etc. (If I recall correctly, this is also why NamedExpr uses an expr target rather than just an identifier.) I guess I'm neutral on this. The usability argument seems weak, but I can see the separate case for forward-compatibility with possible syntax extensions in the future. Thoughts? Marking as high priority since we need to make a decision on this before the beta. ---------- nosy: +gvanrossum, ncoghlan priority: normal -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 22:28:03 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 01 May 2021 02:28:03 +0000 Subject: [issue43994] change representation of match as / capture as `Name(..., ctx=Store())` In-Reply-To: <1619822991.2.0.658600538684.issue43994@roundup.psfhosted.org> Message-ID: <1619836083.5.0.165578887854.issue43994@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +freundTech _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 23:02:30 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 01 May 2021 03:02:30 +0000 Subject: [issue43994] change representation of match as / capture as `Name(..., ctx=Store())` In-Reply-To: <1619822991.2.0.658600538684.issue43994@roundup.psfhosted.org> Message-ID: <1619838150.76.0.464255291817.issue43994@roundup.psfhosted.org> Guido van Rossum added the comment: I'm -0.5 on reusing Name(ctx=Store). The reason we're using that in assignments is that in the past (before the PEG parser) the parser literally used the same grammar for the LHS and RHS of assignments, and a second pass was used to rule out invalid targets (like "1 = e" or "f() = a") and mark the Name nodes representing targets as stores. We don't reuse Name nodes for other binding targets like parameters or imports. PS. To reach Mark it's best to email him directly, he's not very responsive to GitHub notifications (there are too many). PPSS. I'm on vacation until May 8 and am trying not to check my email much. But I already failed on the first day. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 23:12:27 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 01 May 2021 03:12:27 +0000 Subject: [issue43996] Doc for mutable sequence pop() method implies argument is a slice or sequence. In-Reply-To: <1619829284.94.0.13979953876.issue43996@roundup.psfhosted.org> Message-ID: <1619838747.16.0.647665850152.issue43996@roundup.psfhosted.org> Raymond Hettinger added the comment: In function signatures, the square brackets do not mean that there is a list. Instead, it is a convention used throughout the docs to mean that an argument is optional. In this case, s.pop([i]) means that both of these are valid calls: # retrieve and remove the value at a specific position somelist.pop(10) # retrieve and remove the rightmost value somelist.pop() Thank you for the report, but the documentation is correct. ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 23:25:43 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 01 May 2021 03:25:43 +0000 Subject: [issue43994] change representation of match as / capture as `Name(..., ctx=Store())` In-Reply-To: <1619822991.2.0.658600538684.issue43994@roundup.psfhosted.org> Message-ID: <1619839543.01.0.923366045119.issue43994@roundup.psfhosted.org> Anthony Sottile added the comment: at least for static analysis of other python constructs it's very convenient to know from a `Name` node alone whether it's being used in a read or write context -- without this information an ast traversal needs to maintain more information about whether it's a read or write context for pyflakes this is especially important as it needs to know what names are defined in scope (and referenced in scope) to produce diagnostic messages for other tools like `dead` / `vulture` it's useful to identify introduced and referenced names similarly the `as` in `with` does and the target for assignment expressions so I would expect the similar constructs in `match` to do so as well `Name` nodes are also useful for better diagnostic messages as they contain positioning information, which isn't easily extracted from `MatchAs`, etc. -- if I recall correctly, the `asname` for imports was recently extended to add this information for the same purpose ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 30 23:51:20 2021 From: report at bugs.python.org (Mark Sapiro) Date: Sat, 01 May 2021 03:51:20 +0000 Subject: [issue43996] Doc for mutable sequence pop() method implies argument is a slice or sequence. In-Reply-To: <1619829284.94.0.13979953876.issue43996@roundup.psfhosted.org> Message-ID: <1619841080.82.0.601734048974.issue43996@roundup.psfhosted.org> Mark Sapiro added the comment: Thank you for the explanation which I understand and accept. I also fully (or maybe not quite fully) understand the use of square brackets to indicate optional arguments. It's just that in the context of the table at https://docs.python.org/3/library/stdtypes.html#mutable-sequence-types every other use of square brackets indicates a list or a slice and that's what confused me. Granted, all the other square bracket usage was not around a method argument, and I accept that the doc is correct, but I still found it confusing. ---------- _______________________________________ Python tracker _______________________________________